cpython/Lib/compiler
Jeremy Hylton 566d934745 compiler.transformer: correct lineno attribute when possible
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.
2004-09-07 15:28:01 +00:00
..
__init__.py Whitespace normalization. 2001-10-18 21:57:37 +00:00
ast.py compiler.transformer: correct lineno attribute when possible 2004-09-07 15:28:01 +00:00
consts.py del no longer necessary now that new module is gone 2001-09-14 22:54:48 +00:00
future.py Whitespace normalization. 2001-10-18 21:57:37 +00:00
misc.py Whitespace normalization. 2001-10-18 21:57:37 +00:00
pyassem.py SF patch [ 597919 ] compiler package and SET_LINENO 2002-12-31 18:17:44 +00:00
pycodegen.py Whitespace normalization. 2004-08-20 03:47:14 +00:00
symbols.py PEP-0318, @decorator-style. In Guido's words: 2004-08-02 06:10:11 +00:00
syntax.py Last set of change to get regression tests to pass 2001-09-17 19:33:48 +00:00
transformer.py compiler.transformer: correct lineno attribute when possible 2004-09-07 15:28:01 +00:00
visitor.py Comment typo fixes 2003-08-11 16:20:39 +00:00