diff options
author | Christian Heimes <christian@cheimes.de> | 2008-02-23 15:01:05 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-02-23 15:01:05 (GMT) |
commit | 5224d28d38eb784f17c2fed3f48368285df6d17a (patch) | |
tree | b258202efc39ae5239d91dcf5b1898c6ce713f16 /Include | |
parent | b12f0b581a6f268d0611c87012d1273aeca220b8 (diff) | |
download | cpython-5224d28d38eb784f17c2fed3f48368285df6d17a.zip cpython-5224d28d38eb784f17c2fed3f48368285df6d17a.tar.gz cpython-5224d28d38eb784f17c2fed3f48368285df6d17a.tar.bz2 |
Patch #1759: Backport of PEP 3129 class decorators
with some help from Georg
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python-ast.h | 12 | ||||
-rw-r--r-- | Include/graminit.h | 159 |
2 files changed, 87 insertions, 84 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h index 8b395a8..a1033ee 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -73,13 +73,14 @@ struct _stmt { identifier name; arguments_ty args; asdl_seq *body; - asdl_seq *decorators; + asdl_seq *decorator_list; } FunctionDef; struct { identifier name; asdl_seq *bases; asdl_seq *body; + asdl_seq *decorator_list; } ClassDef; struct { @@ -359,11 +360,12 @@ mod_ty _Py_Expression(expr_ty body, PyArena *arena); mod_ty _Py_Suite(asdl_seq * body, PyArena *arena); #define FunctionDef(a0, a1, a2, a3, a4, a5, a6) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6) stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body, - asdl_seq * decorators, int lineno, int col_offset, + asdl_seq * decorator_list, int lineno, int col_offset, PyArena *arena); -#define ClassDef(a0, a1, a2, a3, a4, a5) _Py_ClassDef(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int - lineno, int col_offset, PyArena *arena); +#define ClassDef(a0, a1, a2, a3, a4, a5, a6) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6) +stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, + asdl_seq * decorator_list, int lineno, int col_offset, + PyArena *arena); #define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3) stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena); #define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3) diff --git a/Include/graminit.h b/Include/graminit.h index 9af182a..76da6a4 100644 --- a/Include/graminit.h +++ b/Include/graminit.h @@ -3,82 +3,83 @@ #define eval_input 258 #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_name 281 -#define import_from 282 -#define import_as_name 283 -#define dotted_as_name 284 -#define import_as_names 285 -#define dotted_as_names 286 -#define dotted_name 287 -#define global_stmt 288 -#define exec_stmt 289 -#define assert_stmt 290 -#define compound_stmt 291 -#define if_stmt 292 -#define while_stmt 293 -#define for_stmt 294 -#define try_stmt 295 -#define with_stmt 296 -#define with_var 297 -#define except_clause 298 -#define suite 299 -#define testlist_safe 300 -#define old_test 301 -#define old_lambdef 302 -#define test 303 -#define or_test 304 -#define and_test 305 -#define not_test 306 -#define comparison 307 -#define comp_op 308 -#define expr 309 -#define xor_expr 310 -#define and_expr 311 -#define shift_expr 312 -#define arith_expr 313 -#define term 314 -#define factor 315 -#define power 316 -#define atom 317 -#define listmaker 318 -#define testlist_gexp 319 -#define lambdef 320 -#define trailer 321 -#define subscriptlist 322 -#define subscript 323 -#define sliceop 324 -#define exprlist 325 -#define testlist 326 -#define dictmaker 327 -#define classdef 328 -#define arglist 329 -#define argument 330 -#define list_iter 331 -#define list_for 332 -#define list_if 333 -#define gen_iter 334 -#define gen_for 335 -#define gen_if 336 -#define testlist1 337 -#define encoding_decl 338 -#define yield_expr 339 +#define decorated 261 +#define funcdef 262 +#define parameters 263 +#define varargslist 264 +#define fpdef 265 +#define fplist 266 +#define stmt 267 +#define simple_stmt 268 +#define small_stmt 269 +#define expr_stmt 270 +#define augassign 271 +#define print_stmt 272 +#define del_stmt 273 +#define pass_stmt 274 +#define flow_stmt 275 +#define break_stmt 276 +#define continue_stmt 277 +#define return_stmt 278 +#define yield_stmt 279 +#define raise_stmt 280 +#define import_stmt 281 +#define import_name 282 +#define import_from 283 +#define import_as_name 284 +#define dotted_as_name 285 +#define import_as_names 286 +#define dotted_as_names 287 +#define dotted_name 288 +#define global_stmt 289 +#define exec_stmt 290 +#define assert_stmt 291 +#define compound_stmt 292 +#define if_stmt 293 +#define while_stmt 294 +#define for_stmt 295 +#define try_stmt 296 +#define with_stmt 297 +#define with_var 298 +#define except_clause 299 +#define suite 300 +#define testlist_safe 301 +#define old_test 302 +#define old_lambdef 303 +#define test 304 +#define or_test 305 +#define and_test 306 +#define not_test 307 +#define comparison 308 +#define comp_op 309 +#define expr 310 +#define xor_expr 311 +#define and_expr 312 +#define shift_expr 313 +#define arith_expr 314 +#define term 315 +#define factor 316 +#define power 317 +#define atom 318 +#define listmaker 319 +#define testlist_gexp 320 +#define lambdef 321 +#define trailer 322 +#define subscriptlist 323 +#define subscript 324 +#define sliceop 325 +#define exprlist 326 +#define testlist 327 +#define dictmaker 328 +#define classdef 329 +#define arglist 330 +#define argument 331 +#define list_iter 332 +#define list_for 333 +#define list_if 334 +#define gen_iter 335 +#define gen_for 336 +#define gen_if 337 +#define testlist1 338 +#define encoding_decl 339 +#define yield_expr 340 |