Kurt Smith wrote:
> One reason I thought of a transform is to deal with other transforms
> that might modify the python statements in such a way that makes it
> difficult to reproduce the 'generated-C -> python-statement' mapping
> at the code-generation phase.  Not having looked much at this part of
> Cython (the Code object that is) maybe I'm way off here.
> 
> For, e.g. the 'with' transform, would it be easy to figure out all the
> generated C code that corresponds to the original 'with' statement in
> the Python source through the Code object (essentially at code
> generation phase, right)?  Or is it mixed around enough that this
> would be difficult to sort out?

At least in hand-written transforms, you can easily assign original code
positions to newly created nodes, usually based on what original code
triggered their creation. So you wouldn't loose any positional information.

Given that the with-transform basically transforms one line of code, the
granularity you'd get wouldn't be great, but you wouldn't loose any code
line information either.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to