| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
| |
bound.
When a Yield() node is visited, assign to the generator attribute of
the scope, not the visitor.
|
|
|
|
|
| |
Fix bug in handling of statements like "l[x:y] = 2". The visitor was
treating this as assignments to l, x, and y!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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()
|
|
|
|
|
|
|
|
| |
Evan Simpson's fix. And his explanation:
If you defined two nested functions in a row that refer to the
same non-global variable, the second one will be generated as
though the variable were global.
|
|
|
|
| |
Fixes last bug found with test_scope.py.
|
|
|
|
|
| |
XXX Still doesn't work right for classes
XXX Still doesn't do sufficient error checking
|
|
|
|
|
| |
Fix func arg processing to handle args in tuples.
In test code, skip names beginning with '.'.
|
|
|
|
|
|
|
| |
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
|
|
|