summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/ast.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #2333: Backport set and dict comprehensions syntax.Alexandre Vassalotti2010-01-111-0/+45
|
* Issue #2335: Backport set literals syntax from Python 3.x.Alexandre Vassalotti2010-01-091-0/+16
|
* Issue #7092: Fix the DeprecationWarnings emitted by the standard libraryAntoine Pitrou2010-01-041-30/+28
| | | | when using the -3 flag. Patch by Florent Xicluna.
* Issue 2117. Update compiler module to handle class decorators.Facundo Batista2008-02-251-2/+6
| | | | Thanks Thomas Herve
* Fix a bug in the ``compiler`` package that caused invalid code to beNeil Schemenauer2006-08-161-3/+1
| | | | generated for generator expressions.
* Use absolute importsNeal Norwitz2006-04-031-1/+1
|
* Whitespace normalization.Tim Peters2006-03-041-3/+3
|
* Add support for absolute/relative imports and if/else expressions:Thomas Wouters2006-03-031-6/+23
| | | | | | | | | - regenerate ast.py - add future flags for absolute-import and with-statement so they (hopefully) properly get set in code-object flags - try out if/else expressions in actual code for the hell of it. Seems to generate the same kind of bytecode as the normal compiler.
* Whitespace normalization.Tim Peters2006-02-281-3/+3
|
* PEP 343 -- the with-statement.Guido van Rossum2006-02-271-3/+28
| | | | | | | | | | | | | This was started by Mike Bland and completed by Guido (with help from Neal). This still needs a __future__ statement added; Thomas is working on Michael's patch for that aspect. There's a small amount of code cleanup and refactoring in ast.c, compile.c and ceval.c (I fixed the lltrace behavior when EXT_POP is used -- however I had to make lltrace a static global).
* Fix compiler.ast.flatten function so that it works on lists.Neil Schemenauer2005-06-021-4/+4
|
* Whitespace normalization.Tim Peters2004-09-121-4/+4
|
* compiler.transformer: correct lineno attribute when possibleJeremy Hylton2004-09-071-229/+205
| | | | | | | | | | | | | | | | 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.
* Whitespace normalization.Tim Peters2004-08-041-2/+2
|
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-021-629/+652
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* SF patch #872326: Generator expression implementationRaymond Hettinger2004-05-191-0/+76
| | | | | | | | | | | | | | (Code contributed by Jiwon Seo.) The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev). The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.
* Comment typo fixesAndrew M. Kuchling2003-08-111-1/+1
|
* Patch #521714: fix pychecker warnings in ast.py.Martin v. Löwis2002-02-231-124/+124
|
* Merge of the release22 branch changes back into the trunk.Barry Warsaw2001-12-211-0/+15
|
* Whitespace normalization.Tim Peters2001-10-181-1/+1
|
* Re-created after change to astgen to calculate hardest_arg correctlyJeremy Hylton2001-09-171-577/+603
|
* the names attribute of Global is not a nodeJeremy Hylton2001-09-141-1/+1
|
* Revise implementations of getChildren() and getChildNodes().Jeremy Hylton2001-08-291-100/+602
| | | | | | | | | | | | | | | | 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-20/+8
|
* Add Yield() nodeJeremy Hylton2001-08-181-0/+12
|
* Fix typo in astgen scriptJeremy Hylton2001-08-141-1/+1
|
* Regenerated from new ast.txt and new astgen.pyJeremy Hylton2001-08-141-12/+23
|
* Generated from rev 1.1 of ast.txtJeremy Hylton2000-10-251-677/+606
|
* Now supports entire Python 2.0 language and still supports PythonJeremy Hylton2000-10-131-6/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1.5.2. The compiler generates code for the version of the interpreter it is run under. ast.py: Print and Printnl add dest attr for extended print new node AugAssign for augmented assignments new nodes ListComp, ListCompFor, and ListCompIf for list comprehensions pyassem.py: add work around for string-Unicode comparison raising UnicodeError on comparison of two objects in code object's const table pycodegen.py: define VERSION, the Python major version number get magic number using imp.get_magic() instead of hard coding implement list comprehensions, extended print, and augmented assignment; augmented assignment uses Delegator classes (see doc string) fix import and tuple unpacking for 1.5.2 transformer.py: various changes to support new 2.0 grammar and old 1.5 grammar add debug_tree helper than converts and symbol and token numbers to their names
* patches from Mark HammondJeremy Hylton2000-05-021-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attached is a set of diffs for the .py compiler that adds support for the new extended call syntax. compiler/ast.py: CallFunc node gets 2 new children to support extended call syntax - "star_args" (for "*args") and "dstar_args" (for "**args") compiler/pyassem.py It appear that self.lnotab is supposed to be responsible for tracking line numbers, but self.firstlineno was still hanging around. Removed self.firstlineno completely. NOTE - I didnt actually test that the generated code has the correct line numbers!! Stack depth tracking appeared a little broken - the checks never made it beyond the "self.patterns" check - thus, the custom methods were never called! Fixed this. (XXX Jeremy notes: I think this code is still broken because it doesn't track stack effects across block bounaries.) Added support for the new extended call syntax opcodes for depth calculations. compiler/pycodegen.py Added support for the new extended call syntax opcodes. compiler/transformer.py Added support for the new extended call syntax.
* change node Classdef to ClassJeremy Hylton2000-03-061-4/+4
| | | | | | | add doc string to transformer module add two helper functions: parse(buf) -> AST parseFile(path) -> AST
* add varargs and kwargs flags to Lambda nodesJeremy Hylton2000-02-171-0/+5
|
* tidy up tryexcept and tryfinally nodesJeremy Hylton2000-02-151-14/+20
|
* LeftShift & RightShift: fix reprs, change attr names to left and rightJeremy Hylton2000-02-141-10/+10
| | | | (so they are common with other binary ops)
* rename several of the generic attribute names for nodes. new node attrs are:Jeremy Hylton2000-02-141-12/+12
| | | | | | Exec: expr, locals, globals Dict: items Assert: test, fail
* make all unary operators have a single child node called exprJeremy Hylton2000-02-081-4/+4
|
* move constants out of transformer so that they can be shared with astJeremy Hylton2000-02-081-0/+7
| | | | add varargs and kwargs attributes to Function nodes
* three files from the p2c cvs tree. the message here indicates theJeremy Hylton2000-02-041-0/+689
revision number the p2c cvs tree. COPYRIGHT: 1.1 ast.py: 1.3 transformer.py: 1.11