<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Lib/compiler/pycodegen.py, branch v2.1a2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/compiler/pycodegen.py?h=v2.1a2</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/compiler/pycodegen.py?h=v2.1a2'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2000-11-06T03:43:11Z</updated>
<entry>
<title>Change the graph structure to contain the code generator object for</title>
<updated>2000-11-06T03:43:11Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-11-06T03:43:11Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=314e3fb215c4e96a8c5523061623d8439ab4c2dc'/>
<id>urn:sha1:314e3fb215c4e96a8c5523061623d8439ab4c2dc</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Now supports entire Python 2.0 language and still supports Python</title>
<updated>2000-10-13T21:58:13Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-10-13T21:58:13Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9c048f9f6565d9a83890d0834f5f9b4be3a7cd8b'/>
<id>urn:sha1:9c048f9f6565d9a83890d0834f5f9b4be3a7cd8b</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>Fix SF bug #116263: support for from .. import *</title>
<updated>2000-10-12T20:23:23Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-10-12T20:23:23Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4e1be72e6babf857d9f263b087dae3123ac8efe1'/>
<id>urn:sha1:4e1be72e6babf857d9f263b087dae3123ac8efe1</id>
<content type='text'>
transformer.py: return '*', None from com_import_as_name
pycodegen.py: special case for name == '*'
pyassem.py: fix stack counting for IMPORT_ opcodes
</content>
</entry>
<entry>
<title>patch by Neil Schemenauer to improve (fix?) line number generation</title>
<updated>2000-09-01T20:47:37Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-09-01T20:47:37Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=92f397209055a0ae7599e5a7ea202f19fae8fd7b'/>
<id>urn:sha1:92f397209055a0ae7599e5a7ea202f19fae8fd7b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update magic number.</title>
<updated>2000-09-01T20:33:26Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-09-01T20:33:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=2051608616178ca6b73d5d59d887ddd67c5835e3'/>
<id>urn:sha1:2051608616178ca6b73d5d59d887ddd67c5835e3</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Bring Tools/compiler almost up to date. Specifically:</title>
<updated>2000-08-12T20:32:46Z</updated>
<author>
<name>Thomas Wouters</name>
<email>thomas@python.org</email>
</author>
<published>2000-08-12T20:32:46Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=46cc7c0f7b7583927b8a253cdba87535c6522184'/>
<id>urn:sha1:46cc7c0f7b7583927b8a253cdba87535c6522184</id>
<content type='text'>
- 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.
</content>
</entry>
<entry>
<title>replace most calls to emit 'SET_LINENO' will call to method set_lineno</title>
<updated>2000-08-04T16:56:51Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-08-04T16:56:51Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=7daf04d9e0895f3c7f6ba257529af96c00afe9cc'/>
<id>urn:sha1:7daf04d9e0895f3c7f6ba257529af96c00afe9cc</id>
<content type='text'>
based on bug report by Neil Schemenauer
</content>
</entry>
<entry>
<title>patches from Mark Hammond</title>
<updated>2000-05-02T22:32:59Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-05-02T22:32:59Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=be317e615e9c25f3f38062266b9b8a7ad86a1c90'/>
<id>urn:sha1:be317e615e9c25f3f38062266b9b8a7ad86a1c90</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>complete rewrite</title>
<updated>2000-03-16T20:06:59Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-03-16T20:06:59Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=36cc6a21973c38376c6a6fb646ca53e079950586'/>
<id>urn:sha1:36cc6a21973c38376c6a6fb646ca53e079950586</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>rename compile.py to pycodegen.py</title>
<updated>2000-03-06T19:10:54Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2000-03-06T19:10:54Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=7fab23e9cb82835a9d0d2b73aaf13c5e9a8105cc'/>
<id>urn:sha1:7fab23e9cb82835a9d0d2b73aaf13c5e9a8105cc</id>
<content type='text'>
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
</content>
</entry>
</feed>
