Dag Sverre Seljebotn, 14.03.2010 10:27: > Robert Bradshaw wrote: >> Ah, yes, it would be good to support >> >> cdef = 4 >> >> in a .py file. > > Perhaps the easiest thing here (once we start on this, which IMO is past > 1.0) could be to switch to using the Python parser for .py files and > transform the resulting tree to a Cython tree. Rather than litter > Parsing.py with special cases.
Oh, the above shouldn't be hard to add at all, I did this for the print_function future import already. All you have to do is make the scanner more configurable so that it changes the set of keywords based on the thing it's scanning through. If it returns 'cdef' as an identifier rather than a keyword, the parser will do the right thing (minus a couple of expected bugs, maybe). I would have expected the same for the C++ support, BTW, although I'm ok with the way it currently works. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
