From: Stefan Behnel Date: Sun, 28 Nov 2010 19:44:17 +0000 (+0100) Subject: cdef another class in ParseTreeTransforms X-Git-Tag: 0.14.alpha0~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a41594b4a4543a9565e7551d8ddac139ffd8180d;p=cython.git cdef another class in ParseTreeTransforms --- 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): """