diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2007-02-27 06:50:52 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2007-02-27 06:50:52 (GMT) |
commit | 81e9502df69394821416309c7c4b5357af51f4d5 (patch) | |
tree | ad38831cbebfb32890c0c57cb8b36f653300c69f /Parser/Python.asdl | |
parent | 8b41c3dc28a16da97af50cc5f7b884db2cea7b0c (diff) | |
download | cpython-81e9502df69394821416309c7c4b5357af51f4d5.zip cpython-81e9502df69394821416309c7c4b5357af51f4d5.tar.gz cpython-81e9502df69394821416309c7c4b5357af51f4d5.tar.bz2 |
Provisional implementation of PEP 3104.
Add nonlocal_stmt to Grammar and Nonlocal node to AST. They both
parallel the definitions for globals. The symbol table treats
variables declared as nonlocal just like variables that are free
implicitly.
This change is missing the language spec changes, but makes some
decisions about what the spec should say via the unittests. The PEP
is silent on a number of decisions, so we should review those before
claiming that nonlocal is complete.
Thomas Wouters made the grammer and ast changes. Jeremy Hylton added
the symbol table changes and the tests. Pete Shinners and Neal
Norwitz helped review the code.
Diffstat (limited to 'Parser/Python.asdl')
-rw-r--r-- | Parser/Python.asdl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/Python.asdl b/Parser/Python.asdl index c5b64a9..3dc3c60 100644 --- a/Parser/Python.asdl +++ b/Parser/Python.asdl @@ -34,6 +34,7 @@ module Python version "$Revision$" | ImportFrom(identifier module, alias* names, int? level) | Global(identifier* names) + | Nonlocal(identifier* names) | Expr(expr value) | Pass | Break | Continue |