From: Stefan Behnel Date: Wed, 26 May 2010 20:32:21 +0000 (+0200) Subject: merged in latest cython-devel X-Git-Tag: 0.13.beta0~2^2~43 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=371b92f281629ade20294444c5cef809e6514b05;p=cython.git merged in latest cython-devel --- 371b92f281629ade20294444c5cef809e6514b05 diff --cc Cython/Compiler/Parsing.py index 255dcfb3,c310a616..30d907eb --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@@ -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)