summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/symbols.py
Commit message (Collapse)AuthorAgeFilesLines
* SF patch [ 597919 ] compiler package and SET_LINENOJeremy Hylton2002-12-311-0/+3
| | | | | | | | | | | | | | | | | 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.
* Merge of the release22 branch changes back into the trunk.Barry Warsaw2001-12-211-0/+2
|
* Whitespace normalization.Tim Peters2001-10-181-8/+8
|
* 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.
* Add generator detection to symbol table.Jeremy Hylton2001-08-291-9/+35
| | | | | Fix bug in handling of statements like "l[x:y] = 2". The visitor was treating this as assignments to l, x, and y!
* Handle private namesJeremy Hylton2001-08-271-7/+3
| | | | | | | | | | | | | | | | | | | (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()
* Fix for sibling nodes that define the same free variableJeremy Hylton2001-08-271-6/+10
| | | | | | | | 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.
* 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.
* Preliminary support for nested scopesJeremy Hylton2001-04-121-5/+125
| | | | | XXX Still doesn't work right for classes XXX Still doesn't do sufficient error checking
* 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