From: Stefan Behnel Date: Fri, 26 Nov 2010 10:35:55 +0000 (+0100) Subject: compile Cython.Compiler.ParseTreeTransforms module X-Git-Tag: 0.14.alpha0~69 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=14063d43e5ea40c9013e0690302fad74526113e9;p=cython.git compile Cython.Compiler.ParseTreeTransforms module --- diff --git a/Cython/Compiler/ParseTreeTransforms.pxd b/Cython/Compiler/ParseTreeTransforms.pxd new file mode 100644 index 00000000..20011e94 --- /dev/null +++ b/Cython/Compiler/ParseTreeTransforms.pxd @@ -0,0 +1,57 @@ + +from Cython.Compiler.Visitor cimport ( + CythonTransform, VisitorTransform, + ScopeTrackingTransform, EnvTransform) + +#class NameNodeCollector(TreeVisitor): +# cdef list name_nodes + +cdef class SkipDeclarations: # (object): + pass + +cdef class NormalizeTree(CythonTransform): + cdef bint is_in_statlist + cdef bint is_in_expr + +cdef class PostParse(ScopeTrackingTransform): + cdef dict specialattribute_handlers + cdef size_t lambda_counter + cdef _visit_assignment_node(self, node, list expr_list) + + +#def eliminate_rhs_duplicates(list expr_list_list, list ref_node_sequence) +#def sort_common_subsequences(list items) +cdef flatten_parallel_assignments(list input, list output) +cdef map_starred_assignment(list lhs_targets, list starred_assignments, list lhs_args, list rhs_args) + +#class PxdPostParse(CythonTransform, SkipDeclarations): +#class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): +#class WithTransform(CythonTransform, SkipDeclarations): +#class DecoratorTransform(CythonTransform, SkipDeclarations): + +#class AnalyseDeclarationsTransform(CythonTransform): + +cdef class AnalyseExpressionsTransform(CythonTransform): + pass + +cdef class ExpandInplaceOperators(EnvTransform): + pass + +cdef class AlignFunctionDefinitions(CythonTransform): + cdef dict directives + cdef scope + +cdef class MarkClosureVisitor(CythonTransform): + cdef bint needs_closure + +cdef class CreateClosureClasses(CythonTransform): + cdef list path + cdef bint in_lambda + cdef module_scope + +cdef class GilCheck(VisitorTransform): + cdef list env_stack + cdef bint nogil + +cdef class TransformBuiltinMethods(EnvTransform): + cdef visit_cython_attribute(self, node) diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index ecad0c31..ae8f8ca1 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -1293,9 +1293,12 @@ class AlignFunctionDefinitions(CythonTransform): class MarkClosureVisitor(CythonTransform): - - needs_closure = False - + + def visit_ModuleNode(self, node): + self.needs_closure = False + self.visitchildren(node) + return node + def visit_FuncDefNode(self, node): self.needs_closure = False self.visitchildren(node) diff --git a/setup.py b/setup.py index 9cd680c9..cc5fd855 100644 --- a/setup.py +++ b/setup.py @@ -91,6 +91,7 @@ def compile_cython_modules(profile=False): "Cython.Compiler.Scanning", "Cython.Compiler.Parsing", "Cython.Compiler.Visitor", + "Cython.Compiler.ParseTreeTransforms", "Cython.Runtime.refnanny"] extensions = []