https://github.com/python/cpython/commit/09e8c382312b145b710dca7072ff2e13fe8c09ab commit: 09e8c382312b145b710dca7072ff2e13fe8c09ab branch: main author: Pablo Galindo Salgado <[email protected]> committer: pablogsal <[email protected]> date: 2026-02-28T02:24:06Z summary:
gh-145241: specialize SyntaxError for single trailing-comma with item (#145282) Co-authored-by: Bartosz Sławecki <[email protected]> files: A Misc/NEWS.d/next/Core_and_Builtins/2026-02-26-18-00-00.gh-issue-145241.hL2k9Q.rst M Grammar/python.gram M Lib/test/test_syntax.py M Parser/parser.c diff --git a/Grammar/python.gram b/Grammar/python.gram index 1212e8640a1a9c..3a91d426c36501 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -1447,6 +1447,8 @@ invalid_import_from_targets: RAISE_SYNTAX_ERROR_STARTING_FROM(token, "Expected one or more names after 'import'") } invalid_with_stmt: + | ['async'] 'with' ','.(expression ['as' star_target])+ trailing=',' ':' { + RAISE_SYNTAX_ERROR_KNOWN_LOCATION(trailing, "the last 'with' item has a trailing comma") } | ['async'] 'with' ','.(expression ['as' star_target])+ NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") } | ['async'] 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") } invalid_with_stmt_indent: diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index e48749626fccad..a3d485c998ac91 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -2061,6 +2061,30 @@ Traceback (most recent call last): SyntaxError: trailing comma not allowed without surrounding parentheses +>>> with item,: pass +Traceback (most recent call last): +SyntaxError: the last 'with' item has a trailing comma + +>>> with item as x,: pass +Traceback (most recent call last): +SyntaxError: the last 'with' item has a trailing comma + +>>> with item1, item2,: pass +Traceback (most recent call last): +SyntaxError: the last 'with' item has a trailing comma + +>>> with item1 as x, item2,: pass +Traceback (most recent call last): +SyntaxError: the last 'with' item has a trailing comma + +>>> with item1 as x, item2 as y,: pass +Traceback (most recent call last): +SyntaxError: the last 'with' item has a trailing comma + +>>> with item1, item2 as y,: pass +Traceback (most recent call last): +SyntaxError: the last 'with' item has a trailing comma + >>> import a from b Traceback (most recent call last): SyntaxError: Did you mean to use 'from ... import ...' instead? diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-26-18-00-00.gh-issue-145241.hL2k9Q.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-26-18-00-00.gh-issue-145241.hL2k9Q.rst new file mode 100644 index 00000000000000..a3253132a577ba --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-26-18-00-00.gh-issue-145241.hL2k9Q.rst @@ -0,0 +1,3 @@ +Specialized the parser error for when ``with`` items are followed +by a trailing comma (for example, ``with item,:``), raising a clearer +:exc:`SyntaxError` message. Patch by Pablo Galindo and Bartosz Sławecki. diff --git a/Parser/parser.c b/Parser/parser.c index 37c19c4c9020c8..f8d6d1ce89b54d 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -22,28 +22,28 @@ static KeywordToken *reserved_keywords[] = { (KeywordToken[]) {{NULL, -1}}, (KeywordToken[]) {{NULL, -1}}, (KeywordToken[]) { - {"if", 695}, - {"as", 693}, - {"in", 708}, + {"if", 698}, + {"as", 696}, + {"in", 711}, {"or", 589}, {"is", 597}, {NULL, -1}, }, (KeywordToken[]) { {"del", 634}, - {"def", 712}, - {"for", 707}, - {"try", 669}, + {"def", 715}, + {"for", 710}, + {"try", 672}, {"and", 590}, - {"not", 716}, + {"not", 719}, {NULL, -1}, }, (KeywordToken[]) { {"from", 646}, {"pass", 527}, - {"with", 660}, - {"elif", 700}, - {"else", 699}, + {"with", 663}, + {"elif", 703}, + {"else", 702}, {"None", 628}, {"True", 627}, {NULL, -1}, @@ -52,9 +52,9 @@ static KeywordToken *reserved_keywords[] = { {"raise", 632}, {"yield", 588}, {"break", 528}, - {"async", 711}, - {"class", 714}, - {"while", 702}, + {"async", 714}, + {"class", 717}, + {"while", 705}, {"False", 629}, {"await", 598}, {NULL, -1}, @@ -64,12 +64,12 @@ static KeywordToken *reserved_keywords[] = { {"return", 522}, {"assert", 638}, {"global", 530}, - {"except", 690}, + {"except", 693}, {"lambda", 622}, {NULL, -1}, }, (KeywordToken[]) { - {"finally", 686}, + {"finally", 689}, {NULL, -1}, }, (KeywordToken[]) { @@ -1964,7 +1964,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, 695) // token='if' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 698) // token='if' && (if_stmt_var = if_stmt_rule(p)) // if_stmt ) @@ -2048,7 +2048,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, 669) // token='try' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 672) // token='try' && (try_stmt_var = try_stmt_rule(p)) // try_stmt ) @@ -2069,7 +2069,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, 702) // token='while' + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 705) // token='while' && (while_stmt_var = while_stmt_rule(p)) // while_stmt ) @@ -4525,7 +4525,7 @@ class_def_raw_rule(Parser *p) asdl_stmt_seq* c; void *t; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='class' + (_keyword = _PyPegen_expect_token(p, 717)) // token='class' && (a = _PyPegen_name_token(p)) // NAME && @@ -4692,7 +4692,7 @@ function_def_raw_rule(Parser *p) void *t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 712)) // token='def' + (_keyword = _PyPegen_expect_token(p, 715)) // token='def' && (n = _PyPegen_name_token(p)) // NAME && @@ -4753,9 +4753,9 @@ function_def_raw_rule(Parser *p) void *t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 712)) // token='def' + (_keyword_1 = _PyPegen_expect_token(p, 715)) // token='def' && (n = _PyPegen_name_token(p)) // NAME && @@ -6093,7 +6093,7 @@ if_stmt_rule(Parser *p) asdl_stmt_seq* b; stmt_ty c; if ( - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (a = named_expression_rule(p)) // named_expression && @@ -6138,7 +6138,7 @@ if_stmt_rule(Parser *p) asdl_stmt_seq* b; void *c; if ( - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (a = named_expression_rule(p)) // named_expression && @@ -6233,7 +6233,7 @@ elif_stmt_rule(Parser *p) asdl_stmt_seq* b; stmt_ty c; if ( - (_keyword = _PyPegen_expect_token(p, 700)) // token='elif' + (_keyword = _PyPegen_expect_token(p, 703)) // token='elif' && (a = named_expression_rule(p)) // named_expression && @@ -6278,7 +6278,7 @@ elif_stmt_rule(Parser *p) asdl_stmt_seq* b; void *c; if ( - (_keyword = _PyPegen_expect_token(p, 700)) // token='elif' + (_keyword = _PyPegen_expect_token(p, 703)) // token='elif' && (a = named_expression_rule(p)) // named_expression && @@ -6359,7 +6359,7 @@ else_block_rule(Parser *p) Token * _literal; asdl_stmt_seq* b; if ( - (_keyword = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword = _PyPegen_expect_token(p, 702)) // token='else' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -6438,7 +6438,7 @@ while_stmt_rule(Parser *p) asdl_stmt_seq* b; void *c; if ( - (_keyword = _PyPegen_expect_token(p, 702)) // token='while' + (_keyword = _PyPegen_expect_token(p, 705)) // token='while' && (a = named_expression_rule(p)) // named_expression && @@ -6538,11 +6538,11 @@ for_stmt_rule(Parser *p) expr_ty t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 707)) // token='for' + (_keyword = _PyPegen_expect_token(p, 710)) // token='for' && (t = star_targets_rule(p)) // star_targets && - (_keyword_1 = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' && (_cut_var = 1) && @@ -6600,13 +6600,13 @@ for_stmt_rule(Parser *p) expr_ty t; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='for' + (_keyword_1 = _PyPegen_expect_token(p, 710)) // token='for' && (t = star_targets_rule(p)) // star_targets && - (_keyword_2 = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword_2 = _PyPegen_expect_token(p, 711)) // token='in' && (_cut_var = 1) && @@ -6735,7 +6735,7 @@ with_stmt_rule(Parser *p) asdl_stmt_seq* b; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 660)) // token='with' + (_keyword = _PyPegen_expect_token(p, 663)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -6786,7 +6786,7 @@ with_stmt_rule(Parser *p) asdl_stmt_seq* b; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 660)) // token='with' + (_keyword = _PyPegen_expect_token(p, 663)) // token='with' && (a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+ && @@ -6835,9 +6835,9 @@ with_stmt_rule(Parser *p) asdl_withitem_seq* a; asdl_stmt_seq* b; if ( - (_keyword = _PyPegen_expect_token(p, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 660)) // token='with' + (_keyword_1 = _PyPegen_expect_token(p, 663)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -6887,9 +6887,9 @@ with_stmt_rule(Parser *p) asdl_stmt_seq* b; void *tc; if ( - (_keyword = _PyPegen_expect_token(p, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 660)) // token='with' + (_keyword_1 = _PyPegen_expect_token(p, 663)) // token='with' && (a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+ && @@ -6975,7 +6975,7 @@ with_item_rule(Parser *p) if ( (e = expression_rule(p)) // expression && - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && (t = star_target_rule(p)) // star_target && @@ -7100,7 +7100,7 @@ try_stmt_rule(Parser *p) asdl_stmt_seq* b; asdl_stmt_seq* f; if ( - (_keyword = _PyPegen_expect_token(p, 669)) // token='try' + (_keyword = _PyPegen_expect_token(p, 672)) // token='try' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -7144,7 +7144,7 @@ try_stmt_rule(Parser *p) asdl_excepthandler_seq* ex; void *f; if ( - (_keyword = _PyPegen_expect_token(p, 669)) // token='try' + (_keyword = _PyPegen_expect_token(p, 672)) // token='try' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -7192,7 +7192,7 @@ try_stmt_rule(Parser *p) asdl_excepthandler_seq* ex; void *f; if ( - (_keyword = _PyPegen_expect_token(p, 669)) // token='try' + (_keyword = _PyPegen_expect_token(p, 672)) // token='try' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -7291,7 +7291,7 @@ except_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (e = expression_rule(p)) // expression && @@ -7335,11 +7335,11 @@ except_block_rule(Parser *p) expr_ty e; expr_ty t; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (e = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' && (t = _PyPegen_name_token(p)) // NAME && @@ -7381,7 +7381,7 @@ except_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (e = expressions_rule(p)) // expressions && @@ -7422,7 +7422,7 @@ except_block_rule(Parser *p) Token * _literal; asdl_stmt_seq* b; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -7534,7 +7534,7 @@ except_star_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -7581,13 +7581,13 @@ except_star_block_rule(Parser *p) expr_ty e; expr_ty t; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && (e = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' && (t = _PyPegen_name_token(p)) // NAME && @@ -7630,7 +7630,7 @@ except_star_block_rule(Parser *p) asdl_stmt_seq* b; expr_ty e; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -7730,7 +7730,7 @@ finally_block_rule(Parser *p) Token * _literal; asdl_stmt_seq* a; if ( - (_keyword = _PyPegen_expect_token(p, 686)) // token='finally' + (_keyword = _PyPegen_expect_token(p, 689)) // token='finally' && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' && @@ -8038,7 +8038,7 @@ guard_rule(Parser *p) Token * _keyword; expr_ty guard; if ( - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (guard = named_expression_rule(p)) // named_expression ) @@ -8233,7 +8233,7 @@ as_pattern_rule(Parser *p) if ( (pattern = or_pattern_rule(p)) // or_pattern && - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && (target = pattern_capture_target_rule(p)) // pattern_capture_target ) @@ -11647,11 +11647,11 @@ if_expression_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' && (c = expression_rule(p)) // expression ) @@ -12600,7 +12600,7 @@ inversion_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 716)) // token='not' + (_keyword = _PyPegen_expect_token(p, 719)) // token='not' && (a = inversion_rule(p)) // inversion ) @@ -13254,9 +13254,9 @@ notin_bitwise_or_rule(Parser *p) Token * _keyword_1; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 716)) // token='not' + (_keyword = _PyPegen_expect_token(p, 719)) // token='not' && - (_keyword_1 = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' && (a = bitwise_or_rule(p)) // bitwise_or ) @@ -13302,7 +13302,7 @@ in_bitwise_or_rule(Parser *p) Token * _keyword; expr_ty a; if ( - (_keyword = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword = _PyPegen_expect_token(p, 711)) // token='in' && (a = bitwise_or_rule(p)) // bitwise_or ) @@ -13351,7 +13351,7 @@ isnot_bitwise_or_rule(Parser *p) if ( (_keyword = _PyPegen_expect_token(p, 597)) // token='is' && - (_keyword_1 = _PyPegen_expect_token(p, 716)) // token='not' + (_keyword_1 = _PyPegen_expect_token(p, 719)) // token='not' && (a = bitwise_or_rule(p)) // bitwise_or ) @@ -18010,13 +18010,13 @@ for_if_clause_rule(Parser *p) expr_ty b; asdl_expr_seq* c; if ( - (_keyword = _PyPegen_expect_token(p, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' && - (_keyword_1 = _PyPegen_expect_token(p, 707)) // token='for' + (_keyword_1 = _PyPegen_expect_token(p, 710)) // token='for' && (a = star_targets_rule(p)) // star_targets && - (_keyword_2 = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword_2 = _PyPegen_expect_token(p, 711)) // token='in' && (_cut_var = 1) && @@ -18055,11 +18055,11 @@ for_if_clause_rule(Parser *p) expr_ty b; asdl_expr_seq* c; if ( - (_keyword = _PyPegen_expect_token(p, 707)) // token='for' + (_keyword = _PyPegen_expect_token(p, 710)) // token='for' && (a = star_targets_rule(p)) // star_targets && - (_keyword_1 = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' && (_cut_var = 1) && @@ -21386,11 +21386,11 @@ expression_without_invalid_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' && (c = expression_rule(p)) // expression ) @@ -21690,7 +21690,7 @@ invalid_expression_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (b = disjunction_rule(p)) // disjunction && @@ -21723,11 +21723,11 @@ invalid_expression_rule(Parser *p) if ( (a = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' && _PyPegen_lookahead_for_expr(0, expression_rule, p) ) @@ -21759,11 +21759,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, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' && (c = simple_stmt_rule(p)) // simple_stmt ) @@ -21882,11 +21882,11 @@ invalid_if_expression_rule(Parser *p) if ( (disjunction_var = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' && (a = _PyPegen_expect_token(p, 16)) // token='*' ) @@ -21918,11 +21918,11 @@ invalid_if_expression_rule(Parser *p) if ( (disjunction_var = disjunction_rule(p)) // disjunction && - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (b = disjunction_rule(p)) // disjunction && - (_keyword_1 = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword_1 = _PyPegen_expect_token(p, 702)) // token='else' && (a = _PyPegen_expect_token(p, 35)) // token='**' ) @@ -24050,7 +24050,7 @@ invalid_with_item_rule(Parser *p) if ( (expression_var = expression_rule(p)) // expression && - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && (a = expression_rule(p)) // expression && @@ -24100,13 +24100,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, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 707)) // token='for' + (_keyword = _PyPegen_expect_token(p, 710)) // token='for' && (_tmp_136_var = _tmp_136_rule(p)) // bitwise_or ((',' bitwise_or))* ','? && - _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 708) // token='in' + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 711) // 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'")); @@ -24152,9 +24152,9 @@ invalid_for_target_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings expr_ty a; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 707)) // token='for' + (_keyword = _PyPegen_expect_token(p, 710)) // token='for' && (a = star_expressions_rule(p)) // star_expressions ) @@ -24364,7 +24364,7 @@ invalid_dotted_as_name_rule(Parser *p) if ( (dotted_name_var = dotted_name_rule(p)) // dotted_name && - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && _PyPegen_lookahead(0, _tmp_139_rule, p) && @@ -24415,7 +24415,7 @@ invalid_import_from_as_name_rule(Parser *p) if ( (name_var = _PyPegen_name_token(p)) // NAME && - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && _PyPegen_lookahead(0, _tmp_139_rule, p) && @@ -24515,6 +24515,7 @@ invalid_import_from_targets_rule(Parser *p) } // invalid_with_stmt: +// | 'async'? 'with' ','.(expression ['as' star_target])+ ',' ':' // | 'async'? 'with' ','.(expression ['as' star_target])+ NEWLINE // | 'async'? 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' NEWLINE static void * @@ -24529,6 +24530,43 @@ invalid_with_stmt_rule(Parser *p) } void * _res = NULL; int _mark = p->mark; + { // 'async'? 'with' ','.(expression ['as' star_target])+ ',' ':' + if (p->error_indicator) { + p->level--; + return NULL; + } + D(fprintf(stderr, "%*c> invalid_with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'async'? 'with' ','.(expression ['as' star_target])+ ',' ':'")); + asdl_seq * _gather_141_var; + Token * _keyword; + Token * _literal; + void *_opt_var; + UNUSED(_opt_var); // Silence compiler warnings + Token * trailing; + if ( + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? + && + (_keyword = _PyPegen_expect_token(p, 663)) // token='with' + && + (_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as' star_target])+ + && + (trailing = _PyPegen_expect_token(p, 12)) // token=',' + && + (_literal = _PyPegen_expect_token(p, 11)) // token=':' + ) + { + D(fprintf(stderr, "%*c+ invalid_with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'? 'with' ','.(expression ['as' star_target])+ ',' ':'")); + _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( trailing , "the last 'with' item has a trailing comma" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + p->level--; + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_with_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'async'? 'with' ','.(expression ['as' star_target])+ ',' ':'")); + } { // 'async'? 'with' ','.(expression ['as' star_target])+ NEWLINE if (p->error_indicator) { p->level--; @@ -24541,9 +24579,9 @@ invalid_with_stmt_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 660)) // token='with' + (_keyword = _PyPegen_expect_token(p, 663)) // token='with' && (_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as' star_target])+ && @@ -24579,9 +24617,9 @@ invalid_with_stmt_rule(Parser *p) UNUSED(_opt_var_1); // Silence compiler warnings Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 660)) // token='with' + (_keyword = _PyPegen_expect_token(p, 663)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -24641,9 +24679,9 @@ invalid_with_stmt_indent_rule(Parser *p) Token * a; Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 660)) // token='with' + (a = _PyPegen_expect_token(p, 663)) // token='with' && (_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as' star_target])+ && @@ -24684,9 +24722,9 @@ invalid_with_stmt_indent_rule(Parser *p) Token * a; Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 660)) // token='with' + (a = _PyPegen_expect_token(p, 663)) // token='with' && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && @@ -24749,7 +24787,7 @@ invalid_try_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 669)) // token='try' + (a = _PyPegen_expect_token(p, 672)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -24781,7 +24819,7 @@ invalid_try_stmt_rule(Parser *p) Token * _literal; asdl_stmt_seq* block_var; if ( - (_keyword = _PyPegen_expect_token(p, 669)) // token='try' + (_keyword = _PyPegen_expect_token(p, 672)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -24820,7 +24858,7 @@ invalid_try_stmt_rule(Parser *p) Token * b; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 669)) // token='try' + (_keyword = _PyPegen_expect_token(p, 672)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -24828,7 +24866,7 @@ invalid_try_stmt_rule(Parser *p) && (_loop1_36_var = _loop1_36_rule(p)) // except_block+ && - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (b = _PyPegen_expect_token(p, 16)) // token='*' && @@ -24867,7 +24905,7 @@ invalid_try_stmt_rule(Parser *p) UNUSED(_opt_var); // Silence compiler warnings Token * a; if ( - (_keyword = _PyPegen_expect_token(p, 669)) // token='try' + (_keyword = _PyPegen_expect_token(p, 672)) // token='try' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -24875,7 +24913,7 @@ invalid_try_stmt_rule(Parser *p) && (_loop1_37_var = _loop1_37_rule(p)) // except_star_block+ && - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (_opt_var = _tmp_146_rule(p), !p->error_indicator) // [expression ['as' NAME]] && @@ -24932,7 +24970,7 @@ invalid_except_stmt_rule(Parser *p) expr_ty expressions_var; expr_ty name_var; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (a = expression_rule(p)) // expression && @@ -24940,7 +24978,7 @@ invalid_except_stmt_rule(Parser *p) && (expressions_var = expressions_rule(p)) // expressions && - (_keyword_1 = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -24972,7 +25010,7 @@ invalid_except_stmt_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (expression_var = expression_rule(p)) // expression && @@ -25003,7 +25041,7 @@ invalid_except_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) @@ -25034,11 +25072,11 @@ invalid_except_stmt_rule(Parser *p) asdl_stmt_seq* block_var; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (expression_var = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' && (a = expression_rule(p)) // expression && @@ -25098,7 +25136,7 @@ invalid_except_star_stmt_rule(Parser *p) expr_ty expressions_var; expr_ty name_var; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25108,7 +25146,7 @@ invalid_except_star_stmt_rule(Parser *p) && (expressions_var = expressions_rule(p)) // expressions && - (_keyword_1 = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -25141,7 +25179,7 @@ invalid_except_star_stmt_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25175,7 +25213,7 @@ invalid_except_star_stmt_rule(Parser *p) void *_tmp_147_var; Token * a; if ( - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25209,13 +25247,13 @@ invalid_except_star_stmt_rule(Parser *p) asdl_stmt_seq* block_var; expr_ty expression_var; if ( - (_keyword = _PyPegen_expect_token(p, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && (expression_var = expression_rule(p)) // expression && - (_keyword_1 = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword_1 = _PyPegen_expect_token(p, 696)) // token='as' && (a = expression_rule(p)) // expression && @@ -25266,7 +25304,7 @@ invalid_finally_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 686)) // token='finally' + (a = _PyPegen_expect_token(p, 689)) // token='finally' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -25322,7 +25360,7 @@ invalid_except_stmt_indent_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (expression_var = expression_rule(p)) // expression && @@ -25358,7 +25396,7 @@ invalid_except_stmt_indent_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -25414,7 +25452,7 @@ invalid_except_star_stmt_indent_rule(Parser *p) expr_ty expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 690)) // token='except' + (a = _PyPegen_expect_token(p, 693)) // token='except' && (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -25691,7 +25729,7 @@ invalid_as_pattern_rule(Parser *p) if ( (or_pattern_var = or_pattern_rule(p)) // or_pattern && - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && (a = _PyPegen_expect_soft_keyword(p, "_")) // soft_keyword='"_"' ) @@ -25721,7 +25759,7 @@ invalid_as_pattern_rule(Parser *p) if ( (or_pattern_var = or_pattern_rule(p)) // or_pattern && - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && (a = expression_rule(p)) // expression ) @@ -25937,7 +25975,7 @@ invalid_if_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -25968,7 +26006,7 @@ invalid_if_stmt_rule(Parser *p) expr_ty a_1; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 695)) // token='if' + (a = _PyPegen_expect_token(p, 698)) // token='if' && (a_1 = named_expression_rule(p)) // named_expression && @@ -26023,7 +26061,7 @@ invalid_elif_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 700)) // token='elif' + (_keyword = _PyPegen_expect_token(p, 703)) // token='elif' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26054,7 +26092,7 @@ invalid_elif_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 700)) // token='elif' + (a = _PyPegen_expect_token(p, 703)) // token='elif' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26107,7 +26145,7 @@ invalid_else_stmt_rule(Parser *p) Token * a; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 699)) // token='else' + (a = _PyPegen_expect_token(p, 702)) // token='else' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && @@ -26140,13 +26178,13 @@ invalid_else_stmt_rule(Parser *p) Token * _literal; asdl_stmt_seq* block_var; if ( - (_keyword = _PyPegen_expect_token(p, 699)) // token='else' + (_keyword = _PyPegen_expect_token(p, 702)) // token='else' && (_literal = _PyPegen_expect_token(p, 11)) // token=':' && (block_var = block_rule(p)) // block && - (_keyword_1 = _PyPegen_expect_token(p, 700)) // token='elif' + (_keyword_1 = _PyPegen_expect_token(p, 703)) // token='elif' ) { D(fprintf(stderr, "%*c+ invalid_else_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else' ':' block 'elif'")); @@ -26193,7 +26231,7 @@ invalid_while_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 702)) // token='while' + (_keyword = _PyPegen_expect_token(p, 705)) // token='while' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26224,7 +26262,7 @@ invalid_while_stmt_rule(Parser *p) expr_ty named_expression_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 702)) // token='while' + (a = _PyPegen_expect_token(p, 705)) // token='while' && (named_expression_var = named_expression_rule(p)) // named_expression && @@ -26283,13 +26321,13 @@ invalid_for_stmt_rule(Parser *p) expr_ty star_expressions_var; expr_ty star_targets_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 707)) // token='for' + (_keyword = _PyPegen_expect_token(p, 710)) // token='for' && (star_targets_var = star_targets_rule(p)) // star_targets && - (_keyword_1 = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword_1 = _PyPegen_expect_token(p, 711)) // token='in' && (star_expressions_var = star_expressions_rule(p)) // star_expressions && @@ -26324,13 +26362,13 @@ invalid_for_stmt_rule(Parser *p) expr_ty star_expressions_var; expr_ty star_targets_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 707)) // token='for' + (a = _PyPegen_expect_token(p, 710)) // token='for' && (star_targets_var = star_targets_rule(p)) // star_targets && - (_keyword = _PyPegen_expect_token(p, 708)) // token='in' + (_keyword = _PyPegen_expect_token(p, 711)) // token='in' && (star_expressions_var = star_expressions_rule(p)) // star_expressions && @@ -26396,9 +26434,9 @@ invalid_def_raw_rule(Parser *p) expr_ty name_var; Token * newline_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (a = _PyPegen_expect_token(p, 712)) // token='def' + (a = _PyPegen_expect_token(p, 715)) // token='def' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -26455,9 +26493,9 @@ invalid_def_raw_rule(Parser *p) asdl_stmt_seq* block_var; expr_ty name_var; if ( - (_opt_var = _PyPegen_expect_token(p, 711), !p->error_indicator) // 'async'? + (_opt_var = _PyPegen_expect_token(p, 714), !p->error_indicator) // 'async'? && - (_keyword = _PyPegen_expect_token(p, 712)) // token='def' + (_keyword = _PyPegen_expect_token(p, 715)) // token='def' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -26521,7 +26559,7 @@ invalid_class_def_raw_rule(Parser *p) expr_ty name_var; Token * newline_var; if ( - (_keyword = _PyPegen_expect_token(p, 714)) // token='class' + (_keyword = _PyPegen_expect_token(p, 717)) // token='class' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -26560,7 +26598,7 @@ invalid_class_def_raw_rule(Parser *p) expr_ty name_var; Token * newline_var; if ( - (a = _PyPegen_expect_token(p, 714)) // token='class' + (a = _PyPegen_expect_token(p, 717)) // token='class' && (name_var = _PyPegen_name_token(p)) // NAME && @@ -28196,7 +28234,7 @@ invalid_arithmetic_rule(Parser *p) && (_tmp_157_var = _tmp_157_rule(p)) // '+' | '-' | '*' | '/' | '%' | '//' | '@' && - (a = _PyPegen_expect_token(p, 716)) // token='not' + (a = _PyPegen_expect_token(p, 719)) // token='not' && (b = inversion_rule(p)) // inversion ) @@ -28245,7 +28283,7 @@ invalid_factor_rule(Parser *p) if ( (_tmp_158_var = _tmp_158_rule(p)) // '+' | '-' | '~' && - (a = _PyPegen_expect_token(p, 716)) // token='not' + (a = _PyPegen_expect_token(p, 719)) // token='not' && (b = factor_rule(p)) // factor ) @@ -28668,7 +28706,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, 712)) // token='def' + (_keyword = _PyPegen_expect_token(p, 715)) // token='def' ) { D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'def'")); @@ -28706,7 +28744,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, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' ) { D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'")); @@ -28744,7 +28782,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, 714)) // token='class' + (_keyword = _PyPegen_expect_token(p, 717)) // token='class' ) { D(fprintf(stderr, "%*c+ _tmp_7[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'class'")); @@ -28801,7 +28839,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, 660)) // token='with' + (_keyword = _PyPegen_expect_token(p, 663)) // token='with' ) { D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with'")); @@ -28820,7 +28858,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, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' ) { D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'")); @@ -28858,7 +28896,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, 707)) // token='for' + (_keyword = _PyPegen_expect_token(p, 710)) // token='for' ) { D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for'")); @@ -28877,7 +28915,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, 711)) // token='async' + (_keyword = _PyPegen_expect_token(p, 714)) // token='async' ) { D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'async'")); @@ -29578,7 +29616,7 @@ _tmp_21_rule(Parser *p) Token * _keyword; expr_ty z; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && (z = _PyPegen_name_token(p)) // NAME ) @@ -35550,7 +35588,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, 699)) // token='else' + (_keyword = _PyPegen_expect_token(p, 702)) // token='else' ) { D(fprintf(stderr, "%*c+ _tmp_117[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else'")); @@ -37213,7 +37251,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, 690)) // token='except' + (_keyword = _PyPegen_expect_token(p, 693)) // token='except' ) { D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except'")); @@ -37232,7 +37270,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, 686)) // token='finally' + (_keyword = _PyPegen_expect_token(p, 689)) // token='finally' ) { D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'finally'")); @@ -38534,7 +38572,7 @@ _tmp_166_rule(Parser *p) Token * _keyword; expr_ty z; if ( - (_keyword = _PyPegen_expect_token(p, 695)) // token='if' + (_keyword = _PyPegen_expect_token(p, 698)) // token='if' && (z = disjunction_rule(p)) // disjunction ) @@ -39270,7 +39308,7 @@ _tmp_180_rule(Parser *p) Token * _keyword; expr_ty star_target_var; if ( - (_keyword = _PyPegen_expect_token(p, 693)) // token='as' + (_keyword = _PyPegen_expect_token(p, 696)) // token='as' && (star_target_var = star_target_rule(p)) // star_target ) _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
