summaryrefslogtreecommitdiffstats
path: root/Tools/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Use the "howto" document class rather than the "manual" class.Fred Drake2001-08-151-85/+81
| | | | | | | | Remove the module index; there aren't enough modules documented yet for this to make sense. Add a couple more index entries, fixed a few typos, and adjusted a few more things for consistency.
* Properly mark attribute names in the table.Fred Drake2001-08-151-117/+117
|
* Change the generated markup so that attribute names are properly marked.Fred Drake2001-08-151-1/+1
|
* Fix small markup consistency nits.Fred Drake2001-08-151-7/+8
|
* update simple explanation of parseFile()Jeremy Hylton2001-08-141-1/+1
|
* First day's progress on documentationJeremy Hylton2001-08-143-0/+588
|
* Fix typo in astgen scriptJeremy Hylton2001-08-143-3/+3
|
* Regenerated from new ast.txt and new astgen.pyJeremy Hylton2001-08-141-12/+23
|
* Add getChildNodes() method to NodeJeremy Hylton2001-08-142-0/+4
|
* Add Yield nodeJeremy Hylton2001-08-142-0/+2
|
* Update e-mail addressAndrew M. Kuchling2001-08-131-1/+1
|
* Added README to this directoryAndrew M. Kuchling2001-08-081-0/+21
|
* SF bug 430991: wrong co_lnotabTim Peters2001-06-091-17/+14
| | | | | | | | | Armin Rigo pointed out that the way the line-# table got built didn't work for lines generating more than 255 bytes of bytecode. Fixed as he suggested, plus corresponding changes to pyassem.py, plus added some long overdue docs about this subtle table to compile.c. Bugfix candidate (line numbers may be off in tracebacks under -O).
* Pop loop off the loop stack before handling the loop's else clause.Jeremy Hylton2001-04-121-4/+4
| | | | | | Otherwise, continue/break will attempt to affect the wrong loop. A few more fiddles to get the SET_LINENOs consistent across compilers.
* Use new _implicitNameOp() to generate name op code for list comprehensions.Jeremy Hylton2001-04-121-4/+17
| | | | | | | | | 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.
* Add support for visitAssAttr to findOp().Jeremy Hylton2001-04-121-1/+1
|
* pyassem.py:Jeremy Hylton2001-04-122-14/+111
| | | | | | | | | | | | | | | | 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.)
* Revise handling of tuple arguments so that the variables names matchJeremy Hylton2001-04-122-8/+8
| | | | those used by compile.c. (test_grammar now depends on the names)
* Only treat an AugAssign as def if its the target is a Name.Jeremy Hylton2001-04-121-2/+4
| | | | Fixes last bug found with test_scope.py.
* Fix unpackSequence() to use _nameOp() rather than LOAD_FASTJeremy Hylton2001-04-121-1/+2
|
* Inside a class scope always use LOAD_NAME, STORE_NAME, DEL_NAMEJeremy Hylton2001-04-121-0/+3
|
* Preliminary support for nested scopesJeremy Hylton2001-04-123-89/+396
| | | | | XXX Still doesn't work right for classes XXX Still doesn't do sufficient error checking
* Define constants for types of scopesJeremy Hylton2001-04-121-0/+5
|
* typoJeremy Hylton2001-04-111-4/+8
|
* [finishing fix from earlier checkins]Jeremy Hylton2001-04-111-0/+1
| | | | | | | Call set_lineno() in visitDiscard(), which will generate linenos for discard statements, e.g. the statement "1/0" Fixes SF bug #409587
* Add support for extra (*) arguments to preorder.Jeremy Hylton2001-04-111-3/+3
| | | | Change default dispatch to use extended call syntax in place of apply.
* Generate docstrings.Jeremy Hylton2001-04-111-3/+26
| | | | | | | Fixes SF buf #217004 Add method fixDocstring() to CodeGenerator. It converts the Discard node containing the docstring into an assignment to __doc__.
* Add lineno attributes to Discard nodesJeremy Hylton2001-04-111-1/+3
|
* Make sure the docstring is always entered as the first element in theJeremy Hylton2001-04-111-11/+1
| | | | | | consts, even if it is None. Simplify _lookupName() by removing lots of redundant tests.
* Add globals to list of names returned by get_names().Jeremy Hylton2001-04-091-7/+13
| | | | | Fix func arg processing to handle args in tuples. In test code, skip names beginning with '.'.
* Add two arguments to Scope constructor, module scope and class nameJeremy Hylton2001-04-091-24/+92
| | | | | | | Add mangling support Add get_children() and add_child() methods to Scope Skip nodes when If test is a false constant Add test code that checks results against symtable module
* Add preliminary module symbol table constructorJeremy Hylton2001-04-091-0/+193
|
* Add support for future statementsJeremy Hylton2001-04-092-6/+98
|
* Fix "import as" (has always skipping the as name)Jeremy Hylton2001-04-091-9/+15
| | | | | | Fix com_NEWLINE() so that is accepts arguments, which occurs for lines like: stmt; # note trailing semicolon Add XXX about checking for assignment to list comps
* typoJeremy Hylton2001-04-091-1/+1
|
* a few small optimizations that seem to give a 5-10% speedup; theJeremy Hylton2000-11-061-76/+80
| | | | further optimization of com_node makes the most difference.
* move pruneNext method to correct object (doh!)Jeremy Hylton2000-11-061-24/+24
|
* Change the graph structure to contain the code generator object forJeremy Hylton2000-11-063-21/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* If a function contains a doc string, remove the doc string node fromJeremy Hylton2000-11-061-1/+5
| | | | | | | the function's body. If assert is used without an error message, make the AST node None rather than Name('None').
* Many changes.Jeremy Hylton2000-10-251-220/+145
| | | | | | | | | | | | | | | | | | | | | Reformatting -- long lines, "[ ]" -> "[]", a few indentation nits. Replace calls to Node function (which constructed ast nodes) with calls to actual constructors imported from ast module. Optimize com_node (most frequently used method) for the common case -- the appropriate method is found in _dispatch. Fix com_augassign to use class object's rather than node names (rendered invalid by recent changes to ast) Remove expensive tests for sequence-ness in com_stmt and com_append_stmt. These tests should never fail; if they do, something is really broken and exception will be raised elsewhere. Fix com_stmt and com_append_stmt to use isinstance rather than testing's type slot of ast node (this slot disappeared with recent changes to ast).
* Generated from rev 1.1 of ast.txtJeremy Hylton2000-10-251-677/+606
|
* Small optimizations in dispatch method: 1) lookup node's __class__ onceJeremy Hylton2000-10-251-12/+14
| | | | | and store in local; 2) define _preorder to be dispatch (rather than method that called dispatch).
* Support for generation of ast.py from simple description of nodeJeremy Hylton2000-10-254-0/+518
| | | | structure (ast.txt). Usage is python astgen.py > ast.py.
* run the std regression test suite using bytecode produced by the compilerJeremy Hylton2000-10-131-0/+55
|
* add -d option that dumps entire AST before compilingJeremy Hylton2000-10-131-2/+5
|
* Now supports entire Python 2.0 language and still supports PythonJeremy Hylton2000-10-134-93/+463
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix SF bug #116263: support for from .. import *Jeremy Hylton2000-10-123-4/+13
| | | | | | transformer.py: return '*', None from com_import_as_name pycodegen.py: special case for name == '*' pyassem.py: fix stack counting for IMPORT_ opcodes
* read in a .pyc file and disassemble the code objectsJeremy Hylton2000-10-091-0/+39
|
* change 2-space indent to 4-space indentJeremy Hylton2000-09-201-1081/+1079
|
* distutils setup scriptJeremy Hylton2000-09-201-0/+9
|