move 'for from' syntax out of the way in Python file compilation
authorStefan Behnel <scoder@users.berlios.de>
Wed, 26 May 2010 14:18:32 +0000 (16:18 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 26 May 2010 14:18:32 +0000 (16:18 +0200)
Cython/Compiler/Parsing.py

index 799480fa0b4c14b4f9969e9054f51c19de992a8d..c310a616b61c4b59d943a9ca40d07a402e676b6d 100644 (file)
@@ -1216,7 +1216,7 @@ def p_for_bounds(s):
         s.next()
         iterator = p_for_iterator(s)
         return { 'target': target, 'iterator': iterator }
-    else:
+    elif not s.in_python_file:
         if s.sy == 'from':
             s.next()
             bound1 = p_bit_expr(s)
@@ -1248,6 +1248,9 @@ def p_for_bounds(s):
                 'relation2': rel2,
                 'bound2': bound2,
                 'step': step }
+    else:
+        s.expect('in')
+        return {}
 
 def p_for_from_relation(s):
     if s.sy in inequality_relations: