summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2004-08-02 06:10:11 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2004-08-02 06:10:11 (GMT)
commitc2a5a636545a88f349dbe3e452ffb4494b68e534 (patch)
treeaaa24074dcdcce5afa51523969971bdd05381b01 /Include
parentfd7dc5169c3ca7d64109512f38762c4ce9e96c5f (diff)
downloadcpython-c2a5a636545a88f349dbe3e452ffb4494b68e534.zip
cpython-c2a5a636545a88f349dbe3e452ffb4494b68e534.tar.gz
cpython-c2a5a636545a88f349dbe3e452ffb4494b68e534.tar.bz2
PEP-0318, @decorator-style. In Guido's words:
"@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
Diffstat (limited to 'Include')
-rw-r--r--Include/graminit.h140
-rw-r--r--Include/node.h2
-rw-r--r--Include/token.h7
3 files changed, 77 insertions, 72 deletions
diff --git a/Include/graminit.h b/Include/graminit.h
index 7d4a97a..ac351be 100644
--- a/Include/graminit.h
+++ b/Include/graminit.h
@@ -1,72 +1,74 @@
#define single_input 256
#define file_input 257
#define eval_input 258
-#define funcdef 259
-#define parameters 260
-#define varargslist 261
-#define fpdef 262
-#define fplist 263
-#define stmt 264
-#define simple_stmt 265
-#define small_stmt 266
-#define expr_stmt 267
-#define augassign 268
-#define print_stmt 269
-#define del_stmt 270
-#define pass_stmt 271
-#define flow_stmt 272
-#define break_stmt 273
-#define continue_stmt 274
-#define return_stmt 275
-#define yield_stmt 276
-#define raise_stmt 277
-#define import_stmt 278
-#define import_as_name 279
-#define dotted_as_name 280
-#define dotted_name 281
-#define global_stmt 282
-#define exec_stmt 283
-#define assert_stmt 284
-#define compound_stmt 285
-#define if_stmt 286
-#define while_stmt 287
-#define for_stmt 288
-#define try_stmt 289
-#define except_clause 290
-#define suite 291
-#define test 292
-#define and_test 293
-#define not_test 294
-#define comparison 295
-#define comp_op 296
-#define expr 297
-#define xor_expr 298
-#define and_expr 299
-#define shift_expr 300
-#define arith_expr 301
-#define term 302
-#define factor 303
-#define power 304
-#define atom 305
-#define listmaker 306
-#define testlist_gexp 307
-#define lambdef 308
-#define trailer 309
-#define subscriptlist 310
-#define subscript 311
-#define sliceop 312
-#define exprlist 313
-#define testlist 314
-#define testlist_safe 315
-#define dictmaker 316
-#define classdef 317
-#define arglist 318
-#define argument 319
-#define list_iter 320
-#define list_for 321
-#define list_if 322
-#define gen_iter 323
-#define gen_for 324
-#define gen_if 325
-#define testlist1 326
-#define encoding_decl 327
+#define decorator 259
+#define decorators 260
+#define funcdef 261
+#define parameters 262
+#define varargslist 263
+#define fpdef 264
+#define fplist 265
+#define stmt 266
+#define simple_stmt 267
+#define small_stmt 268
+#define expr_stmt 269
+#define augassign 270
+#define print_stmt 271
+#define del_stmt 272
+#define pass_stmt 273
+#define flow_stmt 274
+#define break_stmt 275
+#define continue_stmt 276
+#define return_stmt 277
+#define yield_stmt 278
+#define raise_stmt 279
+#define import_stmt 280
+#define import_as_name 281
+#define dotted_as_name 282
+#define dotted_name 283
+#define global_stmt 284
+#define exec_stmt 285
+#define assert_stmt 286
+#define compound_stmt 287
+#define if_stmt 288
+#define while_stmt 289
+#define for_stmt 290
+#define try_stmt 291
+#define except_clause 292
+#define suite 293
+#define test 294
+#define and_test 295
+#define not_test 296
+#define comparison 297
+#define comp_op 298
+#define expr 299
+#define xor_expr 300
+#define and_expr 301
+#define shift_expr 302
+#define arith_expr 303
+#define term 304
+#define factor 305
+#define power 306
+#define atom 307
+#define listmaker 308
+#define testlist_gexp 309
+#define lambdef 310
+#define trailer 311
+#define subscriptlist 312
+#define subscript 313
+#define sliceop 314
+#define exprlist 315
+#define testlist 316
+#define testlist_safe 317
+#define dictmaker 318
+#define classdef 319
+#define arglist 320
+#define argument 321
+#define list_iter 322
+#define list_for 323
+#define list_if 324
+#define gen_iter 325
+#define gen_for 326
+#define gen_if 327
+#define testlist1 328
+#define encoding_decl 329
diff --git a/Include/node.h b/Include/node.h
index 8f5ef23..4c64708 100644
--- a/Include/node.h
+++ b/Include/node.h
@@ -22,7 +22,9 @@ PyAPI_FUNC(void) PyNode_Free(node *n);
/* Node access functions */
#define NCH(n) ((n)->n_nchildren)
+
#define CHILD(n, i) (&(n)->n_child[i])
+#define RCHILD(n, i) (CHILD(n, NCH(n) + i))
#define TYPE(n) ((n)->n_type)
#define STR(n) ((n)->n_str)
diff --git a/Include/token.h b/Include/token.h
index 4e2ec06..4250000 100644
--- a/Include/token.h
+++ b/Include/token.h
@@ -57,10 +57,11 @@ extern "C" {
#define DOUBLESTAREQUAL 47
#define DOUBLESLASH 48
#define DOUBLESLASHEQUAL 49
+#define AT 50
/* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
-#define OP 50
-#define ERRORTOKEN 51
-#define N_TOKENS 52
+#define OP 51
+#define ERRORTOKEN 52
+#define N_TOKENS 53
/* Special definitions for cooperation with parser */