Commit 4a8fb6bf authored by Guido van Rossum's avatar Guido van Rossum

Use the setupLoop API to implement 'loop'.

parent 0fc919bd
......@@ -159,9 +159,8 @@ class TALInterpreter:
self.stream.write(str(text))
def do_loop(self, name, expr, block):
sequence = self.engine.evaluateSequence(expr)
for item in sequence:
self.engine.setLocal(name, item)
iterator = self.engine.setupLoop(name, expr)
while iterator.next():
self.interpret(block)
def do_text(self, text):
......
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