History log of /external/python/cpython2/Lib/compiler/pycodegen.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e970dc757cc2795e5dabf542fd002b540b3d7bc2 02-Jul-2012 Antoine Pitrou <solipsis@pitrou.net> Issue #15212: fix typo in compiler module (rename SC_GLOBAL_EXPLICT to SC_GLOBAL_EXPLICIT).
Patch by Arfrever.
/external/python/cpython2/Lib/compiler/pycodegen.py
b646547bb45fe1df6abefd94f892c633798d91d2 11-Jan-2010 Alexandre Vassalotti <alexandre@peadrop.com> Issue #2333: Backport set and dict comprehensions syntax.
/external/python/cpython2/Lib/compiler/pycodegen.py
ee936a21308679654b2d458166ff094ed735fef7 10-Jan-2010 Alexandre Vassalotti <alexandre@peadrop.com> Issue #2335: Backport set literals syntax from Python 3.x.
/external/python/cpython2/Lib/compiler/pycodegen.py
b9d4963a989accce30234b7b74bce874c0142209 05-Jan-2010 Antoine Pitrou <solipsis@pitrou.net> Issue #7092: Fix the DeprecationWarnings emitted by the standard library
when using the -3 flag. Patch by Florent Xicluna.
/external/python/cpython2/Lib/compiler/pycodegen.py
68d68520061a5a4aa3437f8c74ba383b2da50280 28-Feb-2009 Jeffrey Yasskin <jyasskin@gmail.com> Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} with
POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing
a POP_TOP on each conditional and sometimes allows the peephole optimizer to
skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
/external/python/cpython2/Lib/compiler/pycodegen.py
92c3b2190bae6dd7844c83b6acefc0b89d2bc225 07-Feb-2009 Neil Schemenauer <nascheme@enme.ucalgary.ca> Issue #999042: The Python compiler now handles explict global statements
correctly (should be assigned using STORE_GLOBAL opcode). This was done by
having the system table differentiate between explict and implicit globals.
/external/python/cpython2/Lib/compiler/pycodegen.py
98c3b85bc4b64307fc12b53210f941c6458bccb5 07-Feb-2009 Neil Schemenauer <nascheme@enme.ucalgary.ca> Make names generated for 'with' variables match the built-in compiler.
/external/python/cpython2/Lib/compiler/pycodegen.py
4db626f95d9dbb7d52418dee9a96467da3720796 06-Feb-2009 Neil Schemenauer <nascheme@enme.ucalgary.ca> Overhaul Lib/compiler block ordering. The previous code was filled with
hacks. The new code is based on issue #2472 posted by Antoine Pitrou. I
did some further cleanups of the pyassem code and optimized the block
ordering pass.
/external/python/cpython2/Lib/compiler/pycodegen.py
d0c3515bc5b31a19d00bfc685d7657ad7d79fa94 17-Dec-2008 Antoine Pitrou <solipsis@pitrou.net> Issue #2183: Simplify and optimize bytecode for list comprehensions.
/external/python/cpython2/Lib/compiler/pycodegen.py
5d5c63f462683e971a4a2d877e78946554aacbf3 19-Mar-2008 Eric Smith <eric@trueblade.com> Fixed compiler module so __future__ print_function is compilable.
/external/python/cpython2/Lib/compiler/pycodegen.py
7af53be66f8c074902e0e7e7c452a280538582bc 07-Mar-2008 Nick Coghlan <ncoghlan@gmail.com> Speed up with statements by storing the __exit__ method on the stack instead of in a temp variable (bumps the magic number for pyc files)
/external/python/cpython2/Lib/compiler/pycodegen.py
ab49684f550ce6b12614b8a329f4d280e20e1277 27-Jan-2007 Georg Brandl <georg@python.org> Patch #1638243: the compiler package is now able to correctly compile
a with statement; previously, executing code containing a with statement
compiled by the compiler package crashed the interpreter.
/external/python/cpython2/Lib/compiler/pycodegen.py
fe9c71bcd39725ba9149f5c011728b88c99f3a30 29-Oct-2006 Georg Brandl <georg@python.org> Remove trailing comma.
/external/python/cpython2/Lib/compiler/pycodegen.py
5addf7007818bd05f5a1c26f8c71b5ee839a7659 29-Oct-2006 Georg Brandl <georg@python.org> Bug #1586448: the compiler module now emits the same bytecode for
list comprehensions as the builtin compiler, using the LIST_APPEND
opcode.
/external/python/cpython2/Lib/compiler/pycodegen.py
4c6b0d5bec587770e0d83b550faae97fe251cc65 17-Aug-2006 Neil Schemenauer <nascheme@enme.ucalgary.ca> Fix a bug in the ``compiler`` package that caused invalid code to be
generated for generator expressions.
/external/python/cpython2/Lib/compiler/pycodegen.py
06ded09d4048bf44ce9b61c82494cf0a0825412c 04-Aug-2006 Neil Schemenauer <nascheme@enme.ucalgary.ca> Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
/external/python/cpython2/Lib/compiler/pycodegen.py
da5b701aeef755f2317a41e36cc950cfdc0c95cb 02-May-2006 Guido van Rossum <guido@python.org> Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
/external/python/cpython2/Lib/compiler/pycodegen.py
cb35b95f86062394437da42a3bd78085c4302b78 14-Mar-2006 Nick Coghlan <ncoghlan@gmail.com> Teach the compiler module about augmented assignment to tuple subscripts
/external/python/cpython2/Lib/compiler/pycodegen.py
f669436189dd44a841caa9ab1ad97a3f7662bf58 10-Mar-2006 Guido van Rossum <guido@python.org> Um, I thought I'd already checked this in.
Anyway, this is the changes to the with-statement
so that __exit__ must return a true value in order
for a pending exception to be ignored.
The PEP (343) is already updated.
/external/python/cpython2/Lib/compiler/pycodegen.py
d4e30357016f0b2e2a5093d810b7edea33501cd3 03-Mar-2006 Neal Norwitz <nnorwitz@gmail.com> Fix compiler breakage related to absolute imports
/external/python/cpython2/Lib/compiler/pycodegen.py
eaed39f303be60dfde45179f21302a7d3789c755 03-Mar-2006 Neal Norwitz <nnorwitz@gmail.com> Hopefully this removes all vestiges of CO_GENERATOR_ALLOWED that can
be removed in 2.x.
/external/python/cpython2/Lib/compiler/pycodegen.py
fa0cf4f3ae1c4eac0a6d45af89fcbcecc62f910c 03-Mar-2006 Thomas Wouters <thomas@python.org> Add support for absolute/relative imports and if/else expressions:
- 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.
/external/python/cpython2/Lib/compiler/pycodegen.py
7ad94f011ef03945c2d9475679f503f5677c4f6d 28-Feb-2006 Guido van Rossum <guido@python.org> Update the compiler package to compile the with-statement.
Jeremy, please review!
/external/python/cpython2/Lib/compiler/pycodegen.py
d752f7d8e851eb6160bbb1bb0e506652ec037f10 25-Nov-2005 Neal Norwitz <nnorwitz@gmail.com> No need for types, use isinstance
/external/python/cpython2/Lib/compiler/pycodegen.py
a45cacfc1c4fb2b7b1b5c74e1f6b56d6ca2c9e4c 20-Aug-2004 Tim Peters <tim.peters@gmail.com> Whitespace normalization.
/external/python/cpython2/Lib/compiler/pycodegen.py
0ccff074cd806bc7e963a1e0ff6ce25e0d11cce9 17-Aug-2004 Michael W. Hudson <mwh@python.net> This is Mark Russell's patch:

[ 1009560 ] Fix @decorator evaluation order

From the description:

Changes in this patch:

- Change Grammar/Grammar to require
newlines between adjacent decorators.

- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers

- Add better order of evaluation check
to test_decorators.py (test_eval_order)

- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)

and the comment:

Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)

(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
/external/python/cpython2/Lib/compiler/pycodegen.py
2876f5ad212d56819cb2d87c73bd6f4dfaa985bc 07-Aug-2004 Jeremy Hylton <jeremy@alum.mit.edu> SF patch 836879.

Don't generate code for asserts in -O mode.
/external/python/cpython2/Lib/compiler/pycodegen.py
6db15d7307b831766617f6a9700ecc4c75a16081 04-Aug-2004 Tim Peters <tim.peters@gmail.com> Whitespace normalization.
/external/python/cpython2/Lib/compiler/pycodegen.py
c2a5a636545a88f349dbe3e452ffb4494b68e534 02-Aug-2004 Anthony Baxter <anthonybaxter@gmail.com> PEP-0318, @decorator-style. In Guido's words:
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728.
/external/python/cpython2/Lib/compiler/pycodegen.py
4e0e1b6a540e664e89739456db4c706701bf062b 07-Jul-2004 Tim Peters <tim.peters@gmail.com> Whitespace normalization.
/external/python/cpython2/Lib/compiler/pycodegen.py
354433a59dd1701985ec8463ced25a967cade3c1 19-May-2004 Raymond Hettinger <python@rcn.com> SF patch #872326: Generator expression implementation
(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.
/external/python/cpython2/Lib/compiler/pycodegen.py
48485579249beb3549e0b201f830b1e4c48bb0db 21-Mar-2004 Neil Schemenauer <nascheme@enme.ucalgary.ca> Remove unused instance attributes.
/external/python/cpython2/Lib/compiler/pycodegen.py
896e5164bb8562d0e5daeccd5f9f5f1d03aedeba 27-Jun-2003 Michael W. Hudson <mwh@python.net> Jacob Hallen cornered me here at EuroPython and got me to look at
patch:

[ 750008 ] 'compiler' module bug with 'import foo.bar as baz'

which I'm now checking in.

after import foo.bar as baz, baz would refer to foo.
/external/python/cpython2/Lib/compiler/pycodegen.py
18565411429053a68ee318fc9e59370e8bd7b7b8 31-Dec-2002 Jeremy Hylton <jeremy@alum.mit.edu> Replace all but one explicit emit('SET_LINENO') with call to set_lineno().

Remove broken code in visitDict(). I assume the code was trying to
add set lineno events for each line of a dict constructor, but I think
it was using the wrong object (node instead of k or v).
/external/python/cpython2/Lib/compiler/pycodegen.py
accb62b28e1d592733b2f678d5737ca3e8c64fc2 31-Dec-2002 Jeremy Hylton <jeremy@alum.mit.edu> SF patch [ 597919 ] compiler package and SET_LINENO

A variety of changes from Michael Hudson to get the compiler working
with 2.3. The primary change is the handling of SET_LINENO:

# The set_lineno() function and the explicit emit() calls for
# SET_LINENO below are only used to generate the line number table.
# As of Python 2.3, the interpreter does not have a SET_LINENO
# instruction. pyassem treats SET_LINENO opcodes as a special case.

A few other small changes:
- Remove unused code from pycodegen and pyassem.
- Fix error handling in parsermodule. When PyParser_SimplerParseString()
fails, it sets an exception with detailed info. The parsermodule
was clobbering that exception and replacing it was a generic
"could not parse string" exception. Keep the original exception.
/external/python/cpython2/Lib/compiler/pycodegen.py
78429a6aa6bb4f8527f0c6be678555ef26b62d19 16-Dec-2002 Gustavo Niemeyer <gustavo@niemeyer.net> Fixing bug

[#448679] Left to right

* Python/compile.c
(com_dictmaker): Reordered evaluation of dictionaries to follow strict
LTR evaluation.

* Lib/compiler/pycodegen.py
(CodeGenerator.visitDict): Reordered evaluation of dictionaries to
follow strict LTR evaluation.

* Doc/ref/ref5.tex
Documented the general LTR evaluation order idea.

* Misc/NEWS
Documented change in evaluation order of dictionaries.
/external/python/cpython2/Lib/compiler/pycodegen.py
a312c3ade77a5852c00fd4216626d0423272904a 06-Jun-2002 Neal Norwitz <nnorwitz@gmail.com> Remove uses of string module and stat.ST_MODE
/external/python/cpython2/Lib/compiler/pycodegen.py
e4418609f79b94b91bda2621b5e6f067fb6a31d5 16-Feb-2002 Tim Peters <tim.peters@gmail.com> Whitespace normalization.
/external/python/cpython2/Lib/compiler/pycodegen.py
52acb49298fd0aee8a2a2a352f0b2ab039649bde 21-Dec-2001 Barry Warsaw <barry@python.org> Merge of the release22 branch changes back into the trunk.
/external/python/cpython2/Lib/compiler/pycodegen.py
57911ae35a76276997fb51afb78f0a8dfeb684b8 28-Nov-2001 Jeremy Hylton <jeremy@alum.mit.edu> Fix [ #484645 ] little bug in pycodegen.py
/external/python/cpython2/Lib/compiler/pycodegen.py
6383c2d1a677f168ed2a4dfc9cb28f93ec327a0e 09-Nov-2001 Jeremy Hylton <jeremy@alum.mit.edu> Fix SF bug #479186: compiler generates bad code for "del"

Fix by Neil Schemenauer. Visit the Subscript node when trying to find
the operation for a statement.

XXX Not sure if there are other nodes that should be visited.
/external/python/cpython2/Lib/compiler/pycodegen.py
e0c446bb4ad67294f42d4cb53b4ff28413bd8dde 18-Oct-2001 Tim Peters <tim.peters@gmail.com> Whitespace normalization.
/external/python/cpython2/Lib/compiler/pycodegen.py
9dca36432e4526da9c5885e86782e7dfa5432c42 17-Sep-2001 Jeremy Hylton <jeremy@alum.mit.edu> API change:
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.
/external/python/cpython2/Lib/compiler/pycodegen.py
2e4cc7e0d84747826d3d2546d1bccd9c40a455c2 17-Sep-2001 Jeremy Hylton <jeremy@alum.mit.edu> Last set of change to get regression tests to pass

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
/external/python/cpython2/Lib/compiler/pycodegen.py
37c9351cf6efbe58e01fd879a1d60cc6073ced6b 17-Sep-2001 Jeremy Hylton <jeremy@alum.mit.edu> Handle more syntax errors.

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.
/external/python/cpython2/Lib/compiler/pycodegen.py
aee0bfedcc56edffd995c5cd5c3a4c5ca0d960b7 17-Sep-2001 Jeremy Hylton <jeremy@alum.mit.edu> support true division
/external/python/cpython2/Lib/compiler/pycodegen.py
1048aa933f096c33738f5088c7362a00e2c5b85c 15-Sep-2001 Jeremy Hylton <jeremy@alum.mit.edu> Add code generator for yield stmt
/external/python/cpython2/Lib/compiler/pycodegen.py
1e99a77120d7bf3509eb283dde871b89ad7f6007 15-Sep-2001 Jeremy Hylton <jeremy@alum.mit.edu> Various sundry changes for 2.2 compatibility

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.
/external/python/cpython2/Lib/compiler/pycodegen.py
71ebc3359bb1a5106ba3c282746817d5d44e735b 30-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Fix _convert_NAME() so that it doesn't store locals for class bodies.

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
/external/python/cpython2/Lib/compiler/pycodegen.py
f71b5fec4390bd7b40c7eb7aaefc79125249c5ec 30-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> spurious pop
/external/python/cpython2/Lib/compiler/pycodegen.py
e4685ec57e74ec37f234907df45159bcd1899a25 30-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Track the block stack more reasonably in order to handle continue in
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.
/external/python/cpython2/Lib/compiler/pycodegen.py
1936745668f44dd121b50fef31a70efc07cc4ebf 29-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Generate SET_LINENO for list and tuple literals when the open paren
starts a new line.

Also fix undetected typo in visitDict() -- uncovered by recent change
to add lineno attrs to atoms.
/external/python/cpython2/Lib/compiler/pycodegen.py
94afe32b5eabf962c872850b10886f4545b02614 29-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Support // and //=

Generate SET_LINENO for del statements.

Define klass=1 for PyFlowGraph constructor for a class statement. A
class has no varnames.
/external/python/cpython2/Lib/compiler/pycodegen.py
2ac9c3eec5807b6032e5aef6481fcf67c1965efc 28-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Make sure the JUMP_ABSOLUTE and POP_BLOCK at the end of a for loop are
contiguous.
/external/python/cpython2/Lib/compiler/pycodegen.py
f354575328becbdd21a92f0386db6568dcdd8d45 28-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Generate FOR_ITER-based loops instead of old FOR_LOOP-based loops
/external/python/cpython2/Lib/compiler/pycodegen.py
c59e22000082722655517942d7662eec5a4a70ce 28-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Handle private names

(Hard to believe these were never handled before)

Add misc.mangle() that mangles based on the rules in compile.c.
XXX Need to test the corner cases

Update CodeGenerator with a class_name attribute bound to None. If a
particular instance is created within a class scope, the instance's
class_name is bound to that class's name.

Add mangle() method to CodeGenerator that mangles if the class_name
has a class_name in it.

Modify the FunctionCodeGenerator family to handle an extra argument--
the class_name.

Wrap all name ops and attrnames in calls to self.mangle()
/external/python/cpython2/Lib/compiler/pycodegen.py
80ea40d8585a0e8d67dcf1f1900e8dfe27510927 27-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> emit SET_LINENO for augmented assignments
/external/python/cpython2/Lib/compiler/pycodegen.py
2afff324ea3e987bb83503932ffc405a9940a37e 27-Aug-2001 Jeremy Hylton <jeremy@alum.mit.edu> Many changes -- bug fixes and sundry improvements

Make nested scopes enabled by default

Add is_constant_false() helper so that compiled code and symbols are
consistent with builtin compiler's handling of "if 0:"

Fix doc string handling to be consistent with recent change that
eliminates the doc string from the Module's node attribute.

Add fix to print handling from Evan & Shane.

Track change to visitor api by making "verbose" explicit.

Comment out setting CO_NESTED flag (it's unnecessary in 2.2).
/external/python/cpython2/Lib/compiler/pycodegen.py
bb0bae6da2c322971041d7943d1096d0590a9d3f 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Pop loop off the loop stack before handling the loop's else clause.
Otherwise, continue/break will attempt to affect the wrong loop.

A few more fiddles to get the SET_LINENOs consistent across compilers.
/external/python/cpython2/Lib/compiler/pycodegen.py
13d70944cba10f6f9b39aa94cb9c5df442523dda 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Use new _implicitNameOp() to generate name op code for list comprehensions.

Always emit a SET_LINENO 0 at the beginning of the module. The
builtin compiler does this, and it's much easier to compare bytecode
generated by the two compilers if they both do.

Move the SET_LINENO inside the FOR_LOOP block for list
comprehensions. Also for compat. with builtin compiler.
/external/python/cpython2/Lib/compiler/pycodegen.py
614e87f2866173475bc01ffddcd8b9fbcc690b36 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Add support for visitAssAttr to findOp().
/external/python/cpython2/Lib/compiler/pycodegen.py
542b11acfd5309438ed2769be1fc476b9597f1fb 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> pyassem.py:

Fix annoying bugs in flow graph layout code. In some cases the
implicit control transfers weren't honored. In other cases,
JUMP_FORWARD instructions jumped backwards.

Remove unused arg from nextBlock().

pycodegen.py

Add optional force kwarg to set_lineno() that will emit a
SET_LINENO even if it is the same as the previous lineno.

Use explicit LOAD_FAST and STORE_FAST to access list comp implicit
variables. (The symbol table doesn't know about them.)
/external/python/cpython2/Lib/compiler/pycodegen.py
bfb0cf822bedb25c38fa7f411af83d6654872dd4 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Revise handling of tuple arguments so that the variables names match
those used by compile.c. (test_grammar now depends on the names)
/external/python/cpython2/Lib/compiler/pycodegen.py
3f76b7e6e465a7109f78d499996246d8de26f6a8 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Fix unpackSequence() to use _nameOp() rather than LOAD_FAST
/external/python/cpython2/Lib/compiler/pycodegen.py
660cc77abb561233c30f375310cec67211e4bacb 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Inside a class scope always use LOAD_NAME, STORE_NAME, DEL_NAME
/external/python/cpython2/Lib/compiler/pycodegen.py
364f9b9e2f798e4d28ed21122faffb030a6ccac5 12-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Preliminary support for nested scopes

XXX Still doesn't work right for classes
XXX Still doesn't do sufficient error checking
/external/python/cpython2/Lib/compiler/pycodegen.py
84ec1f91595410a86abf50f275cb0dc4ff432a95 11-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> typo
/external/python/cpython2/Lib/compiler/pycodegen.py
01d12937dfe827810b716625ce297ace44a3a6d2 11-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> [finishing fix from earlier checkins]

Call set_lineno() in visitDiscard(), which will generate linenos for
discard statements, e.g. the statement "1/0"

Fixes SF bug #409587
/external/python/cpython2/Lib/compiler/pycodegen.py
9ab019bee7ccc79b15a24ab3043cb1f05b15d7bb 11-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Generate docstrings.

Fixes SF buf #217004

Add method fixDocstring() to CodeGenerator. It converts the Discard
node containing the docstring into an assignment to __doc__.
/external/python/cpython2/Lib/compiler/pycodegen.py
80e29bd1392bfae865f2ff44b1fe92a5d0fad7c8 09-Apr-2001 Jeremy Hylton <jeremy@alum.mit.edu> Add support for future statements
/external/python/cpython2/Lib/compiler/pycodegen.py
314e3fb215c4e96a8c5523061623d8439ab4c2dc 06-Nov-2000 Jeremy Hylton <jeremy@alum.mit.edu> Change the graph structure to contain the code generator object for
embedded code objects (e.g. functions) rather than the generated code
object. This change means that the compiler generates code for
everything at the end, rather then generating code for each function
as it finds it. Implementation note: _convert_LOAD_CONST in
pyassem.py must be change to call getCode().

Other changes follow. Several changes creates extra edges between
basic blocks to reflect control flow for loops and exceptions. These
missing edges had gone unnoticed because they do not affect the
current compilation process.

pyassem.py:
Add _enable_debug() and _disable_debug() methods that print
instructions and blocks to stdout as they are generated.

Add edges between blocks for instructions like SETUP_LOOP,
FOR_LOOP, etc.

Add pruneNext to get rid of bogus edges remaining after
unconditional transfer ops (e.g. JUMP_FORWARD)

Change repr of Block to omit block length.

pycodegen.py:
Make sure a new block is started after FOR_LOOP, etc.

Change assert implementation to use RAISE_VARARGS 1 when there is
no user-specified failure output.

misc.py:
Implement __contains__ and copy for Set.
/external/python/cpython2/Lib/compiler/pycodegen.py
9c048f9f6565d9a83890d0834f5f9b4be3a7cd8b 13-Oct-2000 Jeremy Hylton <jeremy@alum.mit.edu> Now supports entire Python 2.0 language and still supports Python
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
/external/python/cpython2/Lib/compiler/pycodegen.py
4e1be72e6babf857d9f263b087dae3123ac8efe1 12-Oct-2000 Jeremy Hylton <jeremy@alum.mit.edu> Fix SF bug #116263: support for from .. import *
transformer.py: return '*', None from com_import_as_name
pycodegen.py: special case for name == '*'
pyassem.py: fix stack counting for IMPORT_ opcodes
/external/python/cpython2/Lib/compiler/pycodegen.py
92f397209055a0ae7599e5a7ea202f19fae8fd7b 01-Sep-2000 Jeremy Hylton <jeremy@alum.mit.edu> patch by Neil Schemenauer to improve (fix?) line number generation
/external/python/cpython2/Lib/compiler/pycodegen.py
2051608616178ca6b73d5d59d887ddd67c5835e3 01-Sep-2000 Jeremy Hylton <jeremy@alum.mit.edu> Update magic number.

Fix import support to work with import as variant of Python 2.0. The
grammar for import changed, requiring changes in transformer and code
generator, even to handle compilation of imports with as.
/external/python/cpython2/Lib/compiler/pycodegen.py
46cc7c0f7b7583927b8a253cdba87535c6522184 12-Aug-2000 Thomas Wouters <thomas@python.org> Bring Tools/compiler almost up to date. Specifically:

- fix tab space issues (SF patch #101167 by Neil Schemenauer)
- fix co_flags for classes to include CO_NEWLOCALS (SF patch #101145 by Neil)
- fix for merger of UNPACK_LIST and UNPACK_TUPLE into UNPACK_SEQUENCE,
(SF patch #101168 by, well, Neil :)
- Adjust bytecode MAGIC to current bytecode.

TODO: teach compile.py about list comprehensions.
/external/python/cpython2/Lib/compiler/pycodegen.py
7daf04d9e0895f3c7f6ba257529af96c00afe9cc 04-Aug-2000 Jeremy Hylton <jeremy@alum.mit.edu> replace most calls to emit 'SET_LINENO' will call to method set_lineno
based on bug report by Neil Schemenauer
/external/python/cpython2/Lib/compiler/pycodegen.py
be317e615e9c25f3f38062266b9b8a7ad86a1c90 03-May-2000 Jeremy Hylton <jeremy@alum.mit.edu> patches from Mark Hammond

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.
/external/python/cpython2/Lib/compiler/pycodegen.py
36cc6a21973c38376c6a6fb646ca53e079950586 16-Mar-2000 Jeremy Hylton <jeremy@alum.mit.edu> complete rewrite

code generator uses flowgraph as intermediate representation. the old
rep uses a list with explicit "StackRefs" to indicate the target
of jumps.

pyassem converts flowgraph to bytecode, breaks up individual steps of
generating bytecode
/external/python/cpython2/Lib/compiler/pycodegen.py
7fab23e9cb82835a9d0d2b73aaf13c5e9a8105cc 06-Mar-2000 Jeremy Hylton <jeremy@alum.mit.edu> rename compile.py to pycodegen.py

fix imports
remove parse functions and visitor code
track name change: Classdef to Class

add some comments and tweak order of visitXXX methods

get rid of if __name__ == "__main__ section
/external/python/cpython2/Lib/compiler/pycodegen.py
3ec7e2c4be9b3127ed1b10de6e3c48e1786c1a10 17-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> the previous quick hack to fix def foo((x,y)) failed on some cases
(big surprise). new solution is a little less hackish.

Code gen adds a TupleArg instance in the argument slot. The tuple arg
includes a copy of the names that it is responsble for binding. The
PyAssembler uses this information to calculate the correct argcount.

all fix this wacky case: del (a, ((b,), c)), d
which is the same as: del a, b, c, d
(Can't wait for Guido to tell me why.)

solution uses findOp which walks a tree to find out whether it
contains OP_ASSIGN or OP_DELETE or ...
/external/python/cpython2/Lib/compiler/pycodegen.py
873bdc18e4c80d955244267effc2f11249c2b93d 17-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> satisfy the tabnanny
fix broken references to filename var in generateXXX methods
/external/python/cpython2/Lib/compiler/pycodegen.py
ad9a86fb1c8cca20c10beb35fdd54eab44c0f479 16-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> support for arglists with implicit tuple unpacks
- added a number of support methods to generate code just before the
body
- hack protocol for communicating number of args to PyAssembler

fix TryExcept generation for case where exception handler has no body
fix visitAssAttr
add comment about incomplete visitAssName

stop using the ExampleASTVisitor

change script invocation to accept a list of .py files (e.g. Lib/*.py)
/external/python/cpython2/Lib/compiler/pycodegen.py
4f6bcd80fcd3d50160210d3a2328b051f76f0f5e 16-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> finish first impl of code generator

add support for nodes TryExcept, TryFinally, Sliceobj
fix visitSubscript to properly handle x[a,b,c]
/external/python/cpython2/Lib/compiler/pycodegen.py
9e1cd688b5dad9c337092949b5adb2e65fb6a7d3 15-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> edit a doc string
(real intent is to test out rsync install)
/external/python/cpython2/Lib/compiler/pycodegen.py
a46fb3841b71468bdbb613c637b1bc4269829435 14-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> get rid of spurious print
/external/python/cpython2/Lib/compiler/pycodegen.py
126960b7443905cccc54a9aa5ca8e1205762a0e7 14-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> looks like everything is working except for try/except (pystone
compiles correctly)
/external/python/cpython2/Lib/compiler/pycodegen.py
a50581228ebf9e9f1008022bdef735fb4c722705 14-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> split compile.py into two files
add StackDepthFinder (and remove push/pop from CodeGen)
add several nodes, including Ellipsis, Bit&|^, Exec
/external/python/cpython2/Lib/compiler/pycodegen.py
3050d515714ce7d3a52bcb159bea3e9300008cd3 12-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> change MODULE_NAMESPACE/FUNCTION_NAMESPACE stuff to have a single flag
named OPTIMIZED, which matches compile.c and makes more sense for
classes

revamp call signature for PythonVMCode.__init__; doesn't really matter
'cuz this code is going to be refactored out of existence

add generateClassCode and modify Func & Lambda generation

add support for nodes Classdef, Keyword,

fix CallFunc to generate right op arg when calling w/ keywords

add ugly hack to properly compute offsets when the same stack ref is
used multiple times
/external/python/cpython2/Lib/compiler/pycodegen.py
76d01b820c97b4d39688324843227783e0956fcb 11-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> add support for Lambda nodes

change resolution of local name ops (LOAD_FAST). i think it makes
sense now. if it is an argument or a local var name that it used, it
must be in varnames. if it is a local var name that is used, it must
also be in names
/external/python/cpython2/Lib/compiler/pycodegen.py
4eb504c2af614aab64dee5e894ad98b0851c1148 10-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> add loop handling via

Loop object to handle StackRegs
loops stack attr on CodeGenreeator to hold the current loop object

add support for nodes While, Break, Continue
/external/python/cpython2/Lib/compiler/pycodegen.py
3e0910c10c5cd49ec3a3932fc611127e83ccc428 10-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> add namespace attr to CodeGenerator, can be either MODULE_NAMESPACE or
FUNCTION_NAMESPACE. initialize in __init__ and reset in
generateFunctionCode.

replace direct issue of STORE_FAST, STORE_GLOBAL, etc. with call to
storeName; same for loadName and deleteName

the new {store,load,delete}Name methods use the namespace attr and the
local variable stack to determine the correct bytecode to issue
/external/python/cpython2/Lib/compiler/pycodegen.py
5e0ce53e0ed0785535ca8fe56dfaa283e48062ca 10-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> add ExampleASTVisitor:
* prints out examples of nodes that are handled by visitor. simply a
development convenience

remove NestedCodeGenerator -- it was bogus after all
replace with generateFunctionCode, a method to call to generate code
for a function instead of a top-level module

fix impl of visitDiscard (most pop stack)
emit lineno for pass

handle the following new node types: Import, From, Getattr, Subscript,
Slice, AssAttr, AssTuple, Mod, Not, And, Or, List

LocalNameFinder: remove names declared as globals for locals

PythonVMCode: pass arg names to constructor, force varnames to contain
them all (even if they aren't referenced)

add -q option on command line to disable stdout
/external/python/cpython2/Lib/compiler/pycodegen.py
402456020ba862c4641853fe7f3c87a5c5b37cf0 08-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> add optional verbose arg to walk function. it overrides the global
VERBOSE setting for the ASTVisitor

add getopt handling for one or more -v args

rename ForwardRef to StackRef, because it isn't necessarily directional

CodeGenerator:
* add assertStackEmpty method. prints warning if stack is not empty
when it should be
* define methods for AssName, UNARY_*, For

PythonVMCode:
* fix mix up between hasjrel and hasjabs for address calculation
/external/python/cpython2/Lib/compiler/pycodegen.py
53187f32ebbb6156fa8e3ddf834dfde74cfa3208 08-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> now produces valid pyc files for a least a trivial subset of the
language.

CodeGenerator:
* modify to track stack depth
* add emit method that call's PythonVMCode's makeCodeObject
* thread filenames through in hackish way
* set flags for code objects for modules and functions
XXX the docs for the flags seem out of date and/or incomplete

PythonVMCode:
* add doc string describing the elements of a real code object

LineAddrTable:
* creates an lnotab (no quite correctly though)
/external/python/cpython2/Lib/compiler/pycodegen.py
0fdffcf9163c7d5dd18f74f7fad50d42fec60c3d 04-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> rapid evolution towards producing real .pyc files (even though I don't
handle most of the language syntax yet)

create NestedCodeGenerator used to generator the separate code object
that needs to be passed as an argument to MAKE_FUNCTION when a def
stmt is found (probably useful for class too)

change CodeGenerator.visitFunction to use the NestedCG

add CompiledModule class to handle creation of .pyc (pretty minimal
for now)

add makeCodeObject method to PythonVMCode that replaces symbolic names
with indexes into slots of the code code. the design of this
class will probably need to be revised.
/external/python/cpython2/Lib/compiler/pycodegen.py
8b6323d3ef78042118c08703f26cb2adf741ea2e 04-Feb-2000 Jeremy Hylton <jeremy@alum.mit.edu> checking in initial weekend's work

compile.py: ASTVisitor framework plus bits of a code generator that
should be bug-for-buf compatible with compile.c

misc.py: Set and Stack helpers

test.py: a bit of simple sample code that compile.py will work on
/external/python/cpython2/Lib/compiler/pycodegen.py