merged in latest cython-devel
authorStefan Behnel <scoder@users.berlios.de>
Wed, 26 May 2010 20:32:21 +0000 (22:32 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 26 May 2010 20:32:21 +0000 (22:32 +0200)
1  2 
Cython/Compiler/Code.py
Cython/Compiler/Parsing.py

Simple merge
index 255dcfb37ae556420285d5b80642fa7b382be676,c310a616b61c4b59d943a9ca40d07a402e676b6d..30d907eb24bd23e0697f377d3b944601a11cc61a
@@@ -1306,9 -1214,9 +1306,9 @@@ def p_for_bounds(s, allow_testlist=True
      target = p_for_target(s)
      if s.sy == 'in':
          s.next()
 -        iterator = p_for_iterator(s)
 +        iterator = p_for_iterator(s, allow_testlist)
          return { 'target': target, 'iterator': iterator }
-     else:
+     elif not s.in_python_file:
          if s.sy == 'from':
              s.next()
              bound1 = p_bit_expr(s)
@@@ -1641,11 -1549,9 +1644,11 @@@ def p_statement(s, ctx, first_statemen
          return node
      else:
          if ctx.api:
-             error(s.pos, "'api' not allowed with this statement")
+             s.error("'api' not allowed with this statement")
          elif s.sy == 'def':
 -            if ctx.level not in ('module', 'class', 'c_class', 'c_class_pxd', 'property'):
 +            # def statements aren't allowed in pxd files, except
 +            # as part of a cdef class
 +            if ('pxd' in ctx.level) and (ctx.level != 'c_class_pxd'):
                  s.error('def statement not allowed here')
              s.level = ctx.level
              return p_def_statement(s, decorators)