Issue: Line continuation does not bypass through comments in cdef: block

8 views
Skip to first unread message

Antony Lee

unread,
Jul 26, 2016, 9:38:14 PM7/26/16
to cython...@googlegroups.com
In
def main():
    print(1 +\
          # some comment
          2)
    cdef:
        int foo, \
            # some comment
            bar

the first line continuation is correctly handled (as for CPython), but the second one raises a compilation error as of Cython 0.24.1:

Error compiling Cython file:
------------------------------------------------------------
...
         # some comment
         2)
   cdef:
       int foo, \
           # some comment
           bar
^
------------------------------------------------------------

foo.pyx:8:0: Expected an identifier, found 'INDENT'

Error compiling Cython file:
------------------------------------------------------------
...
         2)
   cdef:
       int foo, \
           # some comment
           bar
^
------------------------------------------------------------

foo.pyx:9:0: Syntax error in statement ['DEDENT','']

Best,
Antony
Reply all
Reply to author
Forward
0 new messages