Commit ae79cef7 authored by Stefan Behnel's avatar Stefan Behnel

merge

parents 90dbf8a8 6ee53629
This diff is collapsed.
......@@ -87,6 +87,15 @@ class Context:
from Buffer import IntroduceBufferAuxiliaryVars
from ModuleNode import check_c_declarations
# Temporary hack that can be used to ensure that all result_code's
# are generated at code generation time.
import Visitor
class ClearResultCodes(Visitor.CythonTransform):
def visit_ExprNode(self, node):
self.visitchildren(node)
node.result_code = "<cleared>"
return node
if pxd:
_check_c_declarations = None
_specific_post_parse = PxdPostParse(self)
......@@ -118,6 +127,7 @@ class Context:
DictIterTransform(),
SwitchTransform(),
FinalOptimizePhase(self),
# ClearResultCodes(self),
# SpecialFunctions(self),
# CreateClosureClasses(context),
]
......
......@@ -3737,6 +3737,7 @@ class ForInStatNode(LoopNode, StatNode):
def generate_execution_code(self, code):
old_loop_labels = code.new_loop_labels()
self.iterator.allocate_counter_temp(code)
self.iterator.generate_evaluation_code(code)
code.putln(
"for (;;) {")
......@@ -3753,6 +3754,7 @@ class ForInStatNode(LoopNode, StatNode):
self.else_clause.generate_execution_code(code)
code.putln("}")
code.put_label(break_label)
self.iterator.release_counter_temp(code)
self.iterator.generate_disposal_code(code)
def annotate(self, code):
......
"""
>>> spam(dict(test=2))
False
"""
def spam(dict d):
for elm in d:
return False
return True
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