Commit 5dd3c50a authored by Vitja Makarov's avatar Vitja Makarov

Add support for with statement

parent c2b42588
......@@ -758,9 +758,14 @@ class CreateControlFlowGraph(CythonTransform):
def visit_LoopNode(self, node):
raise InternalError, "Generic loops are not supported"
def visit_WithTargetAssignmentStatNode(self, node):
self.mark_assignment(node.lhs)
return node
def visit_WithStatNode(self, node):
# never be here: WithStatNode is replaced with try except finally
raise InternalError, "with statement is not supported"
self.visit(node.manager)
self.visit(node.body)
return node
def visit_TryExceptStatNode(self, node):
# After exception handling
......
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