Commit d8952731 authored by Stefan Behnel's avatar Stefan Behnel

move 'for from' syntax out of the way in Python file compilation

parent d6e63ab1
...@@ -1216,7 +1216,7 @@ def p_for_bounds(s): ...@@ -1216,7 +1216,7 @@ def p_for_bounds(s):
s.next() s.next()
iterator = p_for_iterator(s) iterator = p_for_iterator(s)
return { 'target': target, 'iterator': iterator } return { 'target': target, 'iterator': iterator }
else: elif not s.in_python_file:
if s.sy == 'from': if s.sy == 'from':
s.next() s.next()
bound1 = p_bit_expr(s) bound1 = p_bit_expr(s)
...@@ -1248,6 +1248,9 @@ def p_for_bounds(s): ...@@ -1248,6 +1248,9 @@ def p_for_bounds(s):
'relation2': rel2, 'relation2': rel2,
'bound2': bound2, 'bound2': bound2,
'step': step } 'step': step }
else:
s.expect('in')
return {}
def p_for_from_relation(s): def p_for_from_relation(s):
if s.sy in inequality_relations: if s.sy in inequality_relations:
......
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