summaryrefslogtreecommitdiffstats
path: root/Tools/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions 55270-55324 via svnmerge fromGuido van Rossum2007-05-149-685/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55271 | fred.drake | 2007-05-11 10:14:47 -0700 (Fri, 11 May 2007) | 3 lines remove jpeg, panel libraries for SGI; there is more IRIX stuff left over, I guess that should be removed too, but will leave for someone who is sure ........ r55280 | fred.drake | 2007-05-11 19:11:37 -0700 (Fri, 11 May 2007) | 1 line remove mention of file that has been removed ........ r55301 | brett.cannon | 2007-05-13 17:38:05 -0700 (Sun, 13 May 2007) | 4 lines Remove rexec and Bastion from the stdlib. This also eliminates the need for f_restricted on frames. This in turn negates the need for PyEval_GetRestricted() and PyFrame_IsRestricted(). ........ r55303 | brett.cannon | 2007-05-13 19:22:22 -0700 (Sun, 13 May 2007) | 2 lines Remove the md5 and sha modules. ........ r55305 | george.yoshida | 2007-05-13 19:45:55 -0700 (Sun, 13 May 2007) | 2 lines fix markup ........ r55306 | neal.norwitz | 2007-05-13 19:47:57 -0700 (Sun, 13 May 2007) | 1 line Get the doc building again after some removals. ........ r55307 | neal.norwitz | 2007-05-13 19:50:45 -0700 (Sun, 13 May 2007) | 1 line Get test_pyclbr passing again after getstatus was removed from commands. This "test case" was weird since it was just importing a seemingly random module. Remove the import ........ r55322 | brett.cannon | 2007-05-14 14:09:20 -0700 (Mon, 14 May 2007) | 3 lines Remove the compiler package. Will eventually need a mechanism to byte compile an AST. ........
* Refactor astgen.py with 2to3.Georg Brandl2007-03-181-38/+38
|
* * Remove PRINT_ITEM(_TO), PRINT_NEWLINE(_TO) opcodes.Georg Brandl2007-02-091-2/+0
| | | | | | | * Fix some docstrings and one Print -> print. * Fix test_{class,code,descrtut,dis,extcall,parser,popen,pkg,subprocess,syntax,traceback}. These were the ones that generated code with a print statement. In most remaining failing tests there's an issue with the soft space.
* SF patch 1631942 by Collin Winter:Guido van Rossum2007-01-102-2/+2
| | | | | | (a) "except E, V" -> "except E as V" (b) V is now limited to a simple name (local variable) (c) V is now deleted at the end of the except block
* PEP 3107 - Function Annotations thanks to Tony LowndsNeal Norwitz2006-12-282-4/+11
|
* Jiwon Seo's PEP 3102 implementation.Guido van Rossum2006-10-271-2/+3
| | | | | See SF#1549670. The compiler package has not yet been updated.
* Patch #1550786: ellipsis literal.Georg Brandl2006-09-061-1/+0
|
* Patch #1550800: make exec a function.Georg Brandl2006-09-061-1/+0
|
* SF patch 1547796 by Georg Brandl -- set literals.Guido van Rossum2006-08-282-3/+3
|
* Get rid of a bunch more raw_input referencesNeal Norwitz2006-03-171-0/+5
|
* NodeInfo.__gen_init(): Fiddle so that reindent.py isTim Peters2006-03-091-2/+5
| | | | | | | happy with the output as-is. This incidentally also gets rid of "an extra" blank line at the end of the output block that probably wasn't intended (although it doesn't matter one way or the other).
* Update for absolute/relative imports and ifelse-expressions.Thomas Wouters2006-03-031-1/+2
|
* PEP 343 -- the with-statement.Guido van Rossum2006-02-271-1/+2
| | | | | | | | | | | | | 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).
* Whitespace normalization.Tim Peters2005-12-251-1/+1
|
* Add comment about updating docsAndrew M. Kuchling2005-11-221-0/+3
|
* Merge ast-branch to headJeremy Hylton2005-10-201-4/+7
| | | | | | | | | | This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
* Fix compiler.ast.flatten function so that it works on lists.Neil Schemenauer2005-06-021-4/+4
|
* 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-023-8/+26
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* Whitespace normalization, via reindent.py.Tim Peters2004-07-183-6/+6
|
* SF patch #872326: Generator expression implementationRaymond Hettinger2004-05-191-0/+11
| | | | | | | | | | | | | | (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.
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-2/+1
| | | | From SF patch #852334.
* Massive changes from SF 589982 (tempfile.py rewrite, by ZackGuido van Rossum2002-08-091-4/+2
| | | | | Weinberg). This changes all uses of deprecated tempfile functions to the recommended ones.
* Test utility to look for bad stacksize calculations.Jeremy Hylton2001-10-171-0/+43
|
* Removed files no longer needed.Fred Drake2001-09-283-663/+0
|
* Remove setup.py, unnecessary since compiler package is the stdJeremy Hylton2001-09-202-14/+2
| | | | | | library. Update README.
* Moved to Tools/compiler along with astgen.pyJeremy Hylton2001-09-201-87/+0
|
* The compiler package is now part of the standard library.Jeremy Hylton2001-09-2012-5811/+0
| | | | Remove all these files. All except astgen.py are moved to Lib/compiler.
* Track changes to compiler APIJeremy Hylton2001-09-172-9/+15
|
* API change:Jeremy Hylton2001-09-173-10/+109
| | | | | | | | | | | | | | | | | | compile() becomes replacement for builtin compile() compileFile() generates a .pyc from a .py both are exported in __init__ compiler.parse() gets optional second argument to specify compilation mode, e.g. single, eval, exec Add AbstractCompileMode as parent class and Module, Expression, and Interactive as concrete subclasses. Each corresponds to a compilation mode. THe AbstractCompileMode instances in turn delegate to CodeGeneration subclasses specialized for their particular functions -- ModuleCodeGenerator, ExpressionCodeGeneration, InteractiveCodeGenerator.
* Re-created after change to astgen to calculate hardest_arg correctlyJeremy Hylton2001-09-171-577/+603
|
* Fix calculation of hardest_arg.Jeremy Hylton2001-09-172-6/+6
| | | | | | | | | 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.
* Last set of change to get regression tests to passJeremy Hylton2001-09-173-5/+10
| | | | | | | | | | | Remove the only test in the syntax module. It ends up that the transformer must handle this error case. In the transformer, check for a list compression in com_assign_list() by looking for a list_for node where a comma is expected. In pycodegen.compile() re-raise the SyntaxError rather than catching it and exiting
* Add -p option to invoke Python profilerJeremy Hylton2001-09-171-5/+11
|
* Only print attributes that start with co_.Jeremy Hylton2001-09-171-1/+6
| | | | | If passed a .py file as an argument, try to find its accompanying .pyc.
* Handle more syntax errors.Jeremy Hylton2001-09-172-29/+77
| | | | | | | | Invoke compiler.syntax.check() after building AST. If a SyntaxError occurs, print the error and exit without generating a .pyc file. Refactor code to use compiler.misc.set_filename() rather than passing filename argument around to each CodeGenerator instance.
* Add utility to set filename attribute on all nodesJeremy Hylton2001-09-171-0/+9
|
* support true divisionJeremy Hylton2001-09-171-1/+3
|
* Add code generator for yield stmtJeremy Hylton2001-09-141-0/+5
|
* del no longer necessary now that new module is goneJeremy Hylton2001-09-141-2/+0
|
* Various sundry changes for 2.2 compatibilityJeremy Hylton2001-09-142-137/+94
| | | | | | | | | | | | | | | Remove the option to have nested scopes or old LGB scopes. This has a large impact on the code base, by removing the need for two variants of each CodeGenerator. Add a get_module() method to CodeGenerator objects, used to get the future features for the current module. Set CO_GENERATOR, CO_GENERATOR_ALLOWED, and CO_FUTURE_DIVISION flags as appropriate. Attempt to fix the value of nlocals in newCodeObject(), assuming that nlocals is 0 if CO_NEWLOCALS is not defined.
* The object-being sliced in an assignment to a slice is referenced, notJeremy Hylton2001-09-141-2/+2
| | | | | | | bound. When a Yield() node is visited, assign to the generator attribute of the scope, not the visitor.
* the new new doesn't define CO_xxx as the old new didJeremy Hylton2001-09-141-1/+9
|
* the names attribute of Global is not a nodeJeremy Hylton2001-09-143-3/+3
|
* Fix _convert_NAME() so that it doesn't store locals for class bodies.Jeremy Hylton2001-08-303-15/+15
| | | | | | | | | Fix list comp code generation -- emit GET_ITER instead of Const(0) after the list. Add CO_GENERATOR flag to generators. Get CO_xxx flags from the new module
* spurious popJeremy Hylton2001-08-301-1/+0
|
* Track the block stack more reasonably in order to handle continue inJeremy Hylton2001-08-291-13/+45
| | | | | | | | try/except or try/finally. Previous versions had only track SETUP_LOOP blocks and ignored the exception part. This meant that it allowed continue inside a try/except but generated buggy code. Now it does the right thing.
* Improve stack depth computation for try/except and try/finallyJeremy Hylton2001-08-291-1/+4
| | | | Add CONTINUE_LOOP to the list of unconditional transfers
* Add __getitem__() handler for use by visitContinue()Jeremy Hylton2001-08-291-0/+2
|