summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2007-02-27 06:50:52 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2007-02-27 06:50:52 +0000
commit8110a89fde7e127e8234d14226521a586aceff0f (patch)
tree5bbd098f9676d25ff1b2f0003d781aa02ee0a816 /Parser
parentb5b81e55d468ccd199f7b9a3d8705872304757ae (diff)
downloadcpython-8110a89fde7e127e8234d14226521a586aceff0f.tar.gz
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')
-rw-r--r--Parser/Python.asdl1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/Python.asdl b/Parser/Python.asdl
index c5b64a9923..3dc3c6005c 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