https://github.com/python/cpython/commit/98d8ad94b88bb13052b435d47b38938ed073bd00
commit: 98d8ad94b88bb13052b435d47b38938ed073bd00
branch: 3.15
author: sobolevn <[email protected]>
committer: sobolevn <[email protected]>
date: 2026-10-25T21:24:25Z
summary:
[3.15] gh-152631: Fix `ast.parse` on lazy imports with older `feature_version`
(GH-152632) (#160681)
(cherry picked from commit 7b12a415c85d88eeb22a806b2bc9472d471b8e60)
files:
A
Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst
M Grammar/python.gram
M Lib/test/test_ast/test_ast.py
M Parser/parser.c
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 4408d69d9a06e1a..a8ac90d8b23c467 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -225,15 +225,25 @@ import_stmt[stmt_ty](memo):
# -----------------
import_name[stmt_ty]:
- | lazy="lazy"? 'import' a=dotted_as_names { _PyAST_Import(a, lazy ? 1 : 0,
EXTRA) }
+ | "lazy" 'import' a=dotted_as_names {
+ CHECK_VERSION(stmt_ty, 15, "Lazy imports are",
+ _PyAST_Import(a, 1, EXTRA)) }
+ | 'import' a=dotted_as_names { _PyAST_Import(a, 0, EXTRA) }
# note below: the ('.' | '...') is necessary because '...' is tokenized as
ELLIPSIS
import_from[stmt_ty]:
| invalid_import_from
- | lazy="lazy"? 'from' a=('.' | '...')* b=dotted_name 'import'
c=import_from_targets {
- _PyPegen_checked_from_import(p, a, b, c, lazy, EXTRA) }
- | lazy="lazy"? 'from' a=('.' | '...')+ 'import' b=import_from_targets {
- _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), lazy ? 1 : 0,
EXTRA) }
+ | lazy="lazy" 'from' a=('.' | '...')* b=dotted_name 'import'
c=import_from_targets {
+ CHECK_VERSION(stmt_ty, 15, "Lazy imports are",
+ _PyPegen_checked_from_import(p, a, b, c, lazy, EXTRA)) }
+ | "lazy" 'from' a=('.' | '...')+ 'import' b=import_from_targets {
+ CHECK_VERSION(stmt_ty, 15, "Lazy imports are",
+ _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), 1, EXTRA)) }
+ | 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets {
+ _PyPegen_checked_from_import(p, a, b, c, NULL, EXTRA) }
+ | 'from' a=('.' | '...')+ 'import' b=import_from_targets {
+ _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), 0, EXTRA) }
+
import_from_targets[asdl_alias_seq*]:
| '(' a=import_from_as_names [','] ')' { a }
| import_from_as_names !','
diff --git a/Lib/test/test_ast/test_ast.py b/Lib/test/test_ast/test_ast.py
index faafd98b5d5f96d..477a70edb4ea8f8 100644
--- a/Lib/test/test_ast/test_ast.py
+++ b/Lib/test/test_ast/test_ast.py
@@ -973,6 +973,19 @@ def test_type_params_default_feature_version(self):
with self.assertRaises(SyntaxError):
ast.parse(sample, feature_version=(3, 12))
+ def test_lazy_imports_feature_version(self):
+ samples = [
+ "lazy import os",
+ "lazy from .. import name",
+ "lazy from mod import some",
+ ]
+ for sample in samples:
+ with self.subTest(sample):
+ ast.parse(sample)
+ ast.parse(sample, feature_version=(3, 15))
+ with self.assertRaises(SyntaxError):
+ ast.parse(sample, feature_version=(3, 14))
+
def test_invalid_major_feature_version(self):
with self.assertRaises(ValueError):
ast.parse('pass', feature_version=(2, 7))
diff --git
a/Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst
b/Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst
new file mode 100644
index 000000000000000..51208108f10647b
--- /dev/null
+++
b/Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-01-07.gh-issue-152631.LKgCM_.rst
@@ -0,0 +1,2 @@
+Fix :func:`ast.parse` ability to parse lazy imports with *feature_version*
+older than 3.15, now it properly raises :exc:`SyntaxError`.
diff --git a/Parser/parser.c b/Parser/parser.c
index bc4219bae2851ca..14e7f8774859f97 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -22,54 +22,54 @@ static KeywordToken *reserved_keywords[] = {
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {{NULL, -1}},
(KeywordToken[]) {
- {"if", 700},
- {"as", 698},
- {"in", 713},
- {"or", 589},
- {"is", 597},
+ {"if", 705},
+ {"as", 703},
+ {"in", 718},
+ {"or", 594},
+ {"is", 602},
{NULL, -1},
},
(KeywordToken[]) {
- {"del", 634},
- {"def", 717},
- {"for", 712},
- {"try", 674},
- {"and", 590},
- {"not", 721},
+ {"del", 639},
+ {"def", 722},
+ {"for", 717},
+ {"try", 679},
+ {"and", 595},
+ {"not", 726},
{NULL, -1},
},
(KeywordToken[]) {
- {"from", 650},
+ {"from", 655},
{"pass", 527},
- {"with", 665},
- {"elif", 705},
- {"else", 704},
- {"None", 628},
- {"True", 627},
+ {"with", 670},
+ {"elif", 710},
+ {"else", 709},
+ {"None", 633},
+ {"True", 632},
{NULL, -1},
},
(KeywordToken[]) {
- {"raise", 632},
- {"yield", 588},
+ {"raise", 637},
+ {"yield", 593},
{"break", 528},
- {"async", 716},
- {"class", 719},
- {"while", 707},
- {"False", 629},
- {"await", 598},
+ {"async", 721},
+ {"class", 724},
+ {"while", 712},
+ {"False", 634},
+ {"await", 603},
{NULL, -1},
},
(KeywordToken[]) {
- {"import", 651},
+ {"import", 656},
{"return", 522},
- {"assert", 638},
+ {"assert", 643},
{"global", 530},
- {"except", 695},
- {"lambda", 622},
+ {"except", 700},
+ {"lambda", 627},
{NULL, -1},
},
(KeywordToken[]) {
- {"finally", 691},
+ {"finally", 696},
{NULL, -1},
},
(KeywordToken[]) {
@@ -1730,7 +1730,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'raise' raise_stmt"));
stmt_ty raise_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 632) //
token='raise'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 637) //
token='raise'
&&
(raise_stmt_var = raise_stmt_rule(p)) // raise_stmt
)
@@ -1772,7 +1772,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'del' del_stmt"));
stmt_ty del_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 634) //
token='del'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 639) //
token='del'
&&
(del_stmt_var = del_stmt_rule(p)) // del_stmt
)
@@ -1793,7 +1793,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'yield' yield_stmt"));
stmt_ty yield_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 588) //
token='yield'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 593) //
token='yield'
&&
(yield_stmt_var = yield_stmt_rule(p)) // yield_stmt
)
@@ -1814,7 +1814,7 @@ simple_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'assert' assert_stmt"));
stmt_ty assert_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 638) //
token='assert'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 643) //
token='assert'
&&
(assert_stmt_var = assert_stmt_rule(p)) // assert_stmt
)
@@ -1968,7 +1968,7 @@ compound_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'if' if_stmt"));
stmt_ty if_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 700) //
token='if'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 705) //
token='if'
&&
(if_stmt_var = if_stmt_rule(p)) // if_stmt
)
@@ -2052,7 +2052,7 @@ compound_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'try' try_stmt"));
stmt_ty try_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 674) //
token='try'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 679) //
token='try'
&&
(try_stmt_var = try_stmt_rule(p)) // try_stmt
)
@@ -2073,7 +2073,7 @@ compound_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "&'while' while_stmt"));
stmt_ty while_stmt_var;
if (
- _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 707) //
token='while'
+ _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 712) //
token='while'
&&
(while_stmt_var = while_stmt_rule(p)) // while_stmt
)
@@ -2836,11 +2836,11 @@ raise_stmt_rule(Parser *p)
expr_ty a;
expr_ty b;
if (
- (_keyword = _PyPegen_expect_token(p, 632)) // token='raise'
+ (_keyword = _PyPegen_expect_token(p, 637)) // token='raise'
&&
(a = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword_1 = _PyPegen_expect_token(p, 655)) // token='from'
&&
(b = expression_rule(p)) // expression
)
@@ -2895,7 +2895,7 @@ raise_stmt_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 632)) // token='raise'
+ (_keyword = _PyPegen_expect_token(p, 637)) // token='raise'
&&
(a = expression_rule(p)) // expression
)
@@ -2930,7 +2930,7 @@ raise_stmt_rule(Parser *p)
D(fprintf(stderr, "%*c> raise_stmt[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'raise'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 632)) // token='raise'
+ (_keyword = _PyPegen_expect_token(p, 637)) // token='raise'
)
{
D(fprintf(stderr, "%*c+ raise_stmt[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'raise'"));
@@ -3303,7 +3303,7 @@ del_stmt_rule(Parser *p)
Token * _keyword;
asdl_expr_seq* a;
if (
- (_keyword = _PyPegen_expect_token(p, 634)) // token='del'
+ (_keyword = _PyPegen_expect_token(p, 639)) // token='del'
&&
(a = del_targets_rule(p)) // del_targets
&&
@@ -3469,7 +3469,7 @@ assert_stmt_rule(Parser *p)
expr_ty a;
void *b;
if (
- (_keyword = _PyPegen_expect_token(p, 638)) // token='assert'
+ (_keyword = _PyPegen_expect_token(p, 643)) // token='assert'
&&
(a = expression_rule(p)) // expression
&&
@@ -3585,7 +3585,7 @@ import_stmt_rule(Parser *p)
return _res;
}
-// import_name: "lazy"? 'import' dotted_as_names
+// import_name: "lazy" 'import' dotted_as_names | 'import' dotted_as_names
static stmt_ty
import_name_rule(Parser *p)
{
@@ -3607,24 +3607,60 @@ import_name_rule(Parser *p)
UNUSED(_start_lineno); // Only used by EXTRA macro
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
- { // "lazy"? 'import' dotted_as_names
+ { // "lazy" 'import' dotted_as_names
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "\"lazy\"? 'import' dotted_as_names"));
- Token * _keyword;
+ D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "\"lazy\" 'import' dotted_as_names"));
+ expr_ty _keyword;
+ Token * _keyword_1;
asdl_alias_seq* a;
- void *lazy;
if (
- (lazy = _PyPegen_expect_soft_keyword(p, "lazy"),
!p->error_indicator) // "lazy"?
+ (_keyword = _PyPegen_expect_soft_keyword(p, "lazy")) //
soft_keyword='"lazy"'
&&
- (_keyword = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword_1 = _PyPegen_expect_token(p, 656)) // token='import'
+ &&
+ (a = dotted_as_names_rule(p)) // dotted_as_names
+ )
+ {
+ D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "\"lazy\" 'import' dotted_as_names"));
+ Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
+ if (_token == NULL) {
+ p->level--;
+ return NULL;
+ }
+ int _end_lineno = _token->end_lineno;
+ UNUSED(_end_lineno); // Only used by EXTRA macro
+ int _end_col_offset = _token->end_col_offset;
+ UNUSED(_end_col_offset); // Only used by EXTRA macro
+ _res = CHECK_VERSION ( stmt_ty , 15 , "Lazy imports are" ,
_PyAST_Import ( a , 1 , EXTRA ) );
+ if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) {
+ p->error_indicator = 1;
+ p->level--;
+ return NULL;
+ }
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s import_name[%d-%d]: %s failed!\n", p->level,
' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"\"lazy\" 'import' dotted_as_names"));
+ }
+ { // 'import' dotted_as_names
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'import' dotted_as_names"));
+ Token * _keyword;
+ asdl_alias_seq* a;
+ if (
+ (_keyword = _PyPegen_expect_token(p, 656)) // token='import'
&&
(a = dotted_as_names_rule(p)) // dotted_as_names
)
{
- D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "\"lazy\"? 'import' dotted_as_names"));
+ D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'import' dotted_as_names"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
@@ -3634,7 +3670,7 @@ import_name_rule(Parser *p)
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
- _res = _PyAST_Import ( a , lazy ? 1 : 0 , EXTRA );
+ _res = _PyAST_Import ( a , 0 , EXTRA );
if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
@@ -3644,7 +3680,7 @@ import_name_rule(Parser *p)
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s import_name[%d-%d]: %s failed!\n", p->level,
' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"\"lazy\"? 'import' dotted_as_names"));
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"'import' dotted_as_names"));
}
_res = NULL;
done:
@@ -3654,8 +3690,10 @@ import_name_rule(Parser *p)
// import_from:
// | invalid_import_from
-// | "lazy"? 'from' (('.' | '...'))* dotted_name 'import'
import_from_targets
-// | "lazy"? 'from' (('.' | '...'))+ 'import' import_from_targets
+// | "lazy" 'from' (('.' | '...'))* dotted_name 'import'
import_from_targets
+// | "lazy" 'from' (('.' | '...'))+ 'import' import_from_targets
+// | 'from' (('.' | '...'))* dotted_name 'import' import_from_targets
+// | 'from' (('.' | '...'))+ 'import' import_from_targets
static stmt_ty
import_from_rule(Parser *p)
{
@@ -3696,33 +3734,33 @@ import_from_rule(Parser *p)
D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level,
' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"invalid_import_from"));
}
- { // "lazy"? 'from' (('.' | '...'))* dotted_name 'import'
import_from_targets
+ { // "lazy" 'from' (('.' | '...'))* dotted_name 'import'
import_from_targets
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))* dotted_name 'import'
import_from_targets"));
+ D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "\"lazy\" 'from' (('.' | '...'))* dotted_name 'import'
import_from_targets"));
Token * _keyword;
Token * _keyword_1;
asdl_seq * a;
expr_ty b;
asdl_alias_seq* c;
- void *lazy;
+ expr_ty lazy;
if (
- (lazy = _PyPegen_expect_soft_keyword(p, "lazy"),
!p->error_indicator) // "lazy"?
+ (lazy = _PyPegen_expect_soft_keyword(p, "lazy")) //
soft_keyword='"lazy"'
&&
- (_keyword = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword = _PyPegen_expect_token(p, 655)) // 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, 656)) // token='import'
&&
(c = import_from_targets_rule(p)) // import_from_targets
)
{
- D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))* dotted_name
'import' import_from_targets"));
+ D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))* dotted_name
'import' import_from_targets"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
@@ -3732,7 +3770,7 @@ import_from_rule(Parser *p)
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
- _res = _PyPegen_checked_from_import ( p , a , b , c , lazy , EXTRA
);
+ _res = CHECK_VERSION ( stmt_ty , 15 , "Lazy imports are" ,
_PyPegen_checked_from_import ( p , a , b , c , lazy , EXTRA ) );
if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
@@ -3742,32 +3780,119 @@ import_from_rule(Parser *p)
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level,
' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"\"lazy\"? 'from' (('.' | '...'))* dotted_name 'import' import_from_targets"));
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"\"lazy\" 'from' (('.' | '...'))* dotted_name 'import' import_from_targets"));
}
- { // "lazy"? 'from' (('.' | '...'))+ 'import' import_from_targets
+ { // "lazy" 'from' (('.' | '...'))+ 'import' import_from_targets
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))+ 'import'
import_from_targets"));
- Token * _keyword;
+ D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "\"lazy\" 'from' (('.' | '...'))+ 'import'
import_from_targets"));
+ expr_ty _keyword;
Token * _keyword_1;
+ Token * _keyword_2;
asdl_seq * a;
asdl_alias_seq* b;
- void *lazy;
if (
- (lazy = _PyPegen_expect_soft_keyword(p, "lazy"),
!p->error_indicator) // "lazy"?
+ (_keyword = _PyPegen_expect_soft_keyword(p, "lazy")) //
soft_keyword='"lazy"'
+ &&
+ (_keyword_1 = _PyPegen_expect_token(p, 655)) // token='from'
+ &&
+ (a = _loop1_18_rule(p)) // (('.' | '...'))+
+ &&
+ (_keyword_2 = _PyPegen_expect_token(p, 656)) // token='import'
&&
- (_keyword = _PyPegen_expect_token(p, 650)) // token='from'
+ (b = import_from_targets_rule(p)) // import_from_targets
+ )
+ {
+ D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "\"lazy\" 'from' (('.' | '...'))+ 'import'
import_from_targets"));
+ Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
+ if (_token == NULL) {
+ p->level--;
+ return NULL;
+ }
+ int _end_lineno = _token->end_lineno;
+ UNUSED(_end_lineno); // Only used by EXTRA macro
+ int _end_col_offset = _token->end_col_offset;
+ UNUSED(_end_col_offset); // Only used by EXTRA macro
+ _res = CHECK_VERSION ( stmt_ty , 15 , "Lazy imports are" ,
_PyAST_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , 1 , EXTRA ) );
+ if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) {
+ p->error_indicator = 1;
+ p->level--;
+ return NULL;
+ }
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level,
' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"\"lazy\" 'from' (('.' | '...'))+ 'import' import_from_targets"));
+ }
+ { // 'from' (('.' | '...'))* dotted_name 'import' import_from_targets
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import'
import_from_targets"));
+ Token * _keyword;
+ Token * _keyword_1;
+ asdl_seq * a;
+ expr_ty b;
+ asdl_alias_seq* c;
+ if (
+ (_keyword = _PyPegen_expect_token(p, 655)) // token='from'
+ &&
+ (a = _loop0_17_rule(p)) // (('.' | '...'))*
+ &&
+ (b = dotted_name_rule(p)) // dotted_name
+ &&
+ (_keyword_1 = _PyPegen_expect_token(p, 656)) // token='import'
+ &&
+ (c = import_from_targets_rule(p)) // import_from_targets
+ )
+ {
+ D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import'
import_from_targets"));
+ Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
+ if (_token == NULL) {
+ p->level--;
+ return NULL;
+ }
+ int _end_lineno = _token->end_lineno;
+ UNUSED(_end_lineno); // Only used by EXTRA macro
+ int _end_col_offset = _token->end_col_offset;
+ UNUSED(_end_col_offset); // Only used by EXTRA macro
+ _res = _PyPegen_checked_from_import ( p , a , b , c , NULL , EXTRA
);
+ if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) {
+ p->error_indicator = 1;
+ p->level--;
+ return NULL;
+ }
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level,
' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from'
(('.' | '...'))* dotted_name 'import' import_from_targets"));
+ }
+ { // 'from' (('.' | '...'))+ 'import' import_from_targets
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets"));
+ Token * _keyword;
+ Token * _keyword_1;
+ asdl_seq * a;
+ asdl_alias_seq* b;
+ if (
+ (_keyword = _PyPegen_expect_token(p, 655)) // token='from'
&&
(a = _loop1_18_rule(p)) // (('.' | '...'))+
&&
- (_keyword_1 = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword_1 = _PyPegen_expect_token(p, 656)) // token='import'
&&
(b = import_from_targets_rule(p)) // import_from_targets
)
{
- D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "\"lazy\"? 'from' (('.' | '...'))+ 'import'
import_from_targets"));
+ D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))+ 'import'
import_from_targets"));
Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);
if (_token == NULL) {
p->level--;
@@ -3777,7 +3902,7 @@ import_from_rule(Parser *p)
UNUSED(_end_lineno); // Only used by EXTRA macro
int _end_col_offset = _token->end_col_offset;
UNUSED(_end_col_offset); // Only used by EXTRA macro
- _res = _PyAST_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a
) , lazy ? 1 : 0 , EXTRA );
+ _res = _PyAST_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a
) , 0 , EXTRA );
if ((_res == NULL || p->error_indicator) && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
@@ -3787,7 +3912,7 @@ import_from_rule(Parser *p)
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level,
' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark,
"\"lazy\"? 'from' (('.' | '...'))+ 'import' import_from_targets"));
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from'
(('.' | '...'))+ 'import' import_from_targets"));
}
_res = NULL;
done:
@@ -4549,7 +4674,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, 724)) // token='class'
&&
(a = _PyPegen_name_token(p)) // NAME
&&
@@ -4716,7 +4841,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, 722)) // token='def'
&&
(n = _PyPegen_name_token(p)) // NAME
&&
@@ -4777,9 +4902,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, 721)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 717)) // token='def'
+ (_keyword_1 = _PyPegen_expect_token(p, 722)) // token='def'
&&
(n = _PyPegen_name_token(p)) // NAME
&&
@@ -6117,7 +6242,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, 705)) // token='if'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6162,7 +6287,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, 705)) // token='if'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6257,7 +6382,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, 710)) // token='elif'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6302,7 +6427,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, 710)) // token='elif'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6383,7 +6508,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, 709)) // token='else'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -6462,7 +6587,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, 712)) // token='while'
&&
(a = named_expression_rule(p)) // named_expression
&&
@@ -6562,11 +6687,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, 717)) // token='for'
&&
(t = star_targets_rule(p)) // star_targets
&&
- (_keyword_1 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_1 = _PyPegen_expect_token(p, 718)) // token='in'
&&
(_cut_var = 1)
&&
@@ -6624,13 +6749,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, 721)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword_1 = _PyPegen_expect_token(p, 717)) // token='for'
&&
(t = star_targets_rule(p)) // star_targets
&&
- (_keyword_2 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_2 = _PyPegen_expect_token(p, 718)) // token='in'
&&
(_cut_var = 1)
&&
@@ -6759,7 +6884,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, 670)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -6810,7 +6935,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, 670)) // token='with'
&&
(a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+
&&
@@ -6859,9 +6984,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, 721)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword_1 = _PyPegen_expect_token(p, 670)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -6911,9 +7036,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, 721)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword_1 = _PyPegen_expect_token(p, 670)) // token='with'
&&
(a = (asdl_withitem_seq*)_gather_34_rule(p)) // ','.with_item+
&&
@@ -6999,7 +7124,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, 703)) // token='as'
&&
(t = star_target_rule(p)) // star_target
&&
@@ -7124,7 +7249,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, 679)) // token='try'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -7168,7 +7293,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, 679)) // token='try'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -7216,7 +7341,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, 679)) // token='try'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -7315,7 +7440,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, 700)) // token='except'
&&
(e = expression_rule(p)) // expression
&&
@@ -7359,11 +7484,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, 700)) // token='except'
&&
(e = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 703)) // token='as'
&&
(t = _PyPegen_name_token(p)) // NAME
&&
@@ -7405,7 +7530,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, 700)) // token='except'
&&
(e = expressions_rule(p)) // expressions
&&
@@ -7446,7 +7571,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, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -7558,7 +7683,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, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -7605,13 +7730,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, 700)) // 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, 703)) // token='as'
&&
(t = _PyPegen_name_token(p)) // NAME
&&
@@ -7654,7 +7779,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, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -7754,7 +7879,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, 696)) // token='finally'
&&
(_literal = _PyPegen_expect_forced_token(p, 11, ":")) //
forced_token=':'
&&
@@ -8062,7 +8187,7 @@ guard_rule(Parser *p)
Token * _keyword;
expr_ty guard;
if (
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(guard = named_expression_rule(p)) // named_expression
)
@@ -8257,7 +8382,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, 703)) // token='as'
&&
(target = pattern_capture_target_rule(p)) //
pattern_capture_target
)
@@ -8691,7 +8816,7 @@ literal_pattern_rule(Parser *p)
D(fprintf(stderr, "%*c> literal_pattern[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'None'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 628)) // token='None'
+ (_keyword = _PyPegen_expect_token(p, 633)) // token='None'
)
{
D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'None'"));
@@ -8724,7 +8849,7 @@ literal_pattern_rule(Parser *p)
D(fprintf(stderr, "%*c> literal_pattern[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'True'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 627)) // token='True'
+ (_keyword = _PyPegen_expect_token(p, 632)) // token='True'
)
{
D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'True'"));
@@ -8757,7 +8882,7 @@ literal_pattern_rule(Parser *p)
D(fprintf(stderr, "%*c> literal_pattern[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'False'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 629)) // token='False'
+ (_keyword = _PyPegen_expect_token(p, 634)) // token='False'
)
{
D(fprintf(stderr, "%*c+ literal_pattern[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'False'"));
@@ -8885,7 +9010,7 @@ literal_expr_rule(Parser *p)
D(fprintf(stderr, "%*c> literal_expr[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'None'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 628)) // token='None'
+ (_keyword = _PyPegen_expect_token(p, 633)) // token='None'
)
{
D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'None'"));
@@ -8918,7 +9043,7 @@ literal_expr_rule(Parser *p)
D(fprintf(stderr, "%*c> literal_expr[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'True'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 627)) // token='True'
+ (_keyword = _PyPegen_expect_token(p, 632)) // token='True'
)
{
D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'True'"));
@@ -8951,7 +9076,7 @@ literal_expr_rule(Parser *p)
D(fprintf(stderr, "%*c> literal_expr[%d-%d]: %s\n", p->level, ' ',
_mark, p->mark, "'False'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 629)) // token='False'
+ (_keyword = _PyPegen_expect_token(p, 634)) // token='False'
)
{
D(fprintf(stderr, "%*c+ literal_expr[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'False'"));
@@ -11743,11 +11868,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, 705)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 709)) // token='else'
&&
(c = expression_rule(p)) // expression
)
@@ -11812,9 +11937,9 @@ yield_expr_rule(Parser *p)
Token * _keyword_1;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 588)) // token='yield'
+ (_keyword = _PyPegen_expect_token(p, 593)) // token='yield'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword_1 = _PyPegen_expect_token(p, 655)) // token='from'
&&
(a = expression_rule(p)) // expression
)
@@ -11850,7 +11975,7 @@ yield_expr_rule(Parser *p)
Token * _keyword;
void *a;
if (
- (_keyword = _PyPegen_expect_token(p, 588)) // token='yield'
+ (_keyword = _PyPegen_expect_token(p, 593)) // token='yield'
&&
(a = star_expressions_rule(p), !p->error_indicator) //
star_expressions?
)
@@ -12696,7 +12821,7 @@ inversion_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 721)) // token='not'
+ (_keyword = _PyPegen_expect_token(p, 726)) // token='not'
&&
(a = inversion_rule(p)) // inversion
)
@@ -13370,9 +13495,9 @@ notin_bitwise_or_rule(Parser *p)
Token * _keyword_1;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 721)) // token='not'
+ (_keyword = _PyPegen_expect_token(p, 726)) // token='not'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_1 = _PyPegen_expect_token(p, 718)) // token='in'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -13418,7 +13543,7 @@ in_bitwise_or_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword = _PyPegen_expect_token(p, 718)) // token='in'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -13465,9 +13590,9 @@ isnot_bitwise_or_rule(Parser *p)
Token * _keyword_1;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 597)) // token='is'
+ (_keyword = _PyPegen_expect_token(p, 602)) // token='is'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 721)) // token='not'
+ (_keyword_1 = _PyPegen_expect_token(p, 726)) // token='not'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -13513,7 +13638,7 @@ is_bitwise_or_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 597)) // token='is'
+ (_keyword = _PyPegen_expect_token(p, 602)) // token='is'
&&
(a = bitwise_or_rule(p)) // bitwise_or
)
@@ -14829,7 +14954,7 @@ await_primary_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 598)) // token='await'
+ (_keyword = _PyPegen_expect_token(p, 603)) // token='await'
&&
(a = primary_rule(p)) // primary
)
@@ -15373,7 +15498,7 @@ atom_rule(Parser *p)
D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'True'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 627)) // token='True'
+ (_keyword = _PyPegen_expect_token(p, 632)) // token='True'
)
{
D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, '
', _mark, p->mark, "'True'"));
@@ -15406,7 +15531,7 @@ atom_rule(Parser *p)
D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'False'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 629)) // token='False'
+ (_keyword = _PyPegen_expect_token(p, 634)) // token='False'
)
{
D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, '
', _mark, p->mark, "'False'"));
@@ -15439,7 +15564,7 @@ atom_rule(Parser *p)
D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'None'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 628)) // token='None'
+ (_keyword = _PyPegen_expect_token(p, 633)) // token='None'
)
{
D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, '
', _mark, p->mark, "'None'"));
@@ -15707,7 +15832,7 @@ lambdef_rule(Parser *p)
void *a;
expr_ty b;
if (
- (_keyword = _PyPegen_expect_token(p, 622)) // token='lambda'
+ (_keyword = _PyPegen_expect_token(p, 627)) // token='lambda'
&&
(a = lambda_params_rule(p), !p->error_indicator) // lambda_params?
&&
@@ -18126,13 +18251,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, 721)) // token='async'
&&
- (_keyword_1 = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword_1 = _PyPegen_expect_token(p, 717)) // token='for'
&&
(a = star_targets_rule(p)) // star_targets
&&
- (_keyword_2 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_2 = _PyPegen_expect_token(p, 718)) // token='in'
&&
(_cut_var = 1)
&&
@@ -18171,11 +18296,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, 717)) // token='for'
&&
(a = star_targets_rule(p)) // star_targets
&&
- (_keyword_1 = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword_1 = _PyPegen_expect_token(p, 718)) // token='in'
&&
(_cut_var = 1)
&&
@@ -21502,11 +21627,11 @@ expression_without_invalid_rule(Parser *p)
if (
(a = disjunction_rule(p)) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 709)) // token='else'
&&
(c = expression_rule(p)) // expression
)
@@ -21806,7 +21931,7 @@ invalid_expression_rule(Parser *p)
if (
(a = disjunction_rule(p)) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
@@ -21839,11 +21964,11 @@ invalid_expression_rule(Parser *p)
if (
(a = disjunction_rule(p)) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 709)) // token='else'
&&
_PyPegen_lookahead_for_expr(0, expression_rule, p)
)
@@ -21875,11 +22000,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, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 709)) // token='else'
&&
(c = simple_stmt_rule(p)) // simple_stmt
)
@@ -21908,7 +22033,7 @@ invalid_expression_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 622)) // token='lambda'
+ (a = _PyPegen_expect_token(p, 627)) // token='lambda'
&&
(_opt_var = lambda_params_rule(p), !p->error_indicator) //
lambda_params?
&&
@@ -21941,7 +22066,7 @@ invalid_expression_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 622)) // token='lambda'
+ (a = _PyPegen_expect_token(p, 627)) // token='lambda'
&&
(_opt_var = lambda_params_rule(p), !p->error_indicator) //
lambda_params?
&&
@@ -21998,11 +22123,11 @@ invalid_if_expression_rule(Parser *p)
if (
(disjunction_var = disjunction_rule(p)) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 709)) // token='else'
&&
(a = _PyPegen_expect_token(p, 16)) // token='*'
)
@@ -22034,11 +22159,11 @@ invalid_if_expression_rule(Parser *p)
if (
(disjunction_var = disjunction_rule(p)) // disjunction
&&
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(b = disjunction_rule(p)) // disjunction
&&
- (_keyword_1 = _PyPegen_expect_token(p, 704)) // token='else'
+ (_keyword_1 = _PyPegen_expect_token(p, 709)) // token='else'
&&
(a = _PyPegen_expect_token(p, 35)) // token='**'
)
@@ -22505,9 +22630,9 @@ invalid_raise_stmt_rule(Parser *p)
Token * a;
Token * b;
if (
- (a = _PyPegen_expect_token(p, 632)) // token='raise'
+ (a = _PyPegen_expect_token(p, 637)) // token='raise'
&&
- (b = _PyPegen_expect_token(p, 650)) // token='from'
+ (b = _PyPegen_expect_token(p, 655)) // token='from'
)
{
D(fprintf(stderr, "%*c+ invalid_raise_stmt[%d-%d]: %s
succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' 'from'"));
@@ -22533,11 +22658,11 @@ invalid_raise_stmt_rule(Parser *p)
Token * a;
expr_ty expression_var;
if (
- (_keyword = _PyPegen_expect_token(p, 632)) // token='raise'
+ (_keyword = _PyPegen_expect_token(p, 637)) // token='raise'
&&
(expression_var = expression_rule(p)) // expression
&&
- (a = _PyPegen_expect_token(p, 650)) // token='from'
+ (a = _PyPegen_expect_token(p, 655)) // token='from'
)
{
D(fprintf(stderr, "%*c+ invalid_raise_stmt[%d-%d]: %s
succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' expression 'from'"));
@@ -22581,7 +22706,7 @@ invalid_del_stmt_rule(Parser *p)
Token * _keyword;
expr_ty a;
if (
- (_keyword = _PyPegen_expect_token(p, 634)) // token='del'
+ (_keyword = _PyPegen_expect_token(p, 639)) // token='del'
&&
(a = star_expressions_rule(p)) // star_expressions
)
@@ -22633,7 +22758,7 @@ invalid_assert_stmt_rule(Parser *p)
expr_ty a;
expr_ty b;
if (
- (_keyword = _PyPegen_expect_token(p, 638)) // token='assert'
+ (_keyword = _PyPegen_expect_token(p, 643)) // token='assert'
&&
(a = expression_rule(p)) // expression
&&
@@ -22668,7 +22793,7 @@ invalid_assert_stmt_rule(Parser *p)
expr_ty b;
expr_ty expression_var;
if (
- (_keyword = _PyPegen_expect_token(p, 638)) // token='assert'
+ (_keyword = _PyPegen_expect_token(p, 643)) // token='assert'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -22705,7 +22830,7 @@ invalid_assert_stmt_rule(Parser *p)
expr_ty a;
expr_ty b;
if (
- (_keyword = _PyPegen_expect_token(p, 638)) // token='assert'
+ (_keyword = _PyPegen_expect_token(p, 643)) // token='assert'
&&
(a = expression_rule(p)) // expression
&&
@@ -22740,7 +22865,7 @@ invalid_assert_stmt_rule(Parser *p)
expr_ty b;
expr_ty expression_var;
if (
- (_keyword = _PyPegen_expect_token(p, 638)) // token='assert'
+ (_keyword = _PyPegen_expect_token(p, 643)) // token='assert'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -24166,7 +24291,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, 703)) // token='as'
&&
(a = expression_rule(p)) // expression
&&
@@ -24216,13 +24341,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, 716), !p->error_indicator)
// 'async'?
+ (_opt_var = _PyPegen_expect_token(p, 721), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 717)) // token='for'
&&
(_tmp_136_var = _tmp_136_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, 718) //
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'"));
@@ -24268,9 +24393,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, 721), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 717)) // token='for'
&&
(a = star_expressions_rule(p)) // star_expressions
)
@@ -24400,11 +24525,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, 656)) // token='import'
&&
(_gather_138_var = _gather_138_rule(p)) // ','.dotted_name+
&&
- (_keyword = _PyPegen_expect_token(p, 650)) // token='from'
+ (_keyword = _PyPegen_expect_token(p, 655)) // token='from'
&&
(dotted_name_var = dotted_name_rule(p)) // dotted_name
)
@@ -24431,7 +24556,7 @@ invalid_import_rule(Parser *p)
Token * _keyword;
Token * token;
if (
- (_keyword = _PyPegen_expect_token(p, 651)) // token='import'
+ (_keyword = _PyPegen_expect_token(p, 656)) // token='import'
&&
(token = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
@@ -24480,7 +24605,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, 703)) // token='as'
&&
_PyPegen_lookahead(0, _tmp_139_rule, p)
&&
@@ -24531,7 +24656,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, 703)) // token='as'
&&
_PyPegen_lookahead(0, _tmp_139_rule, p)
&&
@@ -24584,7 +24709,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, 655)) // token='from'
&&
(_loop0_17_var = _loop0_17_rule(p)) // (('.' | '...'))*
&&
@@ -24592,7 +24717,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, 656)) // token='import'
&&
(import_from_targets_var = import_from_targets_rule(p)) //
import_from_targets
)
@@ -24718,9 +24843,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, 721), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 670)) // token='with'
&&
(_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as'
star_target])+
&&
@@ -24754,9 +24879,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, 721), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 670)) // token='with'
&&
(_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as'
star_target])+
&&
@@ -24792,9 +24917,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, 721), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 665)) // token='with'
+ (_keyword = _PyPegen_expect_token(p, 670)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -24854,9 +24979,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, 721), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 665)) // token='with'
+ (a = _PyPegen_expect_token(p, 670)) // token='with'
&&
(_gather_141_var = _gather_141_rule(p)) // ','.(expression ['as'
star_target])+
&&
@@ -24897,9 +25022,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, 721), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 665)) // token='with'
+ (a = _PyPegen_expect_token(p, 670)) // token='with'
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
@@ -24962,7 +25087,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, 679)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -24994,7 +25119,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, 679)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -25033,7 +25158,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, 679)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -25041,7 +25166,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, 700)) // token='except'
&&
(b = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -25080,7 +25205,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, 679)) // token='try'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -25088,7 +25213,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, 700)) // token='except'
&&
(_opt_var = _tmp_146_rule(p), !p->error_indicator) // [expression
['as' NAME]]
&&
@@ -25145,7 +25270,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, 700)) // token='except'
&&
(a = expression_rule(p)) // expression
&&
@@ -25153,7 +25278,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, 703)) // token='as'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -25185,7 +25310,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, 700)) // token='except'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -25216,7 +25341,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, 700)) // token='except'
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) //
token='NEWLINE'
)
@@ -25247,11 +25372,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, 700)) // token='except'
&&
(expression_var = expression_rule(p)) // expression
&&
- (_keyword_1 = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword_1 = _PyPegen_expect_token(p, 703)) // token='as'
&&
(a = expression_rule(p)) // expression
&&
@@ -25311,7 +25436,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, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -25321,7 +25446,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, 703)) // token='as'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -25354,7 +25479,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, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -25388,7 +25513,7 @@ invalid_except_star_stmt_rule(Parser *p)
void *_tmp_147_var;
Token * a;
if (
- (a = _PyPegen_expect_token(p, 695)) // token='except'
+ (a = _PyPegen_expect_token(p, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -25422,13 +25547,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, 700)) // 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, 703)) // token='as'
&&
(a = expression_rule(p)) // expression
&&
@@ -25479,7 +25604,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, 696)) // token='finally'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -25535,7 +25660,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, 700)) // token='except'
&&
(expression_var = expression_rule(p)) // expression
&&
@@ -25571,7 +25696,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, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -25627,7 +25752,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, 700)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
@@ -25904,7 +26029,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, 703)) // token='as'
&&
(a = _PyPegen_expect_soft_keyword(p, "_")) // soft_keyword='"_"'
)
@@ -25934,7 +26059,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, 703)) // token='as'
&&
(a = expression_rule(p)) // expression
)
@@ -26150,7 +26275,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, 705)) // token='if'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -26181,7 +26306,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, 705)) // token='if'
&&
(a_1 = named_expression_rule(p)) // named_expression
&&
@@ -26236,7 +26361,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, 710)) // token='elif'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -26267,7 +26392,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, 710)) // token='elif'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -26320,7 +26445,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, 709)) // token='else'
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -26353,13 +26478,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, 709)) // 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, 710)) // token='elif'
)
{
D(fprintf(stderr, "%*c+ invalid_else_stmt[%d-%d]: %s
succeeded!\n", p->level, ' ', _mark, p->mark, "'else' ':' block 'elif'"));
@@ -26406,7 +26531,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, 712)) // token='while'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -26437,7 +26562,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, 712)) // token='while'
&&
(named_expression_var = named_expression_rule(p)) //
named_expression
&&
@@ -26496,13 +26621,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, 721), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 712)) // token='for'
+ (_keyword = _PyPegen_expect_token(p, 717)) // 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, 718)) // token='in'
&&
(star_expressions_var = star_expressions_rule(p)) //
star_expressions
&&
@@ -26537,13 +26662,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, 721), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 712)) // token='for'
+ (a = _PyPegen_expect_token(p, 717)) // token='for'
&&
(star_targets_var = star_targets_rule(p)) // star_targets
&&
- (_keyword = _PyPegen_expect_token(p, 713)) // token='in'
+ (_keyword = _PyPegen_expect_token(p, 718)) // token='in'
&&
(star_expressions_var = star_expressions_rule(p)) //
star_expressions
&&
@@ -26609,9 +26734,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, 721), !p->error_indicator)
// 'async'?
&&
- (a = _PyPegen_expect_token(p, 717)) // token='def'
+ (a = _PyPegen_expect_token(p, 722)) // token='def'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -26668,9 +26793,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, 721), !p->error_indicator)
// 'async'?
&&
- (_keyword = _PyPegen_expect_token(p, 717)) // token='def'
+ (_keyword = _PyPegen_expect_token(p, 722)) // token='def'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -26734,7 +26859,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, 724)) // token='class'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -26773,7 +26898,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, 724)) // token='class'
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
@@ -28409,7 +28534,7 @@ invalid_arithmetic_rule(Parser *p)
&&
(_tmp_157_var = _tmp_157_rule(p)) // '+' | '-' | '*' | '/' | '%'
| '//' | '@'
&&
- (a = _PyPegen_expect_token(p, 721)) // token='not'
+ (a = _PyPegen_expect_token(p, 726)) // token='not'
&&
(b = inversion_rule(p)) // inversion
)
@@ -28458,7 +28583,7 @@ invalid_factor_rule(Parser *p)
if (
(_tmp_158_var = _tmp_158_rule(p)) // '+' | '-' | '~'
&&
- (a = _PyPegen_expect_token(p, 721)) // token='not'
+ (a = _PyPegen_expect_token(p, 726)) // token='not'
&&
(b = factor_rule(p)) // factor
)
@@ -28851,7 +28976,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, 656)) // token='import'
)
{
D(fprintf(stderr, "%*c+ _tmp_5[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'import'"));
@@ -28870,7 +28995,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, 655)) // token='from'
)
{
D(fprintf(stderr, "%*c+ _tmp_5[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'from'"));
@@ -28927,7 +29052,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, 722)) // token='def'
)
{
D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'def'"));
@@ -28965,7 +29090,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, 721)) // token='async'
)
{
D(fprintf(stderr, "%*c+ _tmp_6[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'async'"));
@@ -29003,7 +29128,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, 724)) // token='class'
)
{
D(fprintf(stderr, "%*c+ _tmp_7[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'class'"));
@@ -29060,7 +29185,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, 670)) // token='with'
)
{
D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'with'"));
@@ -29079,7 +29204,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, 721)) // token='async'
)
{
D(fprintf(stderr, "%*c+ _tmp_8[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'async'"));
@@ -29117,7 +29242,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, 717)) // token='for'
)
{
D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'for'"));
@@ -29136,7 +29261,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, 721)) // token='async'
)
{
D(fprintf(stderr, "%*c+ _tmp_9[%d-%d]: %s succeeded!\n", p->level,
' ', _mark, p->mark, "'async'"));
@@ -29837,7 +29962,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, 703)) // token='as'
&&
(z = _PyPegen_name_token(p)) // NAME
)
@@ -35560,7 +35685,7 @@ _tmp_113_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_113[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'True'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 627)) // token='True'
+ (_keyword = _PyPegen_expect_token(p, 632)) // token='True'
)
{
D(fprintf(stderr, "%*c+ _tmp_113[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'True'"));
@@ -35579,7 +35704,7 @@ _tmp_113_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_113[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'False'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 629)) // token='False'
+ (_keyword = _PyPegen_expect_token(p, 634)) // token='False'
)
{
D(fprintf(stderr, "%*c+ _tmp_113[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'False'"));
@@ -35598,7 +35723,7 @@ _tmp_113_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_113[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'None'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 628)) // token='None'
+ (_keyword = _PyPegen_expect_token(p, 633)) // token='None'
)
{
D(fprintf(stderr, "%*c+ _tmp_113[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'None'"));
@@ -35809,7 +35934,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, 704)) // token='else'
+ (_keyword = _PyPegen_expect_token(p, 709)) // token='else'
)
{
D(fprintf(stderr, "%*c+ _tmp_117[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'else'"));
@@ -36056,7 +36181,7 @@ _tmp_120_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_120[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'True'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 627)) // token='True'
+ (_keyword = _PyPegen_expect_token(p, 632)) // token='True'
)
{
D(fprintf(stderr, "%*c+ _tmp_120[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'True'"));
@@ -36075,7 +36200,7 @@ _tmp_120_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_120[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'None'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 628)) // token='None'
+ (_keyword = _PyPegen_expect_token(p, 633)) // token='None'
)
{
D(fprintf(stderr, "%*c+ _tmp_120[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'None'"));
@@ -36094,7 +36219,7 @@ _tmp_120_rule(Parser *p)
D(fprintf(stderr, "%*c> _tmp_120[%d-%d]: %s\n", p->level, ' ', _mark,
p->mark, "'False'"));
Token * _keyword;
if (
- (_keyword = _PyPegen_expect_token(p, 629)) // token='False'
+ (_keyword = _PyPegen_expect_token(p, 634)) // token='False'
)
{
D(fprintf(stderr, "%*c+ _tmp_120[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'False'"));
@@ -37472,7 +37597,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, 695)) // token='except'
+ (_keyword = _PyPegen_expect_token(p, 700)) // token='except'
)
{
D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'except'"));
@@ -37491,7 +37616,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, 691)) // token='finally'
+ (_keyword = _PyPegen_expect_token(p, 696)) // token='finally'
)
{
D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n",
p->level, ' ', _mark, p->mark, "'finally'"));
@@ -38644,7 +38769,7 @@ _tmp_163_rule(Parser *p)
Token * _keyword;
expr_ty c;
if (
- (_keyword = _PyPegen_expect_token(p, 589)) // token='or'
+ (_keyword = _PyPegen_expect_token(p, 594)) // token='or'
&&
(c = conjunction_rule(p)) // conjunction
)
@@ -38690,7 +38815,7 @@ _tmp_164_rule(Parser *p)
Token * _keyword;
expr_ty c;
if (
- (_keyword = _PyPegen_expect_token(p, 590)) // token='and'
+ (_keyword = _PyPegen_expect_token(p, 595)) // token='and'
&&
(c = inversion_rule(p)) // inversion
)
@@ -38793,7 +38918,7 @@ _tmp_166_rule(Parser *p)
Token * _keyword;
expr_ty z;
if (
- (_keyword = _PyPegen_expect_token(p, 700)) // token='if'
+ (_keyword = _PyPegen_expect_token(p, 705)) // token='if'
&&
(z = disjunction_rule(p)) // disjunction
)
@@ -39529,7 +39654,7 @@ _tmp_180_rule(Parser *p)
Token * _keyword;
expr_ty star_target_var;
if (
- (_keyword = _PyPegen_expect_token(p, 698)) // token='as'
+ (_keyword = _PyPegen_expect_token(p, 703)) // 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]