From 18b356bf478c6fc5c1afb08f5351a98e872ca75d Mon Sep 17 00:00:00 2001 From: sobolevn Date: Mon, 29 Jun 2026 23:01:47 +0300 Subject: [PATCH] gh-152631: Fix `ast.parse` on lazy imports with older `feature_version` --- Grammar/python.gram | 20 +- Lib/test/test_ast/test_ast.py | 13 + ...-06-29-23-01-07.gh-issue-152631.LKgCM_.rst | 2 + Parser/parser.c | 627 +++++++++++------- 4 files changed, 406 insertions(+), 256 deletions(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst diff --git a/Grammar/python.gram b/Grammar/python.gram index a8adeb566aaf5d1..79feff7508e031b 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -225,14 +225,24 @@ import_stmt[stmt_ty](memo): # ----------------- import_name[stmt_ty]: - | lazy="lazy"? 'import' a=dotted_as_names { _PyAST_Import(a, lazy ? 1 : 0, EXTRA) } + | "lazy" 'import' a=dotted_as_names { + CHECK_VERSION(stmt_ty, 15, "Lazy imports are", + _PyAST_Import(a, 1, EXTRA)) } + | 'import' a=dotted_as_names { _PyAST_Import(a, 0, EXTRA) } # note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS import_from[stmt_ty]: - | lazy="lazy"? 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets { - _PyPegen_checked_future_import(p, b->v.Name.id, c, _PyPegen_seq_count_dots(a), lazy, EXTRA) } - | lazy="lazy"? 'from' a=('.' | '...')+ 'import' b=import_from_targets { - _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), lazy ? 1 : 0, EXTRA) } + | lazy="lazy" 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets { + CHECK_VERSION(stmt_ty, 15, "Lazy imports are", + _PyPegen_checked_future_import(p, b->v.Name.id, c, _PyPegen_seq_count_dots(a), lazy, EXTRA)) } + | "lazy" 'from' a=('.' | '...')+ 'import' b=import_from_targets { + CHECK_VERSION(stmt_ty, 15, "Lazy imports are", + _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), 1, EXTRA)) } + | 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets { + _PyPegen_checked_future_import(p, b->v.Name.id, c, _PyPegen_seq_count_dots(a), 0, EXTRA) } + | 'from' a=('.' | '...')+ 'import' b=import_from_targets { + _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), 0, EXTRA) } + import_from_targets[asdl_alias_seq*]: | '(' a=import_from_as_names [','] ')' { a } | import_from_as_names !',' diff --git a/Lib/test/test_ast/test_ast.py b/Lib/test/test_ast/test_ast.py index fd3b33bab7f8336..4659c27dcee9151 100644 --- a/Lib/test/test_ast/test_ast.py +++ b/Lib/test/test_ast/test_ast.py @@ -968,6 +968,19 @@ def test_type_params_default_feature_version(self): with self.assertRaises(SyntaxError): ast.parse(sample, feature_version=(3, 12)) + def test_lazy_imports_feature_version(self): + samples = [ + "lazy import os", + "lazy from .. import name", + "lazy from mod import some", + ] + for sample in samples: + with self.subTest(sample): + ast.parse(sample) + ast.parse(sample, feature_version=(3, 15)) + with self.assertRaises(SyntaxError): + ast.parse(sample, feature_version=(3, 14)) + def test_invalid_major_feature_version(self): with self.assertRaises(ValueError): ast.parse('pass', feature_version=(2, 7)) diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst new file mode 100644 index 000000000000000..51208108f10647b --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst @@ -0,0 +1,2 @@ +Fix :func:`ast.parse` ability to parse lazy imports with *feature_version* +older than 3.15, now it properly raises :exc:`SyntaxError`. diff --git a/Parser/parser.c b/Parser/parser.c index 58b6dd77a38b26d..cc69d93bebc5727 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -22,54 +22,54 @@ static KeywordToken *reserved_keywords[] = { (KeywordToken[]) {{NULL, -1}}, (KeywordToken[]) {{NULL, -1}}, (KeywordToken[]) { - {"if", 698}, - {"as", 696}, - {"in", 711}, - {"or", 589}, - {"is", 597}, + {"if", 703}, + {"as", 701}, + {"in", 716}, + {"or", 594}, + {"is", 602}, {NULL, -1}, }, (KeywordToken[]) { - {"del", 634}, - {"def", 715}, - {"for", 710}, - {"try", 672}, - {"and", 590}, - {"not", 719}, + {"del", 639}, + {"def", 720}, + {"for", 715}, + {"try", 677}, + {"and", 595}, + {"not", 724}, {NULL, -1}, }, (KeywordToken[]) { - {"from", 646}, + {"from", 651}, {"pass", 527}, - {"with", 663}, - {"elif", 703}, - {"else", 702}, - {"None", 628}, - {"True", 627}, + {"with", 668}, + {"elif", 708}, + {"else", 707}, + {"None", 633}, + {"True", 632}, {NULL, -1}, }, (KeywordToken[]) { - {"raise", 632}, - {"yield", 588}, + {"raise", 637}, + {"yield", 593}, {"break", 528}, - {"async", 714}, - {"class", 717}, - {"while", 705}, - {"False", 629}, - {"await", 598}, + {"async", 719}, + {"class", 722}, + {"while", 710}, + {"False", 634}, + {"await", 603}, {NULL, -1}, }, (KeywordToken[]) { - {"import", 647}, + {"import", 652}, {"return", 522}, - {"assert", 638}, + {"assert", 643}, {"global", 530}, - {"except", 693}, - {"lambda", 622}, + {"except", 698}, + {"lambda", 627}, {NULL, -1}, }, (KeywordToken[]) { - {"finally", 689}, + {"finally", 694}, {NULL, -1}, }, (KeywordToken[]) { @@ -1730,7 +1730,7 @@ simple_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'raise' raise_stmt")); stmt_ty raise_stmt_var; if ( - _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 632) // token='raise' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 637) // token='raise' && (raise_stmt_var = raise_stmt_rule(p)) // raise_stmt ) @@ -1772,7 +1772,7 @@ simple_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'del' del_stmt")); stmt_ty del_stmt_var; if ( - _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 634) // token='del' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 639) // token='del' && (del_stmt_var = del_stmt_rule(p)) // del_stmt ) @@ -1793,7 +1793,7 @@ simple_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'yield' yield_stmt")); stmt_ty yield_stmt_var; if ( - _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 588) // token='yield' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 593) // token='yield' && (yield_stmt_var = yield_stmt_rule(p)) // yield_stmt ) @@ -1814,7 +1814,7 @@ simple_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'assert' assert_stmt")); stmt_ty assert_stmt_var; if ( - _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 638) // token='assert' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 643) // token='assert' && (assert_stmt_var = assert_stmt_rule(p)) // assert_stmt ) @@ -1968,7 +1968,7 @@ compound_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'if' if_stmt")); stmt_ty if_stmt_var; if ( - _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 698) // token='if' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 703) // token='if' && (if_stmt_var = if_stmt_rule(p)) // if_stmt ) @@ -2052,7 +2052,7 @@ compound_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'try' try_stmt")); stmt_ty try_stmt_var; if ( - _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 672) // token='try' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 677) // token='try' && (try_stmt_var = try_stmt_rule(p)) // try_stmt ) @@ -2073,7 +2073,7 @@ compound_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'while' while_stmt")); stmt_ty while_stmt_var; if ( - _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 705) // token='while' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 710) // token='while' && (while_stmt_var = while_stmt_rule(p)) // while_stmt ) @@ -2836,11 +2836,11 @@ raise_stmt_rule(Parser *p) expr_ty a; expr_ty b; if ( - (_keyword = _PyPegen_expect_token(p, 632)) // token='raise' + (_keyword = _PyPegen_expect_token(p, 637)) // token='raise' && (a = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 646)) // token='from' + (_keyword_1 = _PyPegen_expect_token(p, 651)) // token='from' && (b = expression_rule(p)) // expression ) @@ -2895,7 +2895,7 @@ raise_stmt_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 632)) // token='raise' + (_keyword = _PyPegen_expect_token(p, 637)) // token='raise' && (a = expression_rule(p)) // expression ) @@ -2930,7 +2930,7 @@ raise_stmt_rule(Parser *p) D(fprintf(stderr, "%*c> raise_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'raise'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 632)) // token='raise' + (_keyword = _PyPegen_expect_token(p, 637)) // token='raise' ) { D(fprintf(stderr, "%*c+ raise_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'raise'")); @@ -3303,7 +3303,7 @@ del_stmt_rule(Parser *p) Token * _keyword; asdl_expr_seq* a; if ( - (_keyword = _PyPegen_expect_token(p, 634)) // token='del' + (_keyword = _PyPegen_expect_token(p, 639)) // token='del' && (a = del_targets_rule(p)) // del_targets && @@ -3469,7 +3469,7 @@ assert_stmt_rule(Parser *p) expr_ty a; void *b; if ( - (_keyword = _PyPegen_expect_token(p, 638)) // token='assert' + (_keyword = _PyPegen_expect_token(p, 643)) // token='assert' && (a = expression_rule(p)) // expression && @@ -3585,7 +3585,7 @@ import_stmt_rule(Parser *p) return _res; } -// import_name: "lazy"? 'import' dotted_as_names +// import_name: "lazy" 'import' dotted_as_names | 'import' dotted_as_names static stmt_ty import_name_rule(Parser *p) { @@ -3607,24 +3607,60 @@ import_name_rule(Parser *p) UNUSED(_start_lineno); // Only used by EXTRA macro int _start_col_offset = p->tokens[_mark]->col_offset; UNUSED(_start_col_offset); // Only used by EXTRA macro - { // "lazy"? 'import' dotted_as_names + { // "lazy" 'import' dotted_as_names if (p->error_indicator) { p->level--; return NULL; } - D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"lazy\"? 'import' dotted_as_names")); - Token * _keyword; + D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"lazy\" 'import' dotted_as_names")); + expr_ty _keyword; + Token * _keyword_1; asdl_alias_seq* a; - void *lazy; if ( - (lazy = _PyPegen_expect_soft_keyword(p, "lazy"), !p->error_indicator) // "lazy"? + (_keyword = _PyPegen_expect_soft_keyword(p, "lazy")) // soft_keyword='"lazy"' && - (_keyword = _PyPegen_expect_token(p, 647)) // token='import' + (_keyword_1 = _PyPegen_expect_token(p, 652)) // token='import' + && + (a = dotted_as_names_rule(p)) // dotted_as_names + ) + { + D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"lazy\" 'import' dotted_as_names")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + p->level--; + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = CHECK_VERSION ( stmt_ty , 15 , "Lazy imports are" , _PyAST_Import ( a , 1 , EXTRA ) ); + if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) { + p->error_indicator = 1; + p->level--; + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s import_name[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"lazy\" 'import' dotted_as_names")); + } + { // 'import' dotted_as_names + if (p->error_indicator) { + p->level--; + return NULL; + } + D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'import' dotted_as_names")); + Token * _keyword; + asdl_alias_seq* a; + if ( + (_keyword = _PyPegen_expect_token(p, 652)) // token='import' && (a = dotted_as_names_rule(p)) // dotted_as_names ) { - D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"lazy\"? 'import' dotted_as_names")); + D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'import' dotted_as_names")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { p->level--; @@ -3634,7 +3670,7 @@ import_name_rule(Parser *p) UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _PyAST_Import ( a , lazy ? 1 : 0 , EXTRA ); + _res = _PyAST_Import ( a , 0 , EXTRA ); if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) { p->error_indicator = 1; p->level--; @@ -3644,7 +3680,7 @@ import_name_rule(Parser *p) } p->mark = _mark; D(fprintf(stderr, "%*c%s import_name[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"lazy\"? 'import' dotted_as_names")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'import' dotted_as_names")); } _res = NULL; done: @@ -3653,8 +3689,10 @@ import_name_rule(Parser *p) } // import_from: -// | "lazy"? 'from' (('.' | '...'))* dotted_name 'import' import_from_targets -// | "lazy"? 'from' (('.' | '...'))+ 'import' import_from_targets +// | "lazy" 'from' (('.' | '...'))* dotted_name 'import' import_from_targets +// | "lazy" 'from' (('.' | '...'))+ 'import' import_from_targets +// | 'from' (('.' | '...'))* dotted_name 'import' import_from_targets +// | 'from' (('.' | '...'))+ 'import' import_from_targets static stmt_ty import_from_rule(Parser *p) { @@ -3676,33 +3714,33 @@ import_from_rule(Parser *p) UNUSED(_start_lineno); // Only used by EXTRA macro int _start_col_offset = p->tokens[_mark]->col_offset; UNUSED(_start_col_offset); // Only used by EXTRA macro - { // "lazy"? 'from' (('.' | '...'))* dotted_name 'import' import_from_targets + { // "lazy" 'from' (('.' | '...'))* dotted_name 'import' import_from_targets if (p->error_indicator) { p->level--; return NULL; } - D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); + D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); Token * _keyword; Token * _keyword_1; asdl_seq * a; expr_ty b; asdl_alias_seq* c; - void *lazy; + expr_ty lazy; if ( - (lazy = _PyPegen_expect_soft_keyword(p, "lazy"), !p->error_indicator) // "lazy"? + (lazy = _PyPegen_expect_soft_keyword(p, "lazy")) // soft_keyword='"lazy"' && - (_keyword = _PyPegen_expect_token(p, 646)) // token='from' + (_keyword = _PyPegen_expect_token(p, 651)) // token='from' && (a = _loop0_17_rule(p)) // (('.' | '...'))* && (b = dotted_name_rule(p)) // dotted_name && - (_keyword_1 = _PyPegen_expect_token(p, 647)) // token='import' + (_keyword_1 = _PyPegen_expect_token(p, 652)) // token='import' && (c = import_from_targets_rule(p)) // import_from_targets ) { - D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); + D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { p->level--; @@ -3712,7 +3750,7 @@ import_from_rule(Parser *p) UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _PyPegen_checked_future_import ( p , b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , lazy , EXTRA ); + _res = CHECK_VERSION ( stmt_ty , 15 , "Lazy imports are" , _PyPegen_checked_future_import ( p , b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , lazy , EXTRA ) ); if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) { p->error_indicator = 1; p->level--; @@ -3722,32 +3760,119 @@ import_from_rule(Parser *p) } p->mark = _mark; D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); } - { // "lazy"? 'from' (('.' | '...'))+ 'import' import_from_targets + { // "lazy" 'from' (('.' | '...'))+ 'import' import_from_targets if (p->error_indicator) { p->level--; return NULL; } - D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))+ 'import' import_from_targets")); - Token * _keyword; + D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))+ 'import' import_from_targets")); + expr_ty _keyword; Token * _keyword_1; + Token * _keyword_2; asdl_seq * a; asdl_alias_seq* b; - void *lazy; if ( - (lazy = _PyPegen_expect_soft_keyword(p, "lazy"), !p->error_indicator) // "lazy"? + (_keyword = _PyPegen_expect_soft_keyword(p, "lazy")) // soft_keyword='"lazy"' + && + (_keyword_1 = _PyPegen_expect_token(p, 651)) // token='from' + && + (a = _loop1_18_rule(p)) // (('.' | '...'))+ + && + (_keyword_2 = _PyPegen_expect_token(p, 652)) // token='import' && - (_keyword = _PyPegen_expect_token(p, 646)) // token='from' + (b = import_from_targets_rule(p)) // import_from_targets + ) + { + D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))+ 'import' import_from_targets")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + p->level--; + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = CHECK_VERSION ( stmt_ty , 15 , "Lazy imports are" , _PyAST_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , 1 , EXTRA ) ); + if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) { + p->error_indicator = 1; + p->level--; + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))+ 'import' import_from_targets")); + } + { // 'from' (('.' | '...'))* dotted_name 'import' import_from_targets + if (p->error_indicator) { + p->level--; + return NULL; + } + D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); + Token * _keyword; + Token * _keyword_1; + asdl_seq * a; + expr_ty b; + asdl_alias_seq* c; + if ( + (_keyword = _PyPegen_expect_token(p, 651)) // token='from' + && + (a = _loop0_17_rule(p)) // (('.' | '...'))* + && + (b = dotted_name_rule(p)) // dotted_name + && + (_keyword_1 = _PyPegen_expect_token(p, 652)) // token='import' + && + (c = import_from_targets_rule(p)) // import_from_targets + ) + { + D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + p->level--; + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyPegen_checked_future_import ( p , b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , 0 , EXTRA ); + if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) { + p->error_indicator = 1; + p->level--; + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); + } + { // 'from' (('.' | '...'))+ 'import' import_from_targets + if (p->error_indicator) { + p->level--; + return NULL; + } + D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets")); + Token * _keyword; + Token * _keyword_1; + asdl_seq * a; + asdl_alias_seq* b; + if ( + (_keyword = _PyPegen_expect_token(p, 651)) // token='from' && (a = _loop1_18_rule(p)) // (('.' | '...'))+ && - (_keyword_1 = _PyPegen_expect_token(p, 647)) // token='import' + (_keyword_1 = _PyPegen_expect_token(p, 652)) // token='import' && (b = import_from_targets_rule(p)) // import_from_targets ) { - D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))+ 'import' import_from_targets")); + D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { p->level--; @@ -3757,7 +3882,7 @@ import_from_rule(Parser *p) UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _PyAST_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , lazy ? 1 : 0 , EXTRA ); + _res = _PyAST_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , 0 , EXTRA ); if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) { p->error_indicator = 1; p->level--; @@ -3767,7 +3892,7 @@ import_from_rule(Parser *p) } p->mark = _mark; D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))+ 'import' import_from_targets")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets")); } _res = NULL; done: @@ -4529,7 +4654,7 @@ class_def_raw_rule(Parser *p) asdl_stmt_seq* c; void *t; if ( - (_keyword = _PyPegen_expect_token(p, 717)) // token='class' + (_keyword = _PyPegen_expect_token(p, 722)) // token='class' && (a = _PyPegen_name_token(p)) // NAME && @@ -4696,7 +4821,7 @@ function_def_raw_rule(Parser *p) void *t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 715)) // token='def' + (_keyword = _PyPegen_expect_token(p, 720)) // token='def' && (n = _PyPegen_name_token(p)) // NAME && @@ -4757,9 +4882,9 @@ function_def_raw_rule(Parser *p) void *t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 715)) // token='def' + (_keyword_1 = _PyPegen_expect_token(p, 720)) // token='def' && (n = _PyPegen_name_token(p)) // NAME && @@ -6097,7 +6222,7 @@ if_stmt_rule(Parser *p) asdl_stmt_seq* b; stmt_ty c; if ( - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (a = named_expression_rule(p)) // named_expression && @@ -6142,7 +6267,7 @@ if_stmt_rule(Parser *p) asdl_stmt_seq* b; void *c; if ( - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (a = named_expression_rule(p)) // named_expression && @@ -6237,7 +6362,7 @@ elif_stmt_rule(Parser *p) asdl_stmt_seq* b; stmt_ty c; if ( - (_keyword = _PyPegen_expect_token(p, 703)) // token='elif' + (_keyword = _PyPegen_expect_token(p, 708)) // token='elif' && (a = named_expression_rule(p)) // named_expression && @@ -6282,7 +6407,7 @@ elif_stmt_rule(Parser *p) asdl_stmt_seq* b; void *c; if ( - (_keyword = _PyPegen_expect_token(p, 703)) // token='elif' + (_keyword = _PyPegen_expect_token(p, 708)) // token='elif' && (a = named_expression_rule(p)) // named_expression && @@ -6363,7 +6488,7 @@ else_block_rule(Parser *p) Token * _literal; asdl_stmt_seq* b; if ( - (_keyword = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword = _PyPegen_expect_token(p, 707)) // token='else' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -6442,7 +6567,7 @@ while_stmt_rule(Parser *p) asdl_stmt_seq* b; void *c; if ( - (_keyword = _PyPegen_expect_token(p, 705)) // token='while' + (_keyword = _PyPegen_expect_token(p, 710)) // token='while' && (a = named_expression_rule(p)) // named_expression && @@ -6542,11 +6667,11 @@ for_stmt_rule(Parser *p) expr_ty t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword = _PyPegen_expect_token(p, 715)) // token='for' && (t = star_targets_rule(p)) // star_targets && - (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 716)) // token='in' && (_cut_var = 1) && @@ -6604,13 +6729,13 @@ for_stmt_rule(Parser *p) expr_ty t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword_1 = _PyPegen_expect_token(p, 715)) // token='for' && (t = star_targets_rule(p)) // star_targets && - (_keyword_2 = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword_2 = _PyPegen_expect_token(p, 716)) // token='in' && (_cut_var = 1) && @@ -6739,7 +6864,7 @@ with_stmt_rule(Parser *p) asdl_stmt_seq* b; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword = _PyPegen_expect_token(p, 668)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -6790,7 +6915,7 @@ with_stmt_rule(Parser *p) asdl_stmt_seq* b; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword = _PyPegen_expect_token(p, 668)) // token='with' && (a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+ && @@ -6839,9 +6964,9 @@ with_stmt_rule(Parser *p) asdl_withitem_seq* a; asdl_stmt_seq* b; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword_1 = _PyPegen_expect_token(p, 668)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -6891,9 +7016,9 @@ with_stmt_rule(Parser *p) asdl_stmt_seq* b; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword_1 = _PyPegen_expect_token(p, 668)) // token='with' && (a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+ && @@ -6979,7 +7104,7 @@ with_item_rule(Parser *p) if ( (e = expression_rule(p)) // expression && - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && (t = star_target_rule(p)) // star_target && @@ -7104,7 +7229,7 @@ try_stmt_rule(Parser *p) asdl_stmt_seq* b; asdl_stmt_seq* f; if ( - (_keyword = _PyPegen_expect_token(p, 672)) // token='try' + (_keyword = _PyPegen_expect_token(p, 677)) // token='try' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -7148,7 +7273,7 @@ try_stmt_rule(Parser *p) asdl_excepthandler_seq* ex; void *f; if ( - (_keyword = _PyPegen_expect_token(p, 672)) // token='try' + (_keyword = _PyPegen_expect_token(p, 677)) // token='try' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -7196,7 +7321,7 @@ try_stmt_rule(Parser *p) asdl_excepthandler_seq* ex; void *f; if ( - (_keyword = _PyPegen_expect_token(p, 672)) // token='try' + (_keyword = _PyPegen_expect_token(p, 677)) // token='try' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -7295,7 +7420,7 @@ except_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (e = expression_rule(p)) // expression && @@ -7339,11 +7464,11 @@ except_block_rule(Parser *p) expr_ty e; expr_ty t; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (e = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 701)) // token='as' && (t = _PyPegen_name_token(p)) // NAME && @@ -7385,7 +7510,7 @@ except_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (e = expressions_rule(p)) // expressions && @@ -7426,7 +7551,7 @@ except_block_rule(Parser *p) Token * _literal; asdl_stmt_seq* b; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -7538,7 +7663,7 @@ except_star_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -7585,13 +7710,13 @@ except_star_block_rule(Parser *p) expr_ty e; expr_ty t; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && (e = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 701)) // token='as' && (t = _PyPegen_name_token(p)) // NAME && @@ -7634,7 +7759,7 @@ except_star_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -7734,7 +7859,7 @@ finally_block_rule(Parser *p) Token * _literal; asdl_stmt_seq* a; if ( - (_keyword = _PyPegen_expect_token(p, 689)) // token='finally' + (_keyword = _PyPegen_expect_token(p, 694)) // token='finally' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -8042,7 +8167,7 @@ guard_rule(Parser *p) Token * _keyword; expr_ty guard; if ( - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (guard = named_expression_rule(p)) // named_expression ) @@ -8237,7 +8362,7 @@ as_pattern_rule(Parser *p) if ( (pattern = or_pattern_rule(p)) // or_pattern && - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && (target = pattern_capture_target_rule(p)) // pattern_capture_target ) @@ -8671,7 +8796,7 @@ literal_pattern_rule(Parser *p) D(fprintf(stderr, "%*c> literal_pattern[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 628)) // token='None' + (_keyword = _PyPegen_expect_token(p, 633)) // token='None' ) { D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'")); @@ -8704,7 +8829,7 @@ literal_pattern_rule(Parser *p) D(fprintf(stderr, "%*c> literal_pattern[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 627)) // token='True' + (_keyword = _PyPegen_expect_token(p, 632)) // token='True' ) { D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'")); @@ -8737,7 +8862,7 @@ literal_pattern_rule(Parser *p) D(fprintf(stderr, "%*c> literal_pattern[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 629)) // token='False' + (_keyword = _PyPegen_expect_token(p, 634)) // token='False' ) { D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'")); @@ -8865,7 +8990,7 @@ literal_expr_rule(Parser *p) D(fprintf(stderr, "%*c> literal_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 628)) // token='None' + (_keyword = _PyPegen_expect_token(p, 633)) // token='None' ) { D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'")); @@ -8898,7 +9023,7 @@ literal_expr_rule(Parser *p) D(fprintf(stderr, "%*c> literal_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 627)) // token='True' + (_keyword = _PyPegen_expect_token(p, 632)) // token='True' ) { D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'")); @@ -8931,7 +9056,7 @@ literal_expr_rule(Parser *p) D(fprintf(stderr, "%*c> literal_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 629)) // token='False' + (_keyword = _PyPegen_expect_token(p, 634)) // token='False' ) { D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'")); @@ -11732,11 +11857,11 @@ if_expression_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='else' && (c = expression_rule(p)) // expression ) @@ -11801,9 +11926,9 @@ yield_expr_rule(Parser *p) Token * _keyword_1; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 588)) // token='yield' + (_keyword = _PyPegen_expect_token(p, 593)) // token='yield' && - (_keyword_1 = _PyPegen_expect_token(p, 646)) // token='from' + (_keyword_1 = _PyPegen_expect_token(p, 651)) // token='from' && (a = expression_rule(p)) // expression ) @@ -11839,7 +11964,7 @@ yield_expr_rule(Parser *p) Token * _keyword; void *a; if ( - (_keyword = _PyPegen_expect_token(p, 588)) // token='yield' + (_keyword = _PyPegen_expect_token(p, 593)) // token='yield' && (a = star_expressions_rule(p), !p->error_indicator) // star_expressions? ) @@ -12685,7 +12810,7 @@ inversion_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 719)) // token='not' + (_keyword = _PyPegen_expect_token(p, 724)) // token='not' && (a = inversion_rule(p)) // inversion ) @@ -13339,9 +13464,9 @@ notin_bitwise_or_rule(Parser *p) Token * _keyword_1; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 719)) // token='not' + (_keyword = _PyPegen_expect_token(p, 724)) // token='not' && - (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 716)) // token='in' && (a = bitwise_or_rule(p)) // bitwise_or ) @@ -13387,7 +13512,7 @@ in_bitwise_or_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword = _PyPegen_expect_token(p, 716)) // token='in' && (a = bitwise_or_rule(p)) // bitwise_or ) @@ -13434,9 +13559,9 @@ isnot_bitwise_or_rule(Parser *p) Token * _keyword_1; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 597)) // token='is' + (_keyword = _PyPegen_expect_token(p, 602)) // token='is' && - (_keyword_1 = _PyPegen_expect_token(p, 719)) // token='not' + (_keyword_1 = _PyPegen_expect_token(p, 724)) // token='not' && (a = bitwise_or_rule(p)) // bitwise_or ) @@ -13482,7 +13607,7 @@ is_bitwise_or_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 597)) // token='is' + (_keyword = _PyPegen_expect_token(p, 602)) // token='is' && (a = bitwise_or_rule(p)) // bitwise_or ) @@ -14836,7 +14961,7 @@ await_primary_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 598)) // token='await' + (_keyword = _PyPegen_expect_token(p, 603)) // token='await' && (a = primary_rule(p)) // primary ) @@ -15380,7 +15505,7 @@ atom_rule(Parser *p) D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 627)) // token='True' + (_keyword = _PyPegen_expect_token(p, 632)) // token='True' ) { D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'")); @@ -15413,7 +15538,7 @@ atom_rule(Parser *p) D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 629)) // token='False' + (_keyword = _PyPegen_expect_token(p, 634)) // token='False' ) { D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'")); @@ -15446,7 +15571,7 @@ atom_rule(Parser *p) D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 628)) // token='None' + (_keyword = _PyPegen_expect_token(p, 633)) // token='None' ) { D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'")); @@ -15714,7 +15839,7 @@ lambdef_rule(Parser *p) void *a; expr_ty b; if ( - (_keyword = _PyPegen_expect_token(p, 622)) // token='lambda' + (_keyword = _PyPegen_expect_token(p, 627)) // token='lambda' && (a = lambda_params_rule(p), !p->error_indicator) // lambda_params? && @@ -18133,13 +18258,13 @@ for_if_clause_rule(Parser *p) expr_ty b; asdl_expr_seq* c; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword_1 = _PyPegen_expect_token(p, 715)) // token='for' && (a = star_targets_rule(p)) // star_targets && - (_keyword_2 = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword_2 = _PyPegen_expect_token(p, 716)) // token='in' && (_cut_var = 1) && @@ -18178,11 +18303,11 @@ for_if_clause_rule(Parser *p) expr_ty b; asdl_expr_seq* c; if ( - (_keyword = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword = _PyPegen_expect_token(p, 715)) // token='for' && (a = star_targets_rule(p)) // star_targets && - (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 716)) // token='in' && (_cut_var = 1) && @@ -21509,11 +21634,11 @@ expression_without_invalid_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='else' && (c = expression_rule(p)) // expression ) @@ -21813,7 +21938,7 @@ invalid_expression_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (b = disjunction_rule(p)) // disjunction && @@ -21846,11 +21971,11 @@ invalid_expression_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='else' && _PyPegen_lookahead_for_expr(0, expression_rule, p) ) @@ -21882,11 +22007,11 @@ invalid_expression_rule(Parser *p) if ( (a = (stmt_ty)_tmp_118_rule(p)) // pass_stmt | break_stmt | continue_stmt && - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='else' && (c = simple_stmt_rule(p)) // simple_stmt ) @@ -21915,7 +22040,7 @@ invalid_expression_rule(Parser *p) Token * a; Token * b; if ( - (a = _PyPegen_expect_token(p, 622)) // token='lambda' + (a = _PyPegen_expect_token(p, 627)) // token='lambda' && (_opt_var = lambda_params_rule(p), !p->error_indicator) // lambda_params? && @@ -21948,7 +22073,7 @@ invalid_expression_rule(Parser *p) Token * a; Token * b; if ( - (a = _PyPegen_expect_token(p, 622)) // token='lambda' + (a = _PyPegen_expect_token(p, 627)) // token='lambda' && (_opt_var = lambda_params_rule(p), !p->error_indicator) // lambda_params? && @@ -22005,11 +22130,11 @@ invalid_if_expression_rule(Parser *p) if ( (disjunction_var = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='else' && (a = _PyPegen_expect_token(p, 16)) // token='*' ) @@ -22041,11 +22166,11 @@ invalid_if_expression_rule(Parser *p) if ( (disjunction_var = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='else' && (a = _PyPegen_expect_token(p, 35)) // token='**' ) @@ -22512,9 +22637,9 @@ invalid_raise_stmt_rule(Parser *p) Token * a; Token * b; if ( - (a = _PyPegen_expect_token(p, 632)) // token='raise' + (a = _PyPegen_expect_token(p, 637)) // token='raise' && - (b = _PyPegen_expect_token(p, 646)) // token='from' + (b = _PyPegen_expect_token(p, 651)) // token='from' ) { D(fprintf(stderr, "%*c+ invalid_raise_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' 'from'")); @@ -22540,11 +22665,11 @@ invalid_raise_stmt_rule(Parser *p) Token * a; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 632)) // token='raise' + (_keyword = _PyPegen_expect_token(p, 637)) // token='raise' && (expression_var = expression_rule(p)) // expression && - (a = _PyPegen_expect_token(p, 646)) // token='from' + (a = _PyPegen_expect_token(p, 651)) // token='from' ) { D(fprintf(stderr, "%*c+ invalid_raise_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' expression 'from'")); @@ -22588,7 +22713,7 @@ invalid_del_stmt_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 634)) // token='del' + (_keyword = _PyPegen_expect_token(p, 639)) // token='del' && (a = star_expressions_rule(p)) // star_expressions ) @@ -22640,7 +22765,7 @@ invalid_assert_stmt_rule(Parser *p) expr_ty a; expr_ty b; if ( - (_keyword = _PyPegen_expect_token(p, 638)) // token='assert' + (_keyword = _PyPegen_expect_token(p, 643)) // token='assert' && (a = expression_rule(p)) // expression && @@ -22675,7 +22800,7 @@ invalid_assert_stmt_rule(Parser *p) expr_ty b; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 638)) // token='assert' + (_keyword = _PyPegen_expect_token(p, 643)) // token='assert' && (expression_var = expression_rule(p)) // expression && @@ -22712,7 +22837,7 @@ invalid_assert_stmt_rule(Parser *p) expr_ty a; expr_ty b; if ( - (_keyword = _PyPegen_expect_token(p, 638)) // token='assert' + (_keyword = _PyPegen_expect_token(p, 643)) // token='assert' && (a = expression_rule(p)) // expression && @@ -22747,7 +22872,7 @@ invalid_assert_stmt_rule(Parser *p) expr_ty b; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 638)) // token='assert' + (_keyword = _PyPegen_expect_token(p, 643)) // token='assert' && (expression_var = expression_rule(p)) // expression && @@ -24173,7 +24298,7 @@ invalid_with_item_rule(Parser *p) if ( (expression_var = expression_rule(p)) // expression && - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && (a = expression_rule(p)) // expression && @@ -24223,13 +24348,13 @@ invalid_for_if_clause_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings void *_tmp_136_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword = _PyPegen_expect_token(p, 715)) // token='for' && (_tmp_136_var = _tmp_136_rule(p)) // bitwise_or ((',' bitwise_or))* ','? && - _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 711) // token='in' + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 716) // token='in' ) { D(fprintf(stderr, "%*c+ invalid_for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'? 'for' (bitwise_or ((',' bitwise_or))* ','?) !'in'")); @@ -24275,9 +24400,9 @@ invalid_for_target_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings expr_ty a; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword = _PyPegen_expect_token(p, 715)) // token='for' && (a = star_expressions_rule(p)) // star_expressions ) @@ -24407,11 +24532,11 @@ invalid_import_rule(Parser *p) Token * a; expr_ty dotted_name_var; if ( - (a = _PyPegen_expect_token(p, 647)) // token='import' + (a = _PyPegen_expect_token(p, 652)) // token='import' && (_gather_138_var = _gather_138_rule(p)) // ','.dotted_name+ && - (_keyword = _PyPegen_expect_token(p, 646)) // token='from' + (_keyword = _PyPegen_expect_token(p, 651)) // token='from' && (dotted_name_var = dotted_name_rule(p)) // dotted_name ) @@ -24438,7 +24563,7 @@ invalid_import_rule(Parser *p) Token * _keyword; Token * token; if ( - (_keyword = _PyPegen_expect_token(p, 647)) // token='import' + (_keyword = _PyPegen_expect_token(p, 652)) // token='import' && (token = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) @@ -24487,7 +24612,7 @@ invalid_dotted_as_name_rule(Parser *p) if ( (dotted_name_var = dotted_name_rule(p)) // dotted_name && - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && _PyPegen_lookahead(0, _tmp_139_rule, p) && @@ -24538,7 +24663,7 @@ invalid_import_from_as_name_rule(Parser *p) if ( (name_var = _PyPegen_name_token(p)) // NAME && - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && _PyPegen_lookahead(0, _tmp_139_rule, p) && @@ -24666,9 +24791,9 @@ invalid_with_stmt_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings Token * trailing; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword = _PyPegen_expect_token(p, 668)) // token='with' && (_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as' star_target])+ && @@ -24702,9 +24827,9 @@ invalid_with_stmt_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword = _PyPegen_expect_token(p, 668)) // token='with' && (_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as' star_target])+ && @@ -24740,9 +24865,9 @@ invalid_with_stmt_rule(Parser *p) UNUSED(_opt_var_1); // Silence compiler warnings Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword = _PyPegen_expect_token(p, 668)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -24802,9 +24927,9 @@ invalid_with_stmt_indent_rule(Parser *p) Token * a; Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 663)) // token='with' + (a = _PyPegen_expect_token(p, 668)) // token='with' && (_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as' star_target])+ && @@ -24845,9 +24970,9 @@ invalid_with_stmt_indent_rule(Parser *p) Token * a; Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 663)) // token='with' + (a = _PyPegen_expect_token(p, 668)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -24910,7 +25035,7 @@ invalid_try_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 672)) // token='try' + (a = _PyPegen_expect_token(p, 677)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -24942,7 +25067,7 @@ invalid_try_stmt_rule(Parser *p) Token * _literal; asdl_stmt_seq* block_var; if ( - (_keyword = _PyPegen_expect_token(p, 672)) // token='try' + (_keyword = _PyPegen_expect_token(p, 677)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -24981,7 +25106,7 @@ invalid_try_stmt_rule(Parser *p) Token * b; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 672)) // token='try' + (_keyword = _PyPegen_expect_token(p, 677)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -24989,7 +25114,7 @@ invalid_try_stmt_rule(Parser *p) && (_loop1_36_var = _loop1_36_rule(p)) // except_block+ && - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (b = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25028,7 +25153,7 @@ invalid_try_stmt_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings Token * a; if ( - (_keyword = _PyPegen_expect_token(p, 672)) // token='try' + (_keyword = _PyPegen_expect_token(p, 677)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -25036,7 +25161,7 @@ invalid_try_stmt_rule(Parser *p) && (_loop1_37_var = _loop1_37_rule(p)) // except_star_block+ && - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (_opt_var = _tmp_146_rule(p), !p->error_indicator) // [expression ['as' NAME]] && @@ -25093,7 +25218,7 @@ invalid_except_stmt_rule(Parser *p) expr_ty expressions_var; expr_ty name_var; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (a = expression_rule(p)) // expression && @@ -25101,7 +25226,7 @@ invalid_except_stmt_rule(Parser *p) && (expressions_var = expressions_rule(p)) // expressions && - (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 701)) // token='as' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -25133,7 +25258,7 @@ invalid_except_stmt_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (expression_var = expression_rule(p)) // expression && @@ -25164,7 +25289,7 @@ invalid_except_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) @@ -25195,11 +25320,11 @@ invalid_except_stmt_rule(Parser *p) asdl_stmt_seq* block_var; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (expression_var = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 701)) // token='as' && (a = expression_rule(p)) // expression && @@ -25259,7 +25384,7 @@ invalid_except_star_stmt_rule(Parser *p) expr_ty expressions_var; expr_ty name_var; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25269,7 +25394,7 @@ invalid_except_star_stmt_rule(Parser *p) && (expressions_var = expressions_rule(p)) // expressions && - (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 701)) // token='as' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -25302,7 +25427,7 @@ invalid_except_star_stmt_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25336,7 +25461,7 @@ invalid_except_star_stmt_rule(Parser *p) void *_tmp_147_var; Token * a; if ( - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25370,13 +25495,13 @@ invalid_except_star_stmt_rule(Parser *p) asdl_stmt_seq* block_var; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && (expression_var = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 701)) // token='as' && (a = expression_rule(p)) // expression && @@ -25427,7 +25552,7 @@ invalid_finally_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 689)) // token='finally' + (a = _PyPegen_expect_token(p, 694)) // token='finally' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -25483,7 +25608,7 @@ invalid_except_stmt_indent_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (expression_var = expression_rule(p)) // expression && @@ -25519,7 +25644,7 @@ invalid_except_stmt_indent_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -25575,7 +25700,7 @@ invalid_except_star_stmt_indent_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 693)) // token='except' + (a = _PyPegen_expect_token(p, 698)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25852,7 +25977,7 @@ invalid_as_pattern_rule(Parser *p) if ( (or_pattern_var = or_pattern_rule(p)) // or_pattern && - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && (a = _PyPegen_expect_soft_keyword(p, "_")) // soft_keyword='"_"' ) @@ -25882,7 +26007,7 @@ invalid_as_pattern_rule(Parser *p) if ( (or_pattern_var = or_pattern_rule(p)) // or_pattern && - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && (a = expression_rule(p)) // expression ) @@ -26098,7 +26223,7 @@ invalid_if_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26129,7 +26254,7 @@ invalid_if_stmt_rule(Parser *p) expr_ty a_1; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 698)) // token='if' + (a = _PyPegen_expect_token(p, 703)) // token='if' && (a_1 = named_expression_rule(p)) // named_expression && @@ -26184,7 +26309,7 @@ invalid_elif_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 703)) // token='elif' + (_keyword = _PyPegen_expect_token(p, 708)) // token='elif' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26215,7 +26340,7 @@ invalid_elif_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 703)) // token='elif' + (a = _PyPegen_expect_token(p, 708)) // token='elif' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26268,7 +26393,7 @@ invalid_else_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 702)) // token='else' + (a = _PyPegen_expect_token(p, 707)) // token='else' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -26301,13 +26426,13 @@ invalid_else_stmt_rule(Parser *p) Token * _literal; asdl_stmt_seq* block_var; if ( - (_keyword = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword = _PyPegen_expect_token(p, 707)) // token='else' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && (block_var = block_rule(p)) // block && - (_keyword_1 = _PyPegen_expect_token(p, 703)) // token='elif' + (_keyword_1 = _PyPegen_expect_token(p, 708)) // token='elif' ) { D(fprintf(stderr, "%*c+ invalid_else_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else' ':' block 'elif'")); @@ -26354,7 +26479,7 @@ invalid_while_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 705)) // token='while' + (_keyword = _PyPegen_expect_token(p, 710)) // token='while' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26385,7 +26510,7 @@ invalid_while_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 705)) // token='while' + (a = _PyPegen_expect_token(p, 710)) // token='while' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26444,13 +26569,13 @@ invalid_for_stmt_rule(Parser *p) expr_ty star_expressions_var; expr_ty star_targets_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword = _PyPegen_expect_token(p, 715)) // token='for' && (star_targets_var = star_targets_rule(p)) // star_targets && - (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 716)) // token='in' && (star_expressions_var = star_expressions_rule(p)) // star_expressions && @@ -26485,13 +26610,13 @@ invalid_for_stmt_rule(Parser *p) expr_ty star_expressions_var; expr_ty star_targets_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 710)) // token='for' + (a = _PyPegen_expect_token(p, 715)) // token='for' && (star_targets_var = star_targets_rule(p)) // star_targets && - (_keyword = _PyPegen_expect_token(p, 711)) // token='in' + (_keyword = _PyPegen_expect_token(p, 716)) // token='in' && (star_expressions_var = star_expressions_rule(p)) // star_expressions && @@ -26557,9 +26682,9 @@ invalid_def_raw_rule(Parser *p) expr_ty name_var; Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 715)) // token='def' + (a = _PyPegen_expect_token(p, 720)) // token='def' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -26616,9 +26741,9 @@ invalid_def_raw_rule(Parser *p) asdl_stmt_seq* block_var; expr_ty name_var; if ( - (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 719), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 715)) // token='def' + (_keyword = _PyPegen_expect_token(p, 720)) // token='def' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -26682,7 +26807,7 @@ invalid_class_def_raw_rule(Parser *p) expr_ty name_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 717)) // token='class' + (_keyword = _PyPegen_expect_token(p, 722)) // token='class' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -26721,7 +26846,7 @@ invalid_class_def_raw_rule(Parser *p) expr_ty name_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 717)) // token='class' + (a = _PyPegen_expect_token(p, 722)) // token='class' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -28357,7 +28482,7 @@ invalid_arithmetic_rule(Parser *p) && (_tmp_157_var = _tmp_157_rule(p)) // '+' | '-' | '*' | '/' | '%' | '//' | '@' && - (a = _PyPegen_expect_token(p, 719)) // token='not' + (a = _PyPegen_expect_token(p, 724)) // token='not' && (b = inversion_rule(p)) // inversion ) @@ -28406,7 +28531,7 @@ invalid_factor_rule(Parser *p) if ( (_tmp_158_var = _tmp_158_rule(p)) // '+' | '-' | '~' && - (a = _PyPegen_expect_token(p, 719)) // token='not' + (a = _PyPegen_expect_token(p, 724)) // token='not' && (b = factor_rule(p)) // factor ) @@ -28853,7 +28978,7 @@ _tmp_5_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_5[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'import'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 647)) // token='import' + (_keyword = _PyPegen_expect_token(p, 652)) // token='import' ) { D(fprintf(stderr, "%*c+ _tmp_5[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'import'")); @@ -28872,7 +28997,7 @@ _tmp_5_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_5[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 646)) // token='from' + (_keyword = _PyPegen_expect_token(p, 651)) // token='from' ) { D(fprintf(stderr, "%*c+ _tmp_5[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from'")); @@ -28929,7 +29054,7 @@ _tmp_6_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_6[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'def'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 715)) // token='def' + (_keyword = _PyPegen_expect_token(p, 720)) // token='def' ) { D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'def'")); @@ -28967,7 +29092,7 @@ _tmp_6_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_6[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'async'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' ) { D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'")); @@ -29005,7 +29130,7 @@ _tmp_7_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_7[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'class'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 717)) // token='class' + (_keyword = _PyPegen_expect_token(p, 722)) // token='class' ) { D(fprintf(stderr, "%*c+ _tmp_7[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'class'")); @@ -29062,7 +29187,7 @@ _tmp_8_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_8[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 663)) // token='with' + (_keyword = _PyPegen_expect_token(p, 668)) // token='with' ) { D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with'")); @@ -29081,7 +29206,7 @@ _tmp_8_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_8[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'async'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' ) { D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'")); @@ -29119,7 +29244,7 @@ _tmp_9_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_9[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'for'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 710)) // token='for' + (_keyword = _PyPegen_expect_token(p, 715)) // token='for' ) { D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for'")); @@ -29138,7 +29263,7 @@ _tmp_9_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_9[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'async'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='async' + (_keyword = _PyPegen_expect_token(p, 719)) // token='async' ) { D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'")); @@ -29839,7 +29964,7 @@ _tmp_21_rule(Parser *p) Token * _keyword; expr_ty z; if ( - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && (z = _PyPegen_name_token(p)) // NAME ) @@ -35562,7 +35687,7 @@ _tmp_113_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_113[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 627)) // token='True' + (_keyword = _PyPegen_expect_token(p, 632)) // token='True' ) { D(fprintf(stderr, "%*c+ _tmp_113[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'")); @@ -35581,7 +35706,7 @@ _tmp_113_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_113[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 629)) // token='False' + (_keyword = _PyPegen_expect_token(p, 634)) // token='False' ) { D(fprintf(stderr, "%*c+ _tmp_113[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'")); @@ -35600,7 +35725,7 @@ _tmp_113_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_113[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 628)) // token='None' + (_keyword = _PyPegen_expect_token(p, 633)) // token='None' ) { D(fprintf(stderr, "%*c+ _tmp_113[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'")); @@ -35811,7 +35936,7 @@ _tmp_117_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_117[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'else'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 702)) // token='else' + (_keyword = _PyPegen_expect_token(p, 707)) // token='else' ) { D(fprintf(stderr, "%*c+ _tmp_117[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else'")); @@ -36058,7 +36183,7 @@ _tmp_120_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_120[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 627)) // token='True' + (_keyword = _PyPegen_expect_token(p, 632)) // token='True' ) { D(fprintf(stderr, "%*c+ _tmp_120[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'")); @@ -36077,7 +36202,7 @@ _tmp_120_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_120[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 628)) // token='None' + (_keyword = _PyPegen_expect_token(p, 633)) // token='None' ) { D(fprintf(stderr, "%*c+ _tmp_120[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'")); @@ -36096,7 +36221,7 @@ _tmp_120_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_120[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 629)) // token='False' + (_keyword = _PyPegen_expect_token(p, 634)) // token='False' ) { D(fprintf(stderr, "%*c+ _tmp_120[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'")); @@ -37474,7 +37599,7 @@ _tmp_144_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='except' + (_keyword = _PyPegen_expect_token(p, 698)) // token='except' ) { D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except'")); @@ -37493,7 +37618,7 @@ _tmp_144_rule(Parser *p) D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'finally'")); Token * _keyword; if ( - (_keyword = _PyPegen_expect_token(p, 689)) // token='finally' + (_keyword = _PyPegen_expect_token(p, 694)) // token='finally' ) { D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'finally'")); @@ -38646,7 +38771,7 @@ _tmp_163_rule(Parser *p) Token * _keyword; expr_ty c; if ( - (_keyword = _PyPegen_expect_token(p, 589)) // token='or' + (_keyword = _PyPegen_expect_token(p, 594)) // token='or' && (c = conjunction_rule(p)) // conjunction ) @@ -38692,7 +38817,7 @@ _tmp_164_rule(Parser *p) Token * _keyword; expr_ty c; if ( - (_keyword = _PyPegen_expect_token(p, 590)) // token='and' + (_keyword = _PyPegen_expect_token(p, 595)) // token='and' && (c = inversion_rule(p)) // inversion ) @@ -38795,7 +38920,7 @@ _tmp_166_rule(Parser *p) Token * _keyword; expr_ty z; if ( - (_keyword = _PyPegen_expect_token(p, 698)) // token='if' + (_keyword = _PyPegen_expect_token(p, 703)) // token='if' && (z = disjunction_rule(p)) // disjunction ) @@ -39531,7 +39656,7 @@ _tmp_180_rule(Parser *p) Token * _keyword; expr_ty star_target_var; if ( - (_keyword = _PyPegen_expect_token(p, 696)) // token='as' + (_keyword = _PyPegen_expect_token(p, 701)) // token='as' && (star_target_var = star_target_rule(p)) // star_target )