• Jeremy Hylton's avatar
    compiler.transformer: correct lineno attribute when possible · 566d9347
    Jeremy Hylton yazdı
    SF patch #1015989
    
    The basic idea of this patch is to compute lineno attributes for all AST nodes.  The actual
    implementation lead to a lot of restructing and code cleanup.
    
    The generated AST nodes now have an optional lineno argument to constructor.  Remove the
    top-level asList(), since it didn't seem to serve any purpose.  Add an __iter__ to ast nodes.
    Use isinstance() instead of explicit type tests.
    
    Change transformer to use the new lineno attribute, which replaces three lines of code with one.
    Use universal newlines so that we can get rid of special-case code for line endings.  Use
    lookup_node() in a few more frequently called, but simple com_xxx methods().  Change string
    exception to class exception.
    566d9347
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...