diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python-ast.h | 21 | ||||
-rw-r--r-- | Include/graminit.h | 148 |
2 files changed, 76 insertions, 93 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h index 6eec6c3..53a6a4b 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -355,20 +355,9 @@ struct _arguments { asdl_seq *kw_defaults; }; -enum _arg_kind {SimpleArg_kind=1, NestedArgs_kind=2}; struct _arg { - enum _arg_kind kind; - union { - struct { - identifier arg; - expr_ty annotation; - } SimpleArg; - - struct { - asdl_seq *args; - } NestedArgs; - - } v; + identifier arg; + expr_ty annotation; }; struct _keyword { @@ -535,10 +524,8 @@ arguments_ty _Py_arguments(asdl_seq * args, identifier vararg, expr_ty varargannotation, asdl_seq * kwonlyargs, identifier kwarg, expr_ty kwargannotation, asdl_seq * defaults, asdl_seq * kw_defaults, PyArena *arena); -#define SimpleArg(a0, a1, a2) _Py_SimpleArg(a0, a1, a2) -arg_ty _Py_SimpleArg(identifier arg, expr_ty annotation, PyArena *arena); -#define NestedArgs(a0, a1) _Py_NestedArgs(a0, a1) -arg_ty _Py_NestedArgs(asdl_seq * args, PyArena *arena); +#define arg(a0, a1, a2) _Py_arg(a0, a1, a2) +arg_ty _Py_arg(identifier arg, expr_ty annotation, PyArena *arena); #define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2) keyword_ty _Py_keyword(identifier arg, expr_ty value, PyArena *arena); #define alias(a0, a1, a2) _Py_alias(a0, a1, a2) diff --git a/Include/graminit.h b/Include/graminit.h index 6e1d409..e3929db 100644 --- a/Include/graminit.h +++ b/Include/graminit.h @@ -6,79 +6,75 @@ #define funcdef 261 #define parameters 262 #define typedargslist 263 -#define tname 264 -#define tfpdef 265 -#define tfplist 266 -#define varargslist 267 -#define vname 268 -#define vfpdef 269 -#define vfplist 270 -#define stmt 271 -#define simple_stmt 272 -#define small_stmt 273 -#define expr_stmt 274 -#define augassign 275 -#define del_stmt 276 -#define pass_stmt 277 -#define flow_stmt 278 -#define break_stmt 279 -#define continue_stmt 280 -#define return_stmt 281 -#define yield_stmt 282 -#define raise_stmt 283 -#define import_stmt 284 -#define import_name 285 -#define import_from 286 -#define import_as_name 287 -#define dotted_as_name 288 -#define import_as_names 289 -#define dotted_as_names 290 -#define dotted_name 291 -#define global_stmt 292 -#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 test 304 -#define test_nocond 305 -#define lambdef 306 -#define lambdef_nocond 307 -#define or_test 308 -#define and_test 309 -#define not_test 310 -#define comparison 311 -#define comp_op 312 -#define star_expr 313 -#define expr 314 -#define xor_expr 315 -#define and_expr 316 -#define shift_expr 317 -#define arith_expr 318 -#define term 319 -#define factor 320 -#define power 321 -#define atom 322 -#define testlist_comp 323 -#define trailer 324 -#define subscriptlist 325 -#define subscript 326 -#define sliceop 327 -#define exprlist 328 -#define testlist 329 -#define dictorsetmaker 330 -#define classdef 331 -#define arglist 332 -#define argument 333 -#define comp_iter 334 -#define comp_for 335 -#define comp_if 336 -#define testlist1 337 -#define encoding_decl 338 -#define yield_expr 339 +#define tfpdef 264 +#define varargslist 265 +#define vfpdef 266 +#define stmt 267 +#define simple_stmt 268 +#define small_stmt 269 +#define expr_stmt 270 +#define augassign 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 nonlocal_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 test 300 +#define test_nocond 301 +#define lambdef 302 +#define lambdef_nocond 303 +#define or_test 304 +#define and_test 305 +#define not_test 306 +#define comparison 307 +#define comp_op 308 +#define star_expr 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 testlist_comp 319 +#define trailer 320 +#define subscriptlist 321 +#define subscript 322 +#define sliceop 323 +#define exprlist 324 +#define testlist 325 +#define dictorsetmaker 326 +#define classdef 327 +#define arglist 328 +#define argument 329 +#define comp_iter 330 +#define comp_for 331 +#define comp_if 332 +#define testlist1 333 +#define encoding_decl 334 +#define yield_expr 335 |