Commit 4cb7c99f authored by Stefan Behnel's avatar Stefan Behnel

Avoid unnecessary directives tracking in the WithTransform since it does not need it.

parent db787a45
...@@ -29,7 +29,7 @@ cdef map_starred_assignment(list lhs_targets, list starred_assignments, list lhs ...@@ -29,7 +29,7 @@ cdef map_starred_assignment(list lhs_targets, list starred_assignments, list lhs
#class PxdPostParse(CythonTransform, SkipDeclarations): #class PxdPostParse(CythonTransform, SkipDeclarations):
#class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): #class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
#class WithTransform(CythonTransform, SkipDeclarations): #class WithTransform(VisitorTransform, SkipDeclarations):
#class DecoratorTransform(CythonTransform, SkipDeclarations): #class DecoratorTransform(CythonTransform, SkipDeclarations):
#class AnalyseDeclarationsTransform(EnvTransform): #class AnalyseDeclarationsTransform(EnvTransform):
......
...@@ -1342,7 +1342,7 @@ class ParallelRangeTransform(CythonTransform, SkipDeclarations): ...@@ -1342,7 +1342,7 @@ class ParallelRangeTransform(CythonTransform, SkipDeclarations):
return super(ParallelRangeTransform, self).visit(node) return super(ParallelRangeTransform, self).visit(node)
class WithTransform(CythonTransform, SkipDeclarations): class WithTransform(VisitorTransform, SkipDeclarations):
def visit_WithStatNode(self, node): def visit_WithStatNode(self, node):
self.visitchildren(node, 'body') self.visitchildren(node, 'body')
pos = node.pos pos = node.pos
...@@ -1408,6 +1408,8 @@ class WithTransform(CythonTransform, SkipDeclarations): ...@@ -1408,6 +1408,8 @@ class WithTransform(CythonTransform, SkipDeclarations):
# With statements are never inside expressions. # With statements are never inside expressions.
return node return node
visit_Node = VisitorTransform.recurse_to_children
class DecoratorTransform(ScopeTrackingTransform, SkipDeclarations): class DecoratorTransform(ScopeTrackingTransform, SkipDeclarations):
""" """
......
...@@ -186,7 +186,7 @@ def create_pipeline(context, mode, exclude_classes=()): ...@@ -186,7 +186,7 @@ def create_pipeline(context, mode, exclude_classes=()):
TrackNumpyAttributes(), TrackNumpyAttributes(),
InterpretCompilerDirectives(context, context.compiler_directives), InterpretCompilerDirectives(context, context.compiler_directives),
ParallelRangeTransform(context), ParallelRangeTransform(context),
WithTransform(context), WithTransform(),
AdjustDefByDirectives(context), AdjustDefByDirectives(context),
_align_function_definitions, _align_function_definitions,
MarkClosureVisitor(context), MarkClosureVisitor(context),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment