From 7499c3d437bf483a7c08b3871db5bed1343f1f5f Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Sat, 19 Jul 2008 22:45:34 +0200 Subject: [PATCH] Pruning cdef variable declarations after analysis --- Cython/Compiler/ParseTreeTransforms.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 4cf5e356..57828983 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -272,6 +272,13 @@ class AnalyseDeclarationsTransform(CythonTransform): self.env_stack.pop() return node + # Some nodes are no longer needed after declaration + # analysis and can be dropped. The analysis was performed + # on these nodes in a seperate recursive process from the + # enclosing function or module, so we can simply drop them. + def visit_CVarDefNode(self, node): + return None + class AnalyseExpressionsTransform(CythonTransform): def visit_ModuleNode(self, node): node.body.analyse_expressions(node.scope) -- 2.26.2