summaryrefslogtreecommitdiffstats
path: root/Include/graminit.h
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2007-02-27 06:50:52 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2007-02-27 06:50:52 (GMT)
commit81e9502df69394821416309c7c4b5357af51f4d5 (patch)
treead38831cbebfb32890c0c57cb8b36f653300c69f /Include/graminit.h
parent8b41c3dc28a16da97af50cc5f7b884db2cea7b0c (diff)
downloadcpython-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 'Include/graminit.h')
-rw-r--r--Include/graminit.h101
1 files changed, 51 insertions, 50 deletions
diff --git a/Include/graminit.h b/Include/graminit.h
index 7da9004..79e40c4 100644
--- a/Include/graminit.h
+++ b/Include/graminit.h
@@ -35,53 +35,54 @@
#define dotted_as_names 290
#define dotted_name 291
#define global_stmt 292
-#define assert_stmt 293
-#define compound_stmt 294
-#define if_stmt 295
-#define while_stmt 296
-#define for_stmt 297
-#define try_stmt 298
-#define with_stmt 299
-#define with_var 300
-#define except_clause 301
-#define suite 302
-#define testlist_safe 303
-#define old_test 304
-#define old_lambdef 305
-#define test 306
-#define or_test 307
-#define and_test 308
-#define not_test 309
-#define comparison 310
-#define comp_op 311
-#define expr 312
-#define xor_expr 313
-#define and_expr 314
-#define shift_expr 315
-#define arith_expr 316
-#define term 317
-#define factor 318
-#define power 319
-#define atom 320
-#define listmaker 321
-#define testlist_gexp 322
-#define lambdef 323
-#define trailer 324
-#define subscriptlist 325
-#define subscript 326
-#define sliceop 327
-#define exprlist 328
-#define testlist 329
-#define dictsetmaker 330
-#define classdef 331
-#define arglist 332
-#define argument 333
-#define list_iter 334
-#define list_for 335
-#define list_if 336
-#define gen_iter 337
-#define gen_for 338
-#define gen_if 339
-#define testlist1 340
-#define encoding_decl 341
-#define yield_expr 342
+#define nonlocal_stmt 293
+#define assert_stmt 294
+#define compound_stmt 295
+#define if_stmt 296
+#define while_stmt 297
+#define for_stmt 298
+#define try_stmt 299
+#define with_stmt 300
+#define with_var 301
+#define except_clause 302
+#define suite 303
+#define testlist_safe 304
+#define old_test 305
+#define old_lambdef 306
+#define test 307
+#define or_test 308
+#define and_test 309
+#define not_test 310
+#define comparison 311
+#define comp_op 312
+#define expr 313
+#define xor_expr 314
+#define and_expr 315
+#define shift_expr 316
+#define arith_expr 317
+#define term 318
+#define factor 319
+#define power 320
+#define atom 321
+#define listmaker 322
+#define testlist_gexp 323
+#define lambdef 324
+#define trailer 325
+#define subscriptlist 326
+#define subscript 327
+#define sliceop 328
+#define exprlist 329
+#define testlist 330
+#define dictsetmaker 331
+#define classdef 332
+#define arglist 333
+#define argument 334
+#define list_iter 335
+#define list_for 336
+#define list_if 337
+#define gen_iter 338
+#define gen_for 339
+#define gen_if 340
+#define testlist1 341
+#define encoding_decl 342
+#define yield_expr 343