summaryrefslogtreecommitdiffstats
path: root/Tools/compiler/astgen.py
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace normalization.Tim Peters2004-09-121-1/+1
|
* compiler.transformer: correct lineno attribute when possibleJeremy Hylton2004-09-071-39/+30
| | | | | | | | | | | | | | | | 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.
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-021-7/+22
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* Whitespace normalization, via reindent.py.Tim Peters2004-07-181-2/+2
|
* Fix calculation of hardest_arg.Jeremy Hylton2001-09-171-3/+3
| | | | | | | | | The argument properties are ordered from easiest to hardest. The harder the arg, the more complicated that code that must be generated to return it from getChildren() and/or getChildNodes(). The old calculation routine was bogus, because it always set hardest_arg to the hardness of the last argument. Now use max() to always set it to the hardness of the hardest argument.
* Revise implementations of getChildren() and getChildNodes().Jeremy Hylton2001-08-291-18/+112
| | | | | | | | | | | | | | | | Add support for floor division (// and //=) The implementation of getChildren() and getChildNodes() is intended to be faster, because it avoids calling flatten() on every return value. But it's not clear that it is a lot faster, because constructing a tuple with just the right values ends up being slow. (Too many attribute lookups probably.) The ast.txt file is much more complicated, with funny characters at the ends of names (*, &, !) to indicate the types of each child node. The astgen script is also much more complex, making me wonder if it's still useful.
* Generate correct reprs for Mul, Add, etc.Jeremy Hylton2001-08-181-0/+2
|
* Fix typo in astgen scriptJeremy Hylton2001-08-141-1/+1
|
* Add getChildNodes() method to NodeJeremy Hylton2001-08-141-0/+2
|
* Support for generation of ast.py from simple description of nodeJeremy Hylton2000-10-251-0/+182
structure (ast.txt). Usage is python astgen.py > ast.py.