From a41594b4a4543a9565e7551d8ddac139ffd8180d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 28 Nov 2010 20:44:17 +0100 Subject: [PATCH] cdef another class in ParseTreeTransforms --- Cython/Compiler/ParseTreeTransforms.pxd | 6 +++--- Cython/Compiler/ParseTreeTransforms.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cython/Compiler/ParseTreeTransforms.pxd b/Cython/Compiler/ParseTreeTransforms.pxd index 20011e94..77dd4a9a 100644 --- a/Cython/Compiler/ParseTreeTransforms.pxd +++ b/Cython/Compiler/ParseTreeTransforms.pxd @@ -1,10 +1,10 @@ from Cython.Compiler.Visitor cimport ( - CythonTransform, VisitorTransform, + CythonTransform, VisitorTransform, TreeVisitor, ScopeTrackingTransform, EnvTransform) -#class NameNodeCollector(TreeVisitor): -# cdef list name_nodes +cdef class NameNodeCollector(TreeVisitor): + cdef list name_nodes cdef class SkipDeclarations: # (object): pass diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 3ab87d03..b9b06554 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -26,11 +26,12 @@ class NameNodeCollector(TreeVisitor): super(NameNodeCollector, self).__init__() self.name_nodes = [] - visit_Node = TreeVisitor.visitchildren - def visit_NameNode(self, node): self.name_nodes.append(node) + def visit_Node(self, node): + self._visitchildren(node, None) + class SkipDeclarations(object): """ -- 2.26.2