https://github.com/python/cpython/commit/0b8bb7154c28e7de5089cd04a589c333b0e724b8
commit: 0b8bb7154c28e7de5089cd04a589c333b0e724b8
branch: main
author: Lysandros Nikolaou <[email protected]>
committer: lysnikolaou <[email protected]>
date: 2026-10-22T19:25:07Z
summary:
gh-160284: Number each keyword once in the PEG generator (#160290)
`KeywordCollectorVisitor` checked the quoted spelling of a keyword against
keys stored without quotes, so the check never matched and every
occurrence of a keyword in the grammar took a new token type. The 35
hard keywords were numbered between 500 and 721 instead of 500 to 534.
files:
M Lib/test/test_peg_generator/test_c_generator.py
M Parser/parser.c
M Tools/peg_generator/pegen/parser_generator.py
diff --git a/Lib/test/test_peg_generator/test_c_generator.py
b/Lib/test/test_peg_generator/test_c_generator.py
index 3f66db2081e1f7..0c2840bc297cd1 100644
--- a/Lib/test/test_peg_generator/test_c_generator.py
+++ b/Lib/test/test_peg_generator/test_c_generator.py
@@ -277,6 +277,15 @@ def test_lowering_snapshots_symbols_and_tokens(self):
self.assertEqual(lowerer.prepare_rule(atom).signature.return_type,
"expr_ty")
self.assertEqual(lowerer.prepare_rule(start), expected)
+ def test_keywords_are_numbered_once(self):
+ generator = self.make_generator("""
+ start: keywords | "soft" "soft"
+ keywords: 'if' NAME | 'if' NUMBER | 'else' NAME | 'pass' | 'else'
'pass'
+ """)
+ generator.prepare(PurePath("example.gram"))
+ self.assertEqual(generator.keywords, {"if": 500, "else": 501, "pass":
502})
+ self.assertEqual(generator.soft_keywords, {"soft"})
+
if __name__ == "__main__":
unittest.main()
diff --git a/Parser/parser.c b/Parser/parser.c
index 979907f4873b9d..0568d13845609b 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -22,59 +22,59 @@ static KeywordToken *reserved_keywords[] = {
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {
- {"if", 700},
- {"as", 698},
- {"in", 713},
- {"or", 589},
- {"is", 597},
+ {"if", 514},
+ {"as", 520},
+ {"in", 523},
+ {"or", 529},
+ {"is", 532},
{NULL, -1},
},
(KeywordToken[]) {
- {"del", 634},
- {"def", 717},
- {"for", 712},
- {"try", 674},
- {"and", 590},
- {"not", 721},
+ {"del", 505},
+ {"def", 512},
+ {"for", 517},
+ {"try", 518},
+ {"and", 530},
+ {"not", 531},
{NULL, -1},
},
(KeywordToken[]) {
- {"from", 650},
- {"pass", 527},
- {"with", 665},
- {"elif", 705},
- {"else", 704},
- {"None", 628},
- {"True", 627},
+ {"from", 501},
+ {"pass", 504},
+ {"with", 516},
+ {"elif", 521},
+ {"else", 522},
+ {"None", 526},
+ {"True", 527},
{NULL, -1},
},
(KeywordToken[]) {
- {"raise", 632},
- {"yield", 588},
- {"break", 528},
- {"async", 716},
- {"class", 719},
- {"while", 707},
- {"False", 629},
- {"await", 598},
+ {"raise", 503},
+ {"yield", 506},
+ {"break", 508},
+ {"async", 513},
+ {"class", 515},
+ {"while", 519},
+ {"False", 528},
+ {"await", 533},
{NULL, -1},
},
(KeywordToken[]) {
- {"import", 651},
- {"return", 522},
- {"assert", 638},
- {"global", 530},
- {"except", 695},
- {"lambda", 622},
+ {"import", 500},
+ {"return", 502},
+ {"assert", 507},
+ {"global", 510},
+ {"except", 524},
+ {"lambda", 534},
{NULL, -1},
},
(KeywordToken[]) {
- {"finally", 691},
+ {"finally", 525},
{NULL, -1},
},
(KeywordToken[]) {
- {"continue", 529},
- {"nonlocal", 531},
+ {"continue", 509},
+ {"nonlocal", 511},
{NULL, -1},
},
};
@@ -1679,7 +1679,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'return' return_stmt"));
stmt_ty return_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 522) //
token='return'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 502) //
token='return'
&&
(return_stmt_var = return_stmt_rule(p)) // return_stmt
)
@@ -1700,7 +1700,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, 503) //
token='raise'
&&
(raise_stmt_var = raise_stmt_rule(p)) // raise_stmt
)
@@ -1721,7 +1721,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'pass' pass_stmt"));
stmt_ty pass_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 527) //
token='pass'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 504) //
token='pass'
&&
(pass_stmt_var = pass_stmt_rule(p)) // pass_stmt
)
@@ -1742,7 +1742,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, 505) //
token='del'
&&
(del_stmt_var = del_stmt_rule(p)) // del_stmt
)
@@ -1763,7 +1763,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, 506) //
token='yield'
&&
(yield_stmt_var = yield_stmt_rule(p)) // yield_stmt
)
@@ -1784,7 +1784,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, 507) //
token='assert'
&&
(assert_stmt_var = assert_stmt_rule(p)) // assert_stmt
)
@@ -1805,7 +1805,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'break' break_stmt"));
stmt_ty break_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 528) //
token='break'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 508) //
token='break'
&&
(break_stmt_var = break_stmt_rule(p)) // break_stmt
)
@@ -1826,7 +1826,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'continue' continue_stmt"));
stmt_ty continue_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 529) //
token='continue'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 509) //
token='continue'
&&
(continue_stmt_var = continue_stmt_rule(p)) // continue_stmt
)
@@ -1847,7 +1847,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'global' global_stmt"));
stmt_ty global_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 530) //
token='global'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 510) //
token='global'
&&
(global_stmt_var = global_stmt_rule(p)) // global_stmt
)
@@ -1868,7 +1868,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'nonlocal' nonlocal_stmt"));
stmt_ty nonlocal_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 531) //
token='nonlocal'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 511) //
token='nonlocal'
&&
(nonlocal_stmt_var = nonlocal_stmt_rule(p)) // nonlocal_stmt
)
@@ -1938,7 +1938,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, 700) //
token='if'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 514) //
token='if'
&&
(if_stmt_var = if_stmt_rule(p)) // if_stmt
)
@@ -2022,7 +2022,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, 674) //
token='try'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 518) //
token='try'
&&
(try_stmt_var = try_stmt_rule(p)) // try_stmt
)
@@ -2043,7 +2043,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, 707) //
token='while'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 519) //
token='while'
&&
(while_stmt_var = while_stmt_rule(p)) // while_stmt
)
@@ -2736,7 +2736,7 @@ return_stmt_rule(Parser *p)
Token * _keyword;
void *a;
if (
- (_keyword = _PyPegen_expect_token(p, 522)) // token='return'
+ (_keyword = _PyPegen_expect_token(p, 502)) // token='return'
&&
(a = star_expressions_rule(p), !p->error_indicator) //
star_expressions?
)
@@ -2806,11 +2806,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, 503)) // token='raise'
&&
(a = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword_1 = _PyPegen_expect_token(p, 501)) // token='from'
&&
(b = expression_rule(p)) // expression
)
@@ -2865,7 +2865,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, 503)) // token='raise'
&&
(a = expression_rule(p)) // expression
)
@@ -2900,7 +2900,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, 503)) // token='raise'
)
{
D(fprintf(stderr, "%*c+ raise_stmt[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'raise'"));
@@ -2961,7 +2961,7 @@ pass_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> pass_stmt[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'pass'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 527)) // token='pass'
+ (_keyword = _PyPegen_expect_token(p, 504)) // token='pass'
)
{
D(fprintf(stderr, "%*c+ pass_stmt[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'pass'"));
@@ -3022,7 +3022,7 @@ break_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> break_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'break'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 528)) // token='break'
+ (_keyword = _PyPegen_expect_token(p, 508)) // token='break'
)
{
D(fprintf(stderr, "%*c+ break_stmt[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'break'"));
@@ -3083,7 +3083,7 @@ continue_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> continue_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'continue'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 529)) // token='continue'
+ (_keyword = _PyPegen_expect_token(p, 509)) // token='continue'
)
{
D(fprintf(stderr, "%*c+ continue_stmt[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'continue'"));
@@ -3145,7 +3145,7 @@ global_stmt_rule(Parser *p)
Token * _keyword;
asdl_expr_seq* a;
if (
- (_keyword = _PyPegen_expect_token(p, 530)) // token='global'
+ (_keyword = _PyPegen_expect_token(p, 510)) // token='global'
&&
(a = (asdl_expr_seq*)_gather_14_rule(p)) // ','.NAME+
)
@@ -3209,7 +3209,7 @@ nonlocal_stmt_rule(Parser *p)
Token * _keyword;
asdl_expr_seq* a;
if (
- (_keyword = _PyPegen_expect_token(p, 531)) // token='nonlocal'
+ (_keyword = _PyPegen_expect_token(p, 511)) // token='nonlocal'
&&
(a = (asdl_expr_seq*)_gather_14_rule(p)) // ','.NAME+
)
@@ -3273,7 +3273,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, 505)) // token='del'
&&
(a = del_targets_rule(p)) // del_targets
&&
@@ -3439,7 +3439,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, 507)) // token='assert'
&&
(a = expression_rule(p)) // expression
&&
@@ -3589,7 +3589,7 @@ import_name_rule(Parser *p)
if (
(lazy = _PyPegen_expect_soft_keyword(p, "lazy"),
!p->error_indicator) // "lazy"?
&&
- (_keyword = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword = _PyPegen_expect_token(p, 500)) // token='import'
&&
(a = dotted_as_names_rule(p)) // dotted_as_names
)
@@ -3681,13 +3681,13 @@ import_from_rule(Parser *p)
if (
(lazy = _PyPegen_expect_soft_keyword(p, "lazy"),
!p->error_indicator) // "lazy"?
&&
- (_keyword = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword = _PyPegen_expect_token(p, 501)) // token='from'
&&
(a = _loop0_17_rule(p)) // (('.' | '...'))*
&&
(b = dotted_name_rule(p)) // dotted_name
&&
- (_keyword_1 = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword_1 = _PyPegen_expect_token(p, 500)) // token='import'
&&
(c = import_from_targets_rule(p)) // import_from_targets
)
@@ -3728,11 +3728,11 @@ import_from_rule(Parser *p)
if (
(lazy = _PyPegen_expect_soft_keyword(p, "lazy"),
!p->error_indicator) // "lazy"?
&&
- (_keyword = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword = _PyPegen_expect_token(p, 501)) // token='from'
&&
(a = _loop1_18_rule(p)) // (('.' | '...'))+
&&
- (_keyword_1 = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword_1 = _PyPegen_expect_token(p, 500)) // token='import'
&&
(b = import_from_targets_rule(p)) // import_from_targets
)
@@ -4521,7 +4521,7 @@ class_def_raw_rule(Parser *p)
asdl_stmt_seq* c;
void *t;
if (
- (_keyword = _PyPegen_expect_token(p, 719)) // token='class'
+ (_keyword = _PyPegen_expect_token(p, 515)) // token='class'
&&
(a = _PyPegen_name_token(p)) // NAME
&&
@@ -4688,7 +4688,7 @@ function_def_raw_rule(Parser *p)
void *t;
void *tc;
if (
- (_keyword = _PyPegen_expect_token(p, 717)) // token='def'
+ (_keyword = _PyPegen_expect_token(p, 512)) // token='def'
&&
(n = _PyPegen_name_token(p)) // NAME
&&
@@ -4749,9 +4749,9 @@ function_def_raw_rule(Parser *p)
void *t;
void *tc;
if (
- (_keyword = _PyPegen_expect_token(p, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 717)) // token='def'
+ (_keyword_1 = _PyPegen_expect_token(p, 512)) // token='def'
&&
(n = _PyPegen_name_token(p)) // NAME
&&
@@ -6089,7 +6089,7 @@ if_stmt_rule(Parser *p)
asdl_stmt_seq* b;
stmt_ty c;
if (
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6134,7 +6134,7 @@ if_stmt_rule(Parser *p)
asdl_stmt_seq* b;
void *c;
if (
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6229,7 +6229,7 @@ elif_stmt_rule(Parser *p)
asdl_stmt_seq* b;
stmt_ty c;
if (
- (_keyword = _PyPegen_expect_token(p, 705)) // token='elif'
+ (_keyword = _PyPegen_expect_token(p, 521)) // token='elif'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6274,7 +6274,7 @@ elif_stmt_rule(Parser *p)
asdl_stmt_seq* b;
void *c;
if (
- (_keyword = _PyPegen_expect_token(p, 705)) // token='elif'
+ (_keyword = _PyPegen_expect_token(p, 521)) // token='elif'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6355,7 +6355,7 @@ else_block_rule(Parser *p)
Token * _literal;
asdl_stmt_seq* b;
if (
- (_keyword = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword = _PyPegen_expect_token(p, 522)) // token='else'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -6434,7 +6434,7 @@ while_stmt_rule(Parser *p)
asdl_stmt_seq* b;
void *c;
if (
- (_keyword = _PyPegen_expect_token(p, 707)) // token='while'
+ (_keyword = _PyPegen_expect_token(p, 519)) // token='while'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6534,11 +6534,11 @@ for_stmt_rule(Parser *p)
expr_ty t;
void *tc;
if (
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 517)) // token='for'
&&
(t = star_targets_rule(p)) // star_targets
&&
- (_keyword_1 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_1 = _PyPegen_expect_token(p, 523)) // token='in'
&&
(_cut_var = 1)
&&
@@ -6596,13 +6596,13 @@ for_stmt_rule(Parser *p)
expr_ty t;
void *tc;
if (
- (_keyword = _PyPegen_expect_token(p, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword_1 = _PyPegen_expect_token(p, 517)) // token='for'
&&
(t = star_targets_rule(p)) // star_targets
&&
- (_keyword_2 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_2 = _PyPegen_expect_token(p, 523)) // token='in'
&&
(_cut_var = 1)
&&
@@ -6731,7 +6731,7 @@ with_stmt_rule(Parser *p)
asdl_stmt_seq* b;
void *tc;
if (
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 516)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -6782,7 +6782,7 @@ with_stmt_rule(Parser *p)
asdl_stmt_seq* b;
void *tc;
if (
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 516)) // token='with'
&&
(a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+
&&
@@ -6831,9 +6831,9 @@ with_stmt_rule(Parser *p)
asdl_withitem_seq* a;
asdl_stmt_seq* b;
if (
- (_keyword = _PyPegen_expect_token(p, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword_1 = _PyPegen_expect_token(p, 516)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -6883,9 +6883,9 @@ with_stmt_rule(Parser *p)
asdl_stmt_seq* b;
void *tc;
if (
- (_keyword = _PyPegen_expect_token(p, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword_1 = _PyPegen_expect_token(p, 516)) // token='with'
&&
(a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+
&&
@@ -6971,7 +6971,7 @@ with_item_rule(Parser *p)
if (
(e = expression_rule(p)) // expression
&&
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
(t = star_target_rule(p)) // star_target
&&
@@ -7096,7 +7096,7 @@ try_stmt_rule(Parser *p)
asdl_stmt_seq* b;
asdl_stmt_seq* f;
if (
- (_keyword = _PyPegen_expect_token(p, 674)) // token='try'
+ (_keyword = _PyPegen_expect_token(p, 518)) // token='try'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -7140,7 +7140,7 @@ try_stmt_rule(Parser *p)
asdl_excepthandler_seq* ex;
void *f;
if (
- (_keyword = _PyPegen_expect_token(p, 674)) // token='try'
+ (_keyword = _PyPegen_expect_token(p, 518)) // token='try'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -7188,7 +7188,7 @@ try_stmt_rule(Parser *p)
asdl_excepthandler_seq* ex;
void *f;
if (
- (_keyword = _PyPegen_expect_token(p, 674)) // token='try'
+ (_keyword = _PyPegen_expect_token(p, 518)) // token='try'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -7287,7 +7287,7 @@ except_block_rule(Parser *p)
asdl_stmt_seq* b;
expr_ty e;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(e = expression_rule(p)) // expression
&&
@@ -7331,11 +7331,11 @@ except_block_rule(Parser *p)
expr_ty e;
expr_ty t;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(e = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 520)) // token='as'
&&
(t = _PyPegen_name_token(p)) // NAME
&&
@@ -7377,7 +7377,7 @@ except_block_rule(Parser *p)
asdl_stmt_seq* b;
expr_ty e;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(e = expressions_rule(p)) // expressions
&&
@@ -7418,7 +7418,7 @@ except_block_rule(Parser *p)
Token * _literal;
asdl_stmt_seq* b;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -7530,7 +7530,7 @@ except_star_block_rule(Parser *p)
asdl_stmt_seq* b;
expr_ty e;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -7577,13 +7577,13 @@ except_star_block_rule(Parser *p)
expr_ty e;
expr_ty t;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
(e = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 520)) // token='as'
&&
(t = _PyPegen_name_token(p)) // NAME
&&
@@ -7626,7 +7626,7 @@ except_star_block_rule(Parser *p)
asdl_stmt_seq* b;
expr_ty e;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -7726,7 +7726,7 @@ finally_block_rule(Parser *p)
Token * _literal;
asdl_stmt_seq* a;
if (
- (_keyword = _PyPegen_expect_token(p, 691)) // token='finally'
+ (_keyword = _PyPegen_expect_token(p, 525)) // token='finally'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -8034,7 +8034,7 @@ guard_rule(Parser *p)
Token * _keyword;
expr_ty guard;
if (
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(guard = named_expression_rule(p)) // named_expression
)
@@ -8229,7 +8229,7 @@ as_pattern_rule(Parser *p)
if (
(pattern = or_pattern_rule(p)) // or_pattern
&&
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
(target = pattern_capture_target_rule(p)) //
pattern_capture_target
)
@@ -8663,7 +8663,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, 526)) // token='None'
)
{
D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'None'"));
@@ -8696,7 +8696,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, 527)) // token='True'
)
{
D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'True'"));
@@ -8729,7 +8729,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, 528)) // token='False'
)
{
D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'False'"));
@@ -8857,7 +8857,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, 526)) // token='None'
)
{
D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'None'"));
@@ -8890,7 +8890,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, 527)) // token='True'
)
{
D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'True'"));
@@ -8923,7 +8923,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, 528)) // token='False'
)
{
D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'False'"));
@@ -11719,11 +11719,11 @@ if_expression_rule(Parser *p)
if (
(a = disjunction_rule(p)) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 522)) // token='else'
&&
(c = expression_rule(p)) // expression
)
@@ -11788,9 +11788,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, 506)) // token='yield'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword_1 = _PyPegen_expect_token(p, 501)) // token='from'
&&
(a = expression_rule(p)) // expression
)
@@ -11826,7 +11826,7 @@ yield_expr_rule(Parser *p)
Token * _keyword;
void *a;
if (
- (_keyword = _PyPegen_expect_token(p, 588)) // token='yield'
+ (_keyword = _PyPegen_expect_token(p, 506)) // token='yield'
&&
(a = star_expressions_rule(p), !p->error_indicator) //
star_expressions?
)
@@ -12572,7 +12572,7 @@ inversion_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 721)) // token='not'
+ (_keyword = _PyPegen_expect_token(p, 531)) // token='not'
&&
(a = inversion_rule(p)) // inversion
)
@@ -12925,9 +12925,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
Token * _keyword_1;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 721)) // token='not'
+ (_keyword = _PyPegen_expect_token(p, 531)) // token='not'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_1 = _PyPegen_expect_token(p, 523)) // token='in'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -12954,7 +12954,7 @@ compare_op_bitwise_or_pair_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword = _PyPegen_expect_token(p, 523)) // token='in'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -12982,9 +12982,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
Token * _keyword_1;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 597)) // token='is'
+ (_keyword = _PyPegen_expect_token(p, 532)) // token='is'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 721)) // token='not'
+ (_keyword_1 = _PyPegen_expect_token(p, 531)) // token='not'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -13011,7 +13011,7 @@ compare_op_bitwise_or_pair_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 597)) // token='is'
+ (_keyword = _PyPegen_expect_token(p, 532)) // token='is'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -14384,7 +14384,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, 533)) // token='await'
&&
(a = primary_rule(p)) // primary
)
@@ -14932,7 +14932,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, 527)) // token='True'
)
{
D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, '
', _mark, p->mark, "'True'"));
@@ -14965,7 +14965,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, 528)) // token='False'
)
{
D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, '
', _mark, p->mark, "'False'"));
@@ -14998,7 +14998,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, 526)) // token='None'
)
{
D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, '
', _mark, p->mark, "'None'"));
@@ -15266,7 +15266,7 @@ lambdef_rule(Parser *p)
void *a;
expr_ty b;
if (
- (_keyword = _PyPegen_expect_token(p, 622)) // token='lambda'
+ (_keyword = _PyPegen_expect_token(p, 534)) // token='lambda'
&&
(a = lambda_params_rule(p), !p->error_indicator) // lambda_params?
&&
@@ -17789,13 +17789,13 @@ for_if_clause_rule(Parser *p)
expr_ty b;
asdl_expr_seq* c;
if (
- (_keyword = _PyPegen_expect_token(p, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword_1 = _PyPegen_expect_token(p, 517)) // token='for'
&&
(a = star_targets_rule(p)) // star_targets
&&
- (_keyword_2 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_2 = _PyPegen_expect_token(p, 523)) // token='in'
&&
(_cut_var = 1)
&&
@@ -17834,11 +17834,11 @@ for_if_clause_rule(Parser *p)
expr_ty b;
asdl_expr_seq* c;
if (
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 517)) // token='for'
&&
(a = star_targets_rule(p)) // star_targets
&&
- (_keyword_1 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_1 = _PyPegen_expect_token(p, 523)) // token='in'
&&
(_cut_var = 1)
&&
@@ -19937,7 +19937,7 @@ invalid_kwarg_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 627)) // token='True'
+ (a = _PyPegen_expect_token(p, 527)) // token='True'
&&
(b = _PyPegen_expect_token(p, 22)) // token='='
)
@@ -19964,7 +19964,7 @@ invalid_kwarg_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 629)) // token='False'
+ (a = _PyPegen_expect_token(p, 528)) // token='False'
&&
(b = _PyPegen_expect_token(p, 22)) // token='='
)
@@ -19991,7 +19991,7 @@ invalid_kwarg_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 628)) // token='None'
+ (a = _PyPegen_expect_token(p, 526)) // token='None'
&&
(b = _PyPegen_expect_token(p, 22)) // token='='
)
@@ -20156,11 +20156,11 @@ expression_without_invalid_rule(Parser *p)
if (
(a = ((!p->call_invalid_rules && _prefix_11_valid) ? (p->mark =
_prefix_11_end, _prefix_11_result) : (_prefix_11_result = disjunction_rule(p),
_prefix_11_end = p->mark, _prefix_11_valid = 1, _prefix_11_result))) //
disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 522)) // token='else'
&&
(c = expression_rule(p)) // expression
)
@@ -20462,7 +20462,7 @@ invalid_expression_rule(Parser *p)
if (
(a = ((!p->call_invalid_rules && _prefix_12_valid) ? (p->mark =
_prefix_12_end, _prefix_12_result) : (_prefix_12_result = disjunction_rule(p),
_prefix_12_end = p->mark, _prefix_12_valid = 1, _prefix_12_result))) //
disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
@@ -20495,11 +20495,11 @@ invalid_expression_rule(Parser *p)
if (
(a = ((!p->call_invalid_rules && _prefix_12_valid) ? (p->mark =
_prefix_12_end, _prefix_12_result) : (_prefix_12_result = disjunction_rule(p),
_prefix_12_end = p->mark, _prefix_12_valid = 1, _prefix_12_result))) //
disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 522)) // token='else'
&&
_PyPegen_lookahead_for_expr(0, expression_rule, p)
)
@@ -20531,11 +20531,11 @@ invalid_expression_rule(Parser *p)
if (
(a = (stmt_ty)_tmp_116_rule(p)) // pass_stmt | break_stmt |
continue_stmt
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 522)) // token='else'
&&
(c = simple_stmt_rule(p)) // simple_stmt
)
@@ -20564,7 +20564,7 @@ invalid_expression_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 622)) // token='lambda'
+ (a = _PyPegen_expect_token(p, 534)) // token='lambda'
&&
(_opt_var = lambda_params_rule(p), !p->error_indicator) //
lambda_params?
&&
@@ -20597,7 +20597,7 @@ invalid_expression_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 622)) // token='lambda'
+ (a = _PyPegen_expect_token(p, 534)) // token='lambda'
&&
(_opt_var = lambda_params_rule(p), !p->error_indicator) //
lambda_params?
&&
@@ -20656,11 +20656,11 @@ invalid_if_expression_rule(Parser *p)
if (
(disjunction_var = ((!p->call_invalid_rules && _prefix_13_valid) ?
(p->mark = _prefix_13_end, _prefix_13_result) : (_prefix_13_result =
disjunction_rule(p), _prefix_13_end = p->mark, _prefix_13_valid = 1,
_prefix_13_result))) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 522)) // token='else'
&&
(a = _PyPegen_expect_token(p, 16)) // token='*'
)
@@ -20692,11 +20692,11 @@ invalid_if_expression_rule(Parser *p)
if (
(disjunction_var = ((!p->call_invalid_rules && _prefix_13_valid) ?
(p->mark = _prefix_13_end, _prefix_13_result) : (_prefix_13_result =
disjunction_rule(p), _prefix_13_end = p->mark, _prefix_13_valid = 1,
_prefix_13_result))) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 522)) // token='else'
&&
(a = _PyPegen_expect_token(p, 35)) // token='**'
)
@@ -21163,9 +21163,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, 503)) // token='raise'
&&
- (b = _PyPegen_expect_token(p, 650)) // token='from'
+ (b = _PyPegen_expect_token(p, 501)) // token='from'
)
{
D(fprintf(stderr, "%*c+ invalid_raise_stmt[%d-%d]: %s
succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' 'from'"));
@@ -21191,11 +21191,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, 503)) // token='raise'
&&
(expression_var = expression_rule(p)) // expression
&&
- (a = _PyPegen_expect_token(p, 650)) // token='from'
+ (a = _PyPegen_expect_token(p, 501)) // token='from'
)
{
D(fprintf(stderr, "%*c+ invalid_raise_stmt[%d-%d]: %s
succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' expression 'from'"));
@@ -21239,7 +21239,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, 505)) // token='del'
&&
(a = star_expressions_rule(p)) // star_expressions
)
@@ -21291,7 +21291,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, 507)) // token='assert'
&&
(a = expression_rule(p)) // expression
&&
@@ -21326,7 +21326,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, 507)) // token='assert'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -21363,7 +21363,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, 507)) // token='assert'
&&
(a = expression_rule(p)) // expression
&&
@@ -21398,7 +21398,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, 507)) // token='assert'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -22824,7 +22824,7 @@ invalid_with_item_rule(Parser *p)
if (
(expression_var = expression_rule(p)) // expression
&&
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
(a = expression_rule(p)) // expression
&&
@@ -22874,13 +22874,13 @@ invalid_for_if_clause_rule(Parser *p)
UNUSED(_opt_var); // Silence compiler warnings
void *_tmp_134_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 517)) // token='for'
&&
(_tmp_134_var = _tmp_134_rule(p)) // bitwise_or ((','
bitwise_or))* ','?
&&
- _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 713) //
token='in'
+ _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 523) //
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'"));
@@ -22926,9 +22926,9 @@ invalid_for_target_rule(Parser *p)
UNUSED(_opt_var); // Silence compiler warnings
expr_ty a;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 517)) // token='for'
&&
(a = star_expressions_rule(p)) // star_expressions
)
@@ -23058,11 +23058,11 @@ invalid_import_rule(Parser *p)
Token * a;
expr_ty dotted_name_var;
if (
- (a = _PyPegen_expect_token(p, 651)) // token='import'
+ (a = _PyPegen_expect_token(p, 500)) // token='import'
&&
(_gather_136_var = _gather_136_rule(p)) // ','.dotted_name+
&&
- (_keyword = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword = _PyPegen_expect_token(p, 501)) // token='from'
&&
(dotted_name_var = dotted_name_rule(p)) // dotted_name
)
@@ -23089,7 +23089,7 @@ invalid_import_rule(Parser *p)
Token * _keyword;
Token * token;
if (
- (_keyword = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword = _PyPegen_expect_token(p, 500)) // token='import'
&&
(token = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
@@ -23138,7 +23138,7 @@ invalid_dotted_as_name_rule(Parser *p)
if (
(dotted_name_var = dotted_name_rule(p)) // dotted_name
&&
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
_PyPegen_lookahead(0, _tmp_137_rule, p)
&&
@@ -23189,7 +23189,7 @@ invalid_import_from_as_name_rule(Parser *p)
if (
(name_var = _PyPegen_name_token(p)) // NAME
&&
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
_PyPegen_lookahead(0, _tmp_137_rule, p)
&&
@@ -23242,7 +23242,7 @@ invalid_import_from_rule(Parser *p)
expr_ty dotted_name_var;
asdl_alias_seq* import_from_targets_var;
if (
- (_keyword = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword = _PyPegen_expect_token(p, 501)) // token='from'
&&
(_loop0_17_var = _loop0_17_rule(p)) // (('.' | '...'))*
&&
@@ -23250,7 +23250,7 @@ invalid_import_from_rule(Parser *p)
&&
(a = _PyPegen_expect_soft_keyword(p, "lazy")) //
soft_keyword='"lazy"'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword_1 = _PyPegen_expect_token(p, 500)) // token='import'
&&
(import_from_targets_var = import_from_targets_rule(p)) //
import_from_targets
)
@@ -23376,9 +23376,9 @@ invalid_with_stmt_rule(Parser *p)
UNUSED(_opt_var); // Silence compiler warnings
Token * trailing;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 516)) // token='with'
&&
(_gather_139_var = _gather_139_rule(p)) // ','.(expression ['as'
star_target])+
&&
@@ -23412,9 +23412,9 @@ invalid_with_stmt_rule(Parser *p)
UNUSED(_opt_var); // Silence compiler warnings
Token * newline_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 516)) // token='with'
&&
(_gather_139_var = _gather_139_rule(p)) // ','.(expression ['as'
star_target])+
&&
@@ -23450,9 +23450,9 @@ invalid_with_stmt_rule(Parser *p)
UNUSED(_opt_var_1); // Silence compiler warnings
Token * newline_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 516)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -23512,9 +23512,9 @@ invalid_with_stmt_indent_rule(Parser *p)
Token * a;
Token * newline_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 665)) // token='with'
+ (a = _PyPegen_expect_token(p, 516)) // token='with'
&&
(_gather_139_var = _gather_139_rule(p)) // ','.(expression ['as'
star_target])+
&&
@@ -23555,9 +23555,9 @@ invalid_with_stmt_indent_rule(Parser *p)
Token * a;
Token * newline_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 665)) // token='with'
+ (a = _PyPegen_expect_token(p, 516)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -23620,7 +23620,7 @@ invalid_try_stmt_rule(Parser *p)
Token * a;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 674)) // token='try'
+ (a = _PyPegen_expect_token(p, 518)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -23652,7 +23652,7 @@ invalid_try_stmt_rule(Parser *p)
Token * _literal;
asdl_stmt_seq* block_var;
if (
- (_keyword = _PyPegen_expect_token(p, 674)) // token='try'
+ (_keyword = _PyPegen_expect_token(p, 518)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -23691,7 +23691,7 @@ invalid_try_stmt_rule(Parser *p)
Token * b;
expr_ty expression_var;
if (
- (_keyword = _PyPegen_expect_token(p, 674)) // token='try'
+ (_keyword = _PyPegen_expect_token(p, 518)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -23699,7 +23699,7 @@ invalid_try_stmt_rule(Parser *p)
&&
(_loop1_36_var = _loop1_36_rule(p)) // except_block+
&&
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(b = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -23738,7 +23738,7 @@ invalid_try_stmt_rule(Parser *p)
UNUSED(_opt_var); // Silence compiler warnings
Token * a;
if (
- (_keyword = _PyPegen_expect_token(p, 674)) // token='try'
+ (_keyword = _PyPegen_expect_token(p, 518)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -23746,7 +23746,7 @@ invalid_try_stmt_rule(Parser *p)
&&
(_loop1_37_var = _loop1_37_rule(p)) // except_star_block+
&&
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_opt_var = _tmp_144_rule(p), !p->error_indicator) // [expression
['as' NAME]]
&&
@@ -23803,7 +23803,7 @@ invalid_except_stmt_rule(Parser *p)
expr_ty expressions_var;
expr_ty name_var;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(a = expression_rule(p)) // expression
&&
@@ -23811,7 +23811,7 @@ invalid_except_stmt_rule(Parser *p)
&&
(expressions_var = expressions_rule(p)) // expressions
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 520)) // token='as'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -23843,7 +23843,7 @@ invalid_except_stmt_rule(Parser *p)
expr_ty expression_var;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -23874,7 +23874,7 @@ invalid_except_stmt_rule(Parser *p)
Token * a;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) //
token='NEWLINE'
)
@@ -23905,11 +23905,11 @@ invalid_except_stmt_rule(Parser *p)
asdl_stmt_seq* block_var;
expr_ty expression_var;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(expression_var = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 520)) // token='as'
&&
(a = expression_rule(p)) // expression
&&
@@ -23969,7 +23969,7 @@ invalid_except_star_stmt_rule(Parser *p)
expr_ty expressions_var;
expr_ty name_var;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -23979,7 +23979,7 @@ invalid_except_star_stmt_rule(Parser *p)
&&
(expressions_var = expressions_rule(p)) // expressions
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 520)) // token='as'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -24012,7 +24012,7 @@ invalid_except_star_stmt_rule(Parser *p)
expr_ty expression_var;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -24046,7 +24046,7 @@ invalid_except_star_stmt_rule(Parser *p)
void *_tmp_145_var;
Token * a;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -24080,13 +24080,13 @@ invalid_except_star_stmt_rule(Parser *p)
asdl_stmt_seq* block_var;
expr_ty expression_var;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
(expression_var = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 520)) // token='as'
&&
(a = expression_rule(p)) // expression
&&
@@ -24137,7 +24137,7 @@ invalid_finally_stmt_rule(Parser *p)
Token * a;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 691)) // token='finally'
+ (a = _PyPegen_expect_token(p, 525)) // token='finally'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -24193,7 +24193,7 @@ invalid_except_stmt_indent_rule(Parser *p)
expr_ty expression_var;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -24229,7 +24229,7 @@ invalid_except_stmt_indent_rule(Parser *p)
Token * a;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -24285,7 +24285,7 @@ invalid_except_star_stmt_indent_rule(Parser *p)
expr_ty expression_var;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 524)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -24562,7 +24562,7 @@ invalid_as_pattern_rule(Parser *p)
if (
(or_pattern_var = or_pattern_rule(p)) // or_pattern
&&
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
(a = _PyPegen_expect_soft_keyword(p, "_")) // soft_keyword='"_"'
)
@@ -24592,7 +24592,7 @@ invalid_as_pattern_rule(Parser *p)
if (
(or_pattern_var = or_pattern_rule(p)) // or_pattern
&&
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
(a = expression_rule(p)) // expression
)
@@ -24808,7 +24808,7 @@ invalid_if_stmt_rule(Parser *p)
expr_ty named_expression_var;
Token * newline_var;
if (
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -24839,7 +24839,7 @@ invalid_if_stmt_rule(Parser *p)
expr_ty a_1;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 700)) // token='if'
+ (a = _PyPegen_expect_token(p, 514)) // token='if'
&&
(a_1 = named_expression_rule(p)) // named_expression
&&
@@ -24894,7 +24894,7 @@ invalid_elif_stmt_rule(Parser *p)
expr_ty named_expression_var;
Token * newline_var;
if (
- (_keyword = _PyPegen_expect_token(p, 705)) // token='elif'
+ (_keyword = _PyPegen_expect_token(p, 521)) // token='elif'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -24925,7 +24925,7 @@ invalid_elif_stmt_rule(Parser *p)
expr_ty named_expression_var;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 705)) // token='elif'
+ (a = _PyPegen_expect_token(p, 521)) // token='elif'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -24978,7 +24978,7 @@ invalid_else_stmt_rule(Parser *p)
Token * a;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 704)) // token='else'
+ (a = _PyPegen_expect_token(p, 522)) // token='else'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -25011,13 +25011,13 @@ invalid_else_stmt_rule(Parser *p)
Token * _literal;
asdl_stmt_seq* block_var;
if (
- (_keyword = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword = _PyPegen_expect_token(p, 522)) // token='else'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
(block_var = block_rule(p)) // block
&&
- (_keyword_1 = _PyPegen_expect_token(p, 705)) // token='elif'
+ (_keyword_1 = _PyPegen_expect_token(p, 521)) // token='elif'
)
{
D(fprintf(stderr, "%*c+ invalid_else_stmt[%d-%d]: %s
succeeded!\n", p->level, ' ', _mark, p->mark, "'else' ':' block 'elif'"));
@@ -25064,7 +25064,7 @@ invalid_while_stmt_rule(Parser *p)
expr_ty named_expression_var;
Token * newline_var;
if (
- (_keyword = _PyPegen_expect_token(p, 707)) // token='while'
+ (_keyword = _PyPegen_expect_token(p, 519)) // token='while'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -25095,7 +25095,7 @@ invalid_while_stmt_rule(Parser *p)
expr_ty named_expression_var;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 707)) // token='while'
+ (a = _PyPegen_expect_token(p, 519)) // token='while'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -25154,13 +25154,13 @@ invalid_for_stmt_rule(Parser *p)
expr_ty star_expressions_var;
expr_ty star_targets_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 517)) // token='for'
&&
(star_targets_var = star_targets_rule(p)) // star_targets
&&
- (_keyword_1 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_1 = _PyPegen_expect_token(p, 523)) // token='in'
&&
(star_expressions_var = star_expressions_rule(p)) //
star_expressions
&&
@@ -25195,13 +25195,13 @@ invalid_for_stmt_rule(Parser *p)
expr_ty star_expressions_var;
expr_ty star_targets_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 712)) // token='for'
+ (a = _PyPegen_expect_token(p, 517)) // token='for'
&&
(star_targets_var = star_targets_rule(p)) // star_targets
&&
- (_keyword = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword = _PyPegen_expect_token(p, 523)) // token='in'
&&
(star_expressions_var = star_expressions_rule(p)) //
star_expressions
&&
@@ -25267,9 +25267,9 @@ invalid_def_raw_rule(Parser *p)
expr_ty name_var;
Token * newline_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 717)) // token='def'
+ (a = _PyPegen_expect_token(p, 512)) // token='def'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -25326,9 +25326,9 @@ invalid_def_raw_rule(Parser *p)
asdl_stmt_seq* block_var;
expr_ty name_var;
if (
- (_opt_var = _PyPegen_expect_token(p, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 513), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 717)) // token='def'
+ (_keyword = _PyPegen_expect_token(p, 512)) // token='def'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -25392,7 +25392,7 @@ invalid_class_def_raw_rule(Parser *p)
expr_ty name_var;
Token * newline_var;
if (
- (_keyword = _PyPegen_expect_token(p, 719)) // token='class'
+ (_keyword = _PyPegen_expect_token(p, 515)) // token='class'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -25431,7 +25431,7 @@ invalid_class_def_raw_rule(Parser *p)
expr_ty name_var;
Token * newline_var;
if (
- (a = _PyPegen_expect_token(p, 719)) // token='class'
+ (a = _PyPegen_expect_token(p, 515)) // token='class'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -27072,7 +27072,7 @@ invalid_arithmetic_rule(Parser *p)
&&
(_tmp_155_var = _tmp_155_rule(p)) // '+' | '-' | '*' | '/' | '%'
| '//' | '@'
&&
- (a = _PyPegen_expect_token(p, 721)) // token='not'
+ (a = _PyPegen_expect_token(p, 531)) // token='not'
&&
(b = inversion_rule(p)) // inversion
)
@@ -27121,7 +27121,7 @@ invalid_factor_rule(Parser *p)
if (
(_tmp_156_var = _tmp_156_rule(p)) // '+' | '-' | '~'
&&
- (a = _PyPegen_expect_token(p, 721)) // token='not'
+ (a = _PyPegen_expect_token(p, 531)) // token='not'
&&
(b = factor_rule(p)) // factor
)
@@ -27587,7 +27587,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, 651)) // token='import'
+ (_keyword = _PyPegen_expect_token(p, 500)) // token='import'
)
{
D(fprintf(stderr, "%*c+ _tmp_5[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'import'"));
@@ -27606,7 +27606,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, 650)) // token='from'
+ (_keyword = _PyPegen_expect_token(p, 501)) // token='from'
)
{
D(fprintf(stderr, "%*c+ _tmp_5[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'from'"));
@@ -27663,7 +27663,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, 717)) // token='def'
+ (_keyword = _PyPegen_expect_token(p, 512)) // token='def'
)
{
D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'def'"));
@@ -27701,7 +27701,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, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
)
{
D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'async'"));
@@ -27739,7 +27739,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, 719)) // token='class'
+ (_keyword = _PyPegen_expect_token(p, 515)) // token='class'
)
{
D(fprintf(stderr, "%*c+ _tmp_7[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'class'"));
@@ -27796,7 +27796,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, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 516)) // token='with'
)
{
D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'with'"));
@@ -27815,7 +27815,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, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
)
{
D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'async'"));
@@ -27853,7 +27853,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, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 517)) // token='for'
)
{
D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'for'"));
@@ -27872,7 +27872,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, 716)) // token='async'
+ (_keyword = _PyPegen_expect_token(p, 513)) // token='async'
)
{
D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'async'"));
@@ -28528,7 +28528,7 @@ _tmp_21_rule(Parser *p)
Token * _keyword;
expr_ty z;
if (
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
(z = _PyPegen_name_token(p)) // NAME
)
@@ -33916,7 +33916,7 @@ _tmp_115_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_115[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'else'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword = _PyPegen_expect_token(p, 522)) // token='else'
)
{
D(fprintf(stderr, "%*c+ _tmp_115[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'else'"));
@@ -34163,7 +34163,7 @@ _tmp_118_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_118[%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, 527)) // token='True'
)
{
D(fprintf(stderr, "%*c+ _tmp_118[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'True'"));
@@ -34182,7 +34182,7 @@ _tmp_118_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_118[%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, 526)) // token='None'
)
{
D(fprintf(stderr, "%*c+ _tmp_118[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'None'"));
@@ -34201,7 +34201,7 @@ _tmp_118_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_118[%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, 528)) // token='False'
)
{
D(fprintf(stderr, "%*c+ _tmp_118[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'False'"));
@@ -35525,7 +35525,7 @@ _tmp_142_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_142[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'except'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 524)) // token='except'
)
{
D(fprintf(stderr, "%*c+ _tmp_142[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'except'"));
@@ -35544,7 +35544,7 @@ _tmp_142_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_142[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'finally'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 691)) // token='finally'
+ (_keyword = _PyPegen_expect_token(p, 525)) // token='finally'
)
{
D(fprintf(stderr, "%*c+ _tmp_142[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'finally'"));
@@ -36688,7 +36688,7 @@ _tmp_161_rule(Parser *p)
Token * _keyword;
expr_ty c;
if (
- (_keyword = _PyPegen_expect_token(p, 589)) // token='or'
+ (_keyword = _PyPegen_expect_token(p, 529)) // token='or'
&&
(c = conjunction_rule(p)) // conjunction
)
@@ -36734,7 +36734,7 @@ _tmp_162_rule(Parser *p)
Token * _keyword;
expr_ty c;
if (
- (_keyword = _PyPegen_expect_token(p, 590)) // token='and'
+ (_keyword = _PyPegen_expect_token(p, 530)) // token='and'
&&
(c = inversion_rule(p)) // inversion
)
@@ -36837,7 +36837,7 @@ _tmp_164_rule(Parser *p)
Token * _keyword;
expr_ty z;
if (
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 514)) // token='if'
&&
(z = disjunction_rule(p)) // disjunction
)
@@ -37564,7 +37564,7 @@ _tmp_178_rule(Parser *p)
Token * _keyword;
expr_ty star_target_var;
if (
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
(star_target_var = star_target_rule(p)) // star_target
)
diff --git a/Tools/peg_generator/pegen/parser_generator.py
b/Tools/peg_generator/pegen/parser_generator.py
index 18736be26a0fb8..65486aa972a068 100644
--- a/Tools/peg_generator/pegen/parser_generator.py
+++ b/Tools/peg_generator/pegen/parser_generator.py
@@ -62,8 +62,9 @@ def __init__(self, gen: "ParserGenerator", keywords:
dict[str, int], soft_keywor
def visit_StringLeaf(self, node: StringLeaf) -> None:
val = ast.literal_eval(node.value)
if re.match(r"[a-zA-Z_]\w*\Z", val): # This is a keyword
- if node.value.endswith("'") and node.value not in self.keywords:
- self.keywords[val] = self.generator.keyword_type()
+ if node.value.endswith("'"):
+ if val not in self.keywords:
+ self.keywords[val] = self.generator.keyword_type()
else:
return self.soft_keywords.add(node.value.replace('"', ""))
_______________________________________________
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]