summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-05-18 17:32:03 (GMT)
committerGitHub <noreply@github.com>2020-05-18 17:32:03 (GMT)
commit7b7a21bc4fd063b26a2d1882fddc458861497812 (patch)
tree31eb7583108b66930b3937546d786d2c9b0328d6
parent08b47c367a08f571a986366aa33828d3951fa88d (diff)
downloadcpython-7b7a21bc4fd063b26a2d1882fddc458861497812.zip
cpython-7b7a21bc4fd063b26a2d1882fddc458861497812.tar.gz
cpython-7b7a21bc4fd063b26a2d1882fddc458861497812.tar.bz2
bpo-40661: Fix segfault when parsing invalid input (GH-20165)
Fix segfaults when parsing very complex invalid input, like `import äˆ ð£„¯ð¢·žð±‹á”€ð””ð‘©±å®ä±¬ð©¾\n𗶽`. Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
-rw-r--r--Lib/test/test_peg_parser.py1
-rw-r--r--Lib/test/test_syntax.py3
-rw-r--r--Parser/pegen/parse.c1590
-rw-r--r--Tools/peg_generator/pegen/c_generator.py17
4 files changed, 1603 insertions, 8 deletions
diff --git a/Lib/test/test_peg_parser.py b/Lib/test/test_peg_parser.py
index 9614e45..6ccb257 100644
--- a/Lib/test/test_peg_parser.py
+++ b/Lib/test/test_peg_parser.py
@@ -591,6 +591,7 @@ FAIL_TEST_CASES = [
("f-string_single_closing_brace", "f'}'"),
("from_import_invalid", "from import import a"),
("from_import_trailing_comma", "from a import b,"),
+ ("import_non_ascii_syntax_error", "import ä £"),
# This test case checks error paths involving tokens with uninitialized
# values of col_offset and end_col_offset.
("invalid indentation",
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 60c7d9f..87ceced 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -659,6 +659,9 @@ Corner-cases that used to crash:
Traceback (most recent call last):
SyntaxError: cannot assign to __debug__
+ >>> import ä £
+ Traceback (most recent call last):
+ SyntaxError: invalid character '£' (U+00A3)
"""
import re
diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c
index 2a9dad7..e9c2032 100644
--- a/Parser/pegen/parse.c
+++ b/Parser/pegen/parse.c
@@ -683,6 +683,9 @@ file_rule(Parser *p)
mod_ty _res = NULL;
int _mark = p->mark;
{ // statements? $
+ if (p->error_indicator) {
+ return NULL;
+ }
void *a;
Token * endmarker_var;
if (
@@ -715,6 +718,9 @@ interactive_rule(Parser *p)
mod_ty _res = NULL;
int _mark = p->mark;
{ // statement_newline
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* a;
if (
(a = statement_newline_rule(p)) // statement_newline
@@ -744,6 +750,9 @@ eval_rule(Parser *p)
mod_ty _res = NULL;
int _mark = p->mark;
{ // expressions NEWLINE* $
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * _loop0_1_var;
expr_ty a;
Token * endmarker_var;
@@ -779,6 +788,9 @@ func_type_rule(Parser *p)
mod_ty _res = NULL;
int _mark = p->mark;
{ // '(' type_expressions? ')' '->' expression NEWLINE* $
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
Token * _literal_2;
@@ -826,6 +838,9 @@ fstring_rule(Parser *p)
expr_ty _res = NULL;
int _mark = p->mark;
{ // star_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
@@ -858,6 +873,9 @@ type_expressions_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.expression+ ',' '*' expression ',' '**' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
Token * _literal_2;
@@ -891,6 +909,9 @@ type_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // ','.expression+ ',' '*' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * a;
@@ -915,6 +936,9 @@ type_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // ','.expression+ ',' '**' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * a;
@@ -939,6 +963,9 @@ type_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // '*' expression ',' '**' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
Token * _literal_2;
@@ -966,6 +993,9 @@ type_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // '*' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -984,6 +1014,9 @@ type_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // '**' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -1002,6 +1035,9 @@ type_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // ','.expression+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * _gather_9_var;
if (
(_gather_9_var = _gather_9_rule(p)) // ','.expression+
@@ -1027,6 +1063,9 @@ statements_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // statement+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
if (
(a = _loop1_11_rule(p)) // statement+
@@ -1056,6 +1095,9 @@ statement_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // compound_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty a;
if (
(a = compound_stmt_rule(p)) // compound_stmt
@@ -1071,6 +1113,9 @@ statement_rule(Parser *p)
p->mark = _mark;
}
{ // simple_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* simple_stmt_var;
if (
(simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
@@ -1104,6 +1149,9 @@ statement_newline_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // compound_stmt NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty a;
Token * newline_var;
if (
@@ -1122,6 +1170,9 @@ statement_newline_rule(Parser *p)
p->mark = _mark;
}
{ // simple_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* simple_stmt_var;
if (
(simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
@@ -1133,6 +1184,9 @@ statement_newline_rule(Parser *p)
p->mark = _mark;
}
{ // NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * newline_var;
if (
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
@@ -1156,6 +1210,9 @@ statement_newline_rule(Parser *p)
p->mark = _mark;
}
{ // $
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * endmarker_var;
if (
(endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER'
@@ -1185,6 +1242,9 @@ simple_stmt_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // small_stmt !';' NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty a;
Token * newline_var;
if (
@@ -1205,6 +1265,9 @@ simple_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // ';'.small_stmt+ ';'? NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -1264,6 +1327,9 @@ small_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // assignment
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty assignment_var;
if (
(assignment_var = assignment_rule(p)) // assignment
@@ -1275,6 +1341,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty e;
if (
(e = star_expressions_rule(p)) // star_expressions
@@ -1298,6 +1367,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'return' return_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty return_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 500) // token='return'
@@ -1311,6 +1383,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &('import' | 'from') import_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty import_stmt_var;
if (
_PyPegen_lookahead(1, _tmp_14_rule, p)
@@ -1324,6 +1399,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'raise' raise_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty raise_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 501) // token='raise'
@@ -1337,6 +1415,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'pass'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 502)) // token='pass'
@@ -1360,6 +1441,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'del' del_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty del_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 503) // token='del'
@@ -1373,6 +1457,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'yield' yield_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty yield_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 504) // token='yield'
@@ -1386,6 +1473,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'assert' assert_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty assert_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 505) // token='assert'
@@ -1399,6 +1489,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'break'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 506)) // token='break'
@@ -1422,6 +1515,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'continue'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 507)) // token='continue'
@@ -1445,6 +1541,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'global' global_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty global_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 508) // token='global'
@@ -1458,6 +1557,9 @@ small_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'nonlocal' nonlocal_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty nonlocal_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 509) // token='nonlocal'
@@ -1493,6 +1595,9 @@ compound_stmt_rule(Parser *p)
stmt_ty _res = NULL;
int _mark = p->mark;
{ // &('def' | '@' | ASYNC) function_def
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty function_def_var;
if (
_PyPegen_lookahead(1, _tmp_15_rule, p)
@@ -1506,6 +1611,9 @@ compound_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'if' if_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty if_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 510) // token='if'
@@ -1519,6 +1627,9 @@ compound_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &('class' | '@') class_def
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty class_def_var;
if (
_PyPegen_lookahead(1, _tmp_16_rule, p)
@@ -1532,6 +1643,9 @@ compound_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &('with' | ASYNC) with_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty with_stmt_var;
if (
_PyPegen_lookahead(1, _tmp_17_rule, p)
@@ -1545,6 +1659,9 @@ compound_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &('for' | ASYNC) for_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty for_stmt_var;
if (
_PyPegen_lookahead(1, _tmp_18_rule, p)
@@ -1558,6 +1675,9 @@ compound_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'try' try_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty try_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 511) // token='try'
@@ -1571,6 +1691,9 @@ compound_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // &'while' while_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty while_stmt_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 512) // token='while'
@@ -1611,6 +1734,9 @@ assignment_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME ':' expression ['=' annotated_rhs]
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -1643,6 +1769,9 @@ assignment_rule(Parser *p)
p->mark = _mark;
}
{ // ('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *a;
expr_ty b;
@@ -1675,6 +1804,9 @@ assignment_rule(Parser *p)
p->mark = _mark;
}
{ // ((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT?
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
void *b;
void *tc;
@@ -1704,6 +1836,9 @@ assignment_rule(Parser *p)
p->mark = _mark;
}
{ // single_target augassign (yield_expr | star_expressions)
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
AugOperator* b;
void *c;
@@ -1733,6 +1868,9 @@ assignment_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_assignment
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_assignment_var;
if (
(invalid_assignment_var = invalid_assignment_rule(p)) // invalid_assignment
@@ -1771,6 +1909,9 @@ augassign_rule(Parser *p)
AugOperator* _res = NULL;
int _mark = p->mark;
{ // '+='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 36)) // token='+='
@@ -1786,6 +1927,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '-='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 37)) // token='-='
@@ -1801,6 +1945,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '*='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 38)) // token='*='
@@ -1816,6 +1963,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '@='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 50)) // token='@='
@@ -1831,6 +1981,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '/='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 39)) // token='/='
@@ -1846,6 +1999,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '%='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 40)) // token='%='
@@ -1861,6 +2017,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '&='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 41)) // token='&='
@@ -1876,6 +2035,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '|='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 42)) // token='|='
@@ -1891,6 +2053,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '^='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 43)) // token='^='
@@ -1906,6 +2071,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '<<='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 44)) // token='<<='
@@ -1921,6 +2089,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '>>='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 45)) // token='>>='
@@ -1936,6 +2107,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '**='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 46)) // token='**='
@@ -1951,6 +2125,9 @@ augassign_rule(Parser *p)
p->mark = _mark;
}
{ // '//='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 48)) // token='//='
@@ -1988,6 +2165,9 @@ global_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'global' ','.NAME+
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
asdl_seq * a;
if (
@@ -2036,6 +2216,9 @@ nonlocal_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'nonlocal' ','.NAME+
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
asdl_seq * a;
if (
@@ -2084,6 +2267,9 @@ yield_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // yield_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty y;
if (
(y = yield_expr_rule(p)) // yield_expr
@@ -2129,6 +2315,9 @@ assert_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'assert' expression [',' expression]
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty a;
void *b;
@@ -2180,6 +2369,9 @@ del_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'del' del_targets
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
asdl_seq* a;
if (
@@ -2220,6 +2412,9 @@ import_stmt_rule(Parser *p)
stmt_ty _res = NULL;
int _mark = p->mark;
{ // import_name
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty import_name_var;
if (
(import_name_var = import_name_rule(p)) // import_name
@@ -2231,6 +2426,9 @@ import_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // import_from
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty import_from_var;
if (
(import_from_var = import_from_rule(p)) // import_from
@@ -2264,6 +2462,9 @@ import_name_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'import' dotted_as_names
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
asdl_seq* a;
if (
@@ -2314,6 +2515,9 @@ import_from_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'from' (('.' | '...'))* dotted_name 'import' import_from_targets
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
asdl_seq * a;
@@ -2349,6 +2553,9 @@ import_from_rule(Parser *p)
p->mark = _mark;
}
{ // 'from' (('.' | '...'))+ 'import' import_from_targets
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
asdl_seq * a;
@@ -2395,6 +2602,9 @@ import_from_targets_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // '(' import_from_as_names ','? ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *_opt_var;
@@ -2420,6 +2630,9 @@ import_from_targets_rule(Parser *p)
p->mark = _mark;
}
{ // import_from_as_names
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* import_from_as_names_var;
if (
(import_from_as_names_var = import_from_as_names_rule(p)) // import_from_as_names
@@ -2431,6 +2644,9 @@ import_from_targets_rule(Parser *p)
p->mark = _mark;
}
{ // '*'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
@@ -2460,6 +2676,9 @@ import_from_as_names_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.import_from_as_name+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
if (
(a = _gather_32_rule(p)) // ','.import_from_as_name+
@@ -2489,6 +2708,9 @@ import_from_as_name_rule(Parser *p)
alias_ty _res = NULL;
int _mark = p->mark;
{ // NAME ['as' NAME]
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
void *b;
if (
@@ -2521,6 +2743,9 @@ dotted_as_names_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.dotted_as_name+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
if (
(a = _gather_35_rule(p)) // ','.dotted_as_name+
@@ -2550,6 +2775,9 @@ dotted_as_name_rule(Parser *p)
alias_ty _res = NULL;
int _mark = p->mark;
{ // dotted_name ['as' NAME]
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
void *b;
if (
@@ -2607,6 +2835,9 @@ dotted_name_raw(Parser *p)
expr_ty _res = NULL;
int _mark = p->mark;
{ // dotted_name '.' NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -2628,6 +2859,9 @@ dotted_name_raw(Parser *p)
p->mark = _mark;
}
{ // NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty name_var;
if (
(name_var = _PyPegen_name_token(p)) // NAME
@@ -2663,6 +2897,9 @@ if_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'if' named_expression ':' block elif_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
expr_ty a;
@@ -2698,6 +2935,9 @@ if_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'if' named_expression ':' block else_block?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
expr_ty a;
@@ -2757,6 +2997,9 @@ elif_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'elif' named_expression ':' block elif_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
expr_ty a;
@@ -2792,6 +3035,9 @@ elif_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'elif' named_expression ':' block else_block?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
expr_ty a;
@@ -2841,6 +3087,9 @@ else_block_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // 'else' ':' block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq* b;
@@ -2884,6 +3133,9 @@ while_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'while' named_expression ':' block else_block?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
expr_ty a;
@@ -2943,6 +3195,9 @@ for_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
Token * _literal;
@@ -2987,6 +3242,9 @@ for_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // ASYNC 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
Token * _literal;
@@ -3060,6 +3318,9 @@ with_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'with' '(' ','.with_item+ ','? ')' ':' block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
Token * _literal_1;
@@ -3102,6 +3363,9 @@ with_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'with' ','.with_item+ ':' TYPE_COMMENT? block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq * a;
@@ -3137,6 +3401,9 @@ with_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
Token * _literal_1;
@@ -3182,6 +3449,9 @@ with_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq * a;
@@ -3234,6 +3504,9 @@ with_item_rule(Parser *p)
withitem_ty _res = NULL;
int _mark = p->mark;
{ // expression ['as' target]
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty e;
void *o;
if (
@@ -3276,6 +3549,9 @@ try_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'try' ':' block finally_block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq* b;
@@ -3308,6 +3584,9 @@ try_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'try' ':' block except_block+ else_block? finally_block?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq* b;
@@ -3368,6 +3647,9 @@ except_block_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'except' expression ['as' NAME] ':' block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq* b;
@@ -3403,6 +3685,9 @@ except_block_rule(Parser *p)
p->mark = _mark;
}
{ // 'except' ':' block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq* b;
@@ -3446,6 +3731,9 @@ finally_block_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // 'finally' ':' block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
asdl_seq* a;
@@ -3489,6 +3777,9 @@ return_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'return' star_expressions?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
void *a;
if (
@@ -3537,6 +3828,9 @@ raise_stmt_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'raise' expression ['from' expression]
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty a;
void *b;
@@ -3566,6 +3860,9 @@ raise_stmt_rule(Parser *p)
p->mark = _mark;
}
{ // 'raise'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 501)) // token='raise'
@@ -3603,6 +3900,9 @@ function_def_rule(Parser *p)
stmt_ty _res = NULL;
int _mark = p->mark;
{ // decorators function_def_raw
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* d;
stmt_ty f;
if (
@@ -3621,6 +3921,9 @@ function_def_rule(Parser *p)
p->mark = _mark;
}
{ // function_def_raw
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty function_def_raw_var;
if (
(function_def_raw_var = function_def_raw_rule(p)) // function_def_raw
@@ -3656,6 +3959,9 @@ function_def_raw_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
Token * _literal_1;
@@ -3703,6 +4009,9 @@ function_def_raw_rule(Parser *p)
p->mark = _mark;
}
{ // ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
Token * _literal_1;
@@ -3770,6 +4079,9 @@ func_type_comment_rule(Parser *p)
Token* _res = NULL;
int _mark = p->mark;
{ // NEWLINE TYPE_COMMENT &(NEWLINE INDENT)
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * newline_var;
Token * t;
if (
@@ -3790,6 +4102,9 @@ func_type_comment_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_double_type_comments
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_double_type_comments_var;
if (
(invalid_double_type_comments_var = invalid_double_type_comments_rule(p)) // invalid_double_type_comments
@@ -3801,6 +4116,9 @@ func_type_comment_rule(Parser *p)
p->mark = _mark;
}
{ // TYPE_COMMENT
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * type_comment_var;
if (
(type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT)) // token='TYPE_COMMENT'
@@ -3826,6 +4144,9 @@ params_rule(Parser *p)
arguments_ty _res = NULL;
int _mark = p->mark;
{ // invalid_parameters
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_parameters_var;
if (
(invalid_parameters_var = invalid_parameters_rule(p)) // invalid_parameters
@@ -3837,6 +4158,9 @@ params_rule(Parser *p)
p->mark = _mark;
}
{ // parameters
+ if (p->error_indicator) {
+ return NULL;
+ }
arguments_ty parameters_var;
if (
(parameters_var = parameters_rule(p)) // parameters
@@ -3867,6 +4191,9 @@ parameters_rule(Parser *p)
arguments_ty _res = NULL;
int _mark = p->mark;
{ // slash_no_default param_no_default* param_with_default* star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* a;
asdl_seq * b;
asdl_seq * c;
@@ -3891,6 +4218,9 @@ parameters_rule(Parser *p)
p->mark = _mark;
}
{ // slash_with_default param_with_default* star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
SlashWithDefault* a;
asdl_seq * b;
void *c;
@@ -3912,6 +4242,9 @@ parameters_rule(Parser *p)
p->mark = _mark;
}
{ // param_no_default+ param_with_default* star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
asdl_seq * b;
void *c;
@@ -3933,6 +4266,9 @@ parameters_rule(Parser *p)
p->mark = _mark;
}
{ // param_with_default+ star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
void *b;
if (
@@ -3951,6 +4287,9 @@ parameters_rule(Parser *p)
p->mark = _mark;
}
{ // star_etc
+ if (p->error_indicator) {
+ return NULL;
+ }
StarEtc* a;
if (
(a = star_etc_rule(p)) // star_etc
@@ -3980,6 +4319,9 @@ slash_no_default_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // param_no_default+ '/' ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * a;
@@ -4001,6 +4343,9 @@ slash_no_default_rule(Parser *p)
p->mark = _mark;
}
{ // param_no_default+ '/' &')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
asdl_seq * a;
if (
@@ -4037,6 +4382,9 @@ slash_with_default_rule(Parser *p)
SlashWithDefault* _res = NULL;
int _mark = p->mark;
{ // param_no_default* param_with_default+ '/' ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * a;
@@ -4061,6 +4409,9 @@ slash_with_default_rule(Parser *p)
p->mark = _mark;
}
{ // param_no_default* param_with_default+ '/' &')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
asdl_seq * a;
asdl_seq * b;
@@ -4102,6 +4453,9 @@ star_etc_rule(Parser *p)
StarEtc* _res = NULL;
int _mark = p->mark;
{ // '*' param_no_default param_maybe_default* kwds?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
asdl_seq * b;
@@ -4126,6 +4480,9 @@ star_etc_rule(Parser *p)
p->mark = _mark;
}
{ // '*' ',' param_maybe_default+ kwds?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * b;
@@ -4150,6 +4507,9 @@ star_etc_rule(Parser *p)
p->mark = _mark;
}
{ // kwds
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
if (
(a = kwds_rule(p)) // kwds
@@ -4165,6 +4525,9 @@ star_etc_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_star_etc
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_star_etc_var;
if (
(invalid_star_etc_var = invalid_star_etc_rule(p)) // invalid_star_etc
@@ -4190,6 +4553,9 @@ kwds_rule(Parser *p)
arg_ty _res = NULL;
int _mark = p->mark;
{ // '**' param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
if (
@@ -4222,6 +4588,9 @@ param_no_default_rule(Parser *p)
arg_ty _res = NULL;
int _mark = p->mark;
{ // param ',' TYPE_COMMENT?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
void *tc;
@@ -4243,6 +4612,9 @@ param_no_default_rule(Parser *p)
p->mark = _mark;
}
{ // param TYPE_COMMENT? &')'
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
void *tc;
if (
@@ -4277,6 +4649,9 @@ param_with_default_rule(Parser *p)
NameDefaultPair* _res = NULL;
int _mark = p->mark;
{ // param default ',' TYPE_COMMENT?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
expr_ty c;
@@ -4301,6 +4676,9 @@ param_with_default_rule(Parser *p)
p->mark = _mark;
}
{ // param default TYPE_COMMENT? &')'
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
expr_ty c;
void *tc;
@@ -4340,6 +4718,9 @@ param_maybe_default_rule(Parser *p)
NameDefaultPair* _res = NULL;
int _mark = p->mark;
{ // param default? ',' TYPE_COMMENT?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
void *c;
@@ -4364,6 +4745,9 @@ param_maybe_default_rule(Parser *p)
p->mark = _mark;
}
{ // param default? TYPE_COMMENT? &')'
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
void *c;
void *tc;
@@ -4409,6 +4793,9 @@ param_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME annotation?
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
void *b;
if (
@@ -4449,6 +4836,9 @@ annotation_rule(Parser *p)
expr_ty _res = NULL;
int _mark = p->mark;
{ // ':' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -4481,6 +4871,9 @@ default_rule(Parser *p)
expr_ty _res = NULL;
int _mark = p->mark;
{ // '=' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -4513,6 +4906,9 @@ decorators_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // (('@' named_expression NEWLINE))+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
if (
(a = _loop1_67_rule(p)) // (('@' named_expression NEWLINE))+
@@ -4542,6 +4938,9 @@ class_def_rule(Parser *p)
stmt_ty _res = NULL;
int _mark = p->mark;
{ // decorators class_def_raw
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* a;
stmt_ty b;
if (
@@ -4560,6 +4959,9 @@ class_def_rule(Parser *p)
p->mark = _mark;
}
{ // class_def_raw
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty class_def_raw_var;
if (
(class_def_raw_var = class_def_raw_rule(p)) // class_def_raw
@@ -4593,6 +4995,9 @@ class_def_raw_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'class' NAME ['(' arguments? ')'] ':' block
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
expr_ty a;
@@ -4644,6 +5049,9 @@ block_rule(Parser *p)
return _res;
int _mark = p->mark;
{ // NEWLINE INDENT statements DEDENT
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* a;
Token * dedent_var;
Token * indent_var;
@@ -4668,6 +5076,9 @@ block_rule(Parser *p)
p->mark = _mark;
}
{ // simple_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* simple_stmt_var;
if (
(simple_stmt_var = simple_stmt_rule(p)) // simple_stmt
@@ -4679,6 +5090,9 @@ block_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_block
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_block_var;
if (
(invalid_block_var = invalid_block_rule(p)) // invalid_block
@@ -4705,6 +5119,9 @@ expressions_list_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.star_expression+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -4749,6 +5166,9 @@ star_expressions_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // star_expression ((',' star_expression))+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty a;
@@ -4779,6 +5199,9 @@ star_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // star_expression ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -4805,6 +5228,9 @@ star_expressions_rule(Parser *p)
p->mark = _mark;
}
{ // star_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_expression_var;
if (
(star_expression_var = star_expression_rule(p)) // star_expression
@@ -4840,6 +5266,9 @@ star_expression_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '*' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -4866,6 +5295,9 @@ star_expression_rule(Parser *p)
p->mark = _mark;
}
{ // expression
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty expression_var;
if (
(expression_var = expression_rule(p)) // expression
@@ -4892,6 +5324,9 @@ star_named_expressions_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.star_named_expression+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -4933,6 +5368,9 @@ star_named_expression_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '*' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -4959,6 +5397,9 @@ star_named_expression_rule(Parser *p)
p->mark = _mark;
}
{ // named_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty named_expression_var;
if (
(named_expression_var = named_expression_rule(p)) // named_expression
@@ -4992,6 +5433,9 @@ named_expression_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME ':=' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -5021,6 +5465,9 @@ named_expression_rule(Parser *p)
p->mark = _mark;
}
{ // expression !':='
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty expression_var;
if (
(expression_var = expression_rule(p)) // expression
@@ -5034,6 +5481,9 @@ named_expression_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_named_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_named_expression_var;
if (
(invalid_named_expression_var = invalid_named_expression_rule(p)) // invalid_named_expression
@@ -5059,6 +5509,9 @@ annotated_rhs_rule(Parser *p)
expr_ty _res = NULL;
int _mark = p->mark;
{ // yield_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty yield_expr_var;
if (
(yield_expr_var = yield_expr_rule(p)) // yield_expr
@@ -5070,6 +5523,9 @@ annotated_rhs_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
@@ -5103,6 +5559,9 @@ expressions_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // expression ((',' expression))+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty a;
@@ -5133,6 +5592,9 @@ expressions_rule(Parser *p)
p->mark = _mark;
}
{ // expression ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -5159,6 +5621,9 @@ expressions_rule(Parser *p)
p->mark = _mark;
}
{ // expression
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty expression_var;
if (
(expression_var = expression_rule(p)) // expression
@@ -5194,6 +5659,9 @@ expression_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // disjunction 'if' disjunction 'else' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
expr_ty a;
@@ -5229,6 +5697,9 @@ expression_rule(Parser *p)
p->mark = _mark;
}
{ // disjunction
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty disjunction_var;
if (
(disjunction_var = disjunction_rule(p)) // disjunction
@@ -5240,6 +5711,9 @@ expression_rule(Parser *p)
p->mark = _mark;
}
{ // lambdef
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty lambdef_var;
if (
(lambdef_var = lambdef_rule(p)) // lambdef
@@ -5274,6 +5748,9 @@ lambdef_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'lambda' lambda_parameters? ':' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _literal;
void *a;
@@ -5325,6 +5802,9 @@ lambda_parameters_rule(Parser *p)
arguments_ty _res = NULL;
int _mark = p->mark;
{ // lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* a;
asdl_seq * b;
asdl_seq * c;
@@ -5349,6 +5829,9 @@ lambda_parameters_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_slash_with_default lambda_param_with_default* lambda_star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
SlashWithDefault* a;
asdl_seq * b;
void *c;
@@ -5370,6 +5853,9 @@ lambda_parameters_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
asdl_seq * b;
void *c;
@@ -5391,6 +5877,9 @@ lambda_parameters_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_param_with_default+ lambda_star_etc?
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
void *b;
if (
@@ -5409,6 +5898,9 @@ lambda_parameters_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_star_etc
+ if (p->error_indicator) {
+ return NULL;
+ }
StarEtc* a;
if (
(a = lambda_star_etc_rule(p)) // lambda_star_etc
@@ -5440,6 +5932,9 @@ lambda_slash_no_default_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // lambda_param_no_default+ '/' ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * a;
@@ -5461,6 +5956,9 @@ lambda_slash_no_default_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_param_no_default+ '/' &':'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
asdl_seq * a;
if (
@@ -5497,6 +5995,9 @@ lambda_slash_with_default_rule(Parser *p)
SlashWithDefault* _res = NULL;
int _mark = p->mark;
{ // lambda_param_no_default* lambda_param_with_default+ '/' ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * a;
@@ -5521,6 +6022,9 @@ lambda_slash_with_default_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_param_no_default* lambda_param_with_default+ '/' &':'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
asdl_seq * a;
asdl_seq * b;
@@ -5562,6 +6066,9 @@ lambda_star_etc_rule(Parser *p)
StarEtc* _res = NULL;
int _mark = p->mark;
{ // '*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
asdl_seq * b;
@@ -5586,6 +6093,9 @@ lambda_star_etc_rule(Parser *p)
p->mark = _mark;
}
{ // '*' ',' lambda_param_maybe_default+ lambda_kwds?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * b;
@@ -5610,6 +6120,9 @@ lambda_star_etc_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_kwds
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
if (
(a = lambda_kwds_rule(p)) // lambda_kwds
@@ -5625,6 +6138,9 @@ lambda_star_etc_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_lambda_star_etc
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_lambda_star_etc_var;
if (
(invalid_lambda_star_etc_var = invalid_lambda_star_etc_rule(p)) // invalid_lambda_star_etc
@@ -5650,6 +6166,9 @@ lambda_kwds_rule(Parser *p)
arg_ty _res = NULL;
int _mark = p->mark;
{ // '**' lambda_param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
if (
@@ -5682,6 +6201,9 @@ lambda_param_no_default_rule(Parser *p)
arg_ty _res = NULL;
int _mark = p->mark;
{ // lambda_param ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
if (
@@ -5700,6 +6222,9 @@ lambda_param_no_default_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_param &':'
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
if (
(a = lambda_param_rule(p)) // lambda_param
@@ -5731,6 +6256,9 @@ lambda_param_with_default_rule(Parser *p)
NameDefaultPair* _res = NULL;
int _mark = p->mark;
{ // lambda_param default ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
expr_ty c;
@@ -5752,6 +6280,9 @@ lambda_param_with_default_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_param default &':'
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
expr_ty c;
if (
@@ -5786,6 +6317,9 @@ lambda_param_maybe_default_rule(Parser *p)
NameDefaultPair* _res = NULL;
int _mark = p->mark;
{ // lambda_param default? ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
arg_ty a;
void *c;
@@ -5807,6 +6341,9 @@ lambda_param_maybe_default_rule(Parser *p)
p->mark = _mark;
}
{ // lambda_param default? &':'
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty a;
void *c;
if (
@@ -5849,6 +6386,9 @@ lambda_param_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = _PyPegen_name_token(p)) // NAME
@@ -5896,6 +6436,9 @@ disjunction_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // conjunction (('or' conjunction))+
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
asdl_seq * b;
if (
@@ -5922,6 +6465,9 @@ disjunction_rule(Parser *p)
p->mark = _mark;
}
{ // conjunction
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty conjunction_var;
if (
(conjunction_var = conjunction_rule(p)) // conjunction
@@ -5958,6 +6504,9 @@ conjunction_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // inversion (('and' inversion))+
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
asdl_seq * b;
if (
@@ -5984,6 +6533,9 @@ conjunction_rule(Parser *p)
p->mark = _mark;
}
{ // inversion
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty inversion_var;
if (
(inversion_var = inversion_rule(p)) // inversion
@@ -6020,6 +6572,9 @@ inversion_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'not' inversion
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty a;
if (
@@ -6046,6 +6601,9 @@ inversion_rule(Parser *p)
p->mark = _mark;
}
{ // comparison
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty comparison_var;
if (
(comparison_var = comparison_rule(p)) // comparison
@@ -6080,6 +6638,9 @@ comparison_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // bitwise_or compare_op_bitwise_or_pair+
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
asdl_seq * b;
if (
@@ -6106,6 +6667,9 @@ comparison_rule(Parser *p)
p->mark = _mark;
}
{ // bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty bitwise_or_var;
if (
(bitwise_or_var = bitwise_or_rule(p)) // bitwise_or
@@ -6141,6 +6705,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // eq_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* eq_bitwise_or_var;
if (
(eq_bitwise_or_var = eq_bitwise_or_rule(p)) // eq_bitwise_or
@@ -6152,6 +6719,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // noteq_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* noteq_bitwise_or_var;
if (
(noteq_bitwise_or_var = noteq_bitwise_or_rule(p)) // noteq_bitwise_or
@@ -6163,6 +6733,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // lte_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* lte_bitwise_or_var;
if (
(lte_bitwise_or_var = lte_bitwise_or_rule(p)) // lte_bitwise_or
@@ -6174,6 +6747,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // lt_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* lt_bitwise_or_var;
if (
(lt_bitwise_or_var = lt_bitwise_or_rule(p)) // lt_bitwise_or
@@ -6185,6 +6761,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // gte_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* gte_bitwise_or_var;
if (
(gte_bitwise_or_var = gte_bitwise_or_rule(p)) // gte_bitwise_or
@@ -6196,6 +6775,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // gt_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* gt_bitwise_or_var;
if (
(gt_bitwise_or_var = gt_bitwise_or_rule(p)) // gt_bitwise_or
@@ -6207,6 +6789,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // notin_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* notin_bitwise_or_var;
if (
(notin_bitwise_or_var = notin_bitwise_or_rule(p)) // notin_bitwise_or
@@ -6218,6 +6803,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // in_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* in_bitwise_or_var;
if (
(in_bitwise_or_var = in_bitwise_or_rule(p)) // in_bitwise_or
@@ -6229,6 +6817,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // isnot_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* isnot_bitwise_or_var;
if (
(isnot_bitwise_or_var = isnot_bitwise_or_rule(p)) // isnot_bitwise_or
@@ -6240,6 +6831,9 @@ compare_op_bitwise_or_pair_rule(Parser *p)
p->mark = _mark;
}
{ // is_bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* is_bitwise_or_var;
if (
(is_bitwise_or_var = is_bitwise_or_rule(p)) // is_bitwise_or
@@ -6265,6 +6859,9 @@ eq_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // '==' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -6297,6 +6894,9 @@ noteq_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // ('!=') bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_92_var;
expr_ty a;
if (
@@ -6329,6 +6929,9 @@ lte_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // '<=' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -6361,6 +6964,9 @@ lt_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // '<' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -6393,6 +6999,9 @@ gte_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // '>=' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -6425,6 +7034,9 @@ gt_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // '>' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -6457,6 +7069,9 @@ notin_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // 'not' 'in' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
expr_ty a;
@@ -6492,6 +7107,9 @@ in_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // 'in' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty a;
if (
@@ -6524,6 +7142,9 @@ isnot_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // 'is' 'not' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
expr_ty a;
@@ -6559,6 +7180,9 @@ is_bitwise_or_rule(Parser *p)
CmpopExprPair* _res = NULL;
int _mark = p->mark;
{ // 'is' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty a;
if (
@@ -6624,6 +7248,9 @@ bitwise_or_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // bitwise_or '|' bitwise_xor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -6653,6 +7280,9 @@ bitwise_or_raw(Parser *p)
p->mark = _mark;
}
{ // bitwise_xor
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty bitwise_xor_var;
if (
(bitwise_xor_var = bitwise_xor_rule(p)) // bitwise_xor
@@ -6711,6 +7341,9 @@ bitwise_xor_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // bitwise_xor '^' bitwise_and
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -6740,6 +7373,9 @@ bitwise_xor_raw(Parser *p)
p->mark = _mark;
}
{ // bitwise_and
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty bitwise_and_var;
if (
(bitwise_and_var = bitwise_and_rule(p)) // bitwise_and
@@ -6798,6 +7434,9 @@ bitwise_and_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // bitwise_and '&' shift_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -6827,6 +7466,9 @@ bitwise_and_raw(Parser *p)
p->mark = _mark;
}
{ // shift_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty shift_expr_var;
if (
(shift_expr_var = shift_expr_rule(p)) // shift_expr
@@ -6885,6 +7527,9 @@ shift_expr_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // shift_expr '<<' sum
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -6914,6 +7559,9 @@ shift_expr_raw(Parser *p)
p->mark = _mark;
}
{ // shift_expr '>>' sum
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -6943,6 +7591,9 @@ shift_expr_raw(Parser *p)
p->mark = _mark;
}
{ // sum
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty sum_var;
if (
(sum_var = sum_rule(p)) // sum
@@ -7001,6 +7652,9 @@ sum_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // sum '+' term
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7030,6 +7684,9 @@ sum_raw(Parser *p)
p->mark = _mark;
}
{ // sum '-' term
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7059,6 +7716,9 @@ sum_raw(Parser *p)
p->mark = _mark;
}
{ // term
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty term_var;
if (
(term_var = term_rule(p)) // term
@@ -7123,6 +7783,9 @@ term_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // term '*' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7152,6 +7815,9 @@ term_raw(Parser *p)
p->mark = _mark;
}
{ // term '/' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7181,6 +7847,9 @@ term_raw(Parser *p)
p->mark = _mark;
}
{ // term '//' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7210,6 +7879,9 @@ term_raw(Parser *p)
p->mark = _mark;
}
{ // term '%' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7239,6 +7911,9 @@ term_raw(Parser *p)
p->mark = _mark;
}
{ // term '@' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7268,6 +7943,9 @@ term_raw(Parser *p)
p->mark = _mark;
}
{ // factor
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty factor_var;
if (
(factor_var = factor_rule(p)) // factor
@@ -7303,6 +7981,9 @@ factor_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '+' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -7329,6 +8010,9 @@ factor_rule(Parser *p)
p->mark = _mark;
}
{ // '-' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -7355,6 +8039,9 @@ factor_rule(Parser *p)
p->mark = _mark;
}
{ // '~' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -7381,6 +8068,9 @@ factor_rule(Parser *p)
p->mark = _mark;
}
{ // power
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty power_var;
if (
(power_var = power_rule(p)) // power
@@ -7415,6 +8105,9 @@ power_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // await_primary '**' factor
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7444,6 +8137,9 @@ power_rule(Parser *p)
p->mark = _mark;
}
{ // await_primary
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty await_primary_var;
if (
(await_primary_var = await_primary_rule(p)) // await_primary
@@ -7479,6 +8175,9 @@ await_primary_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // AWAIT primary
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
Token * await_var;
if (
@@ -7505,6 +8204,9 @@ await_primary_rule(Parser *p)
p->mark = _mark;
}
{ // primary
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty primary_var;
if (
(primary_var = primary_rule(p)) // primary
@@ -7569,6 +8271,9 @@ primary_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // primary '.' NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -7598,6 +8303,9 @@ primary_raw(Parser *p)
p->mark = _mark;
}
{ // primary genexp
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
expr_ty b;
if (
@@ -7624,6 +8332,9 @@ primary_raw(Parser *p)
p->mark = _mark;
}
{ // primary '(' arguments? ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -7656,6 +8367,9 @@ primary_raw(Parser *p)
p->mark = _mark;
}
{ // primary '[' slices ']'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -7688,6 +8402,9 @@ primary_raw(Parser *p)
p->mark = _mark;
}
{ // atom
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty atom_var;
if (
(atom_var = atom_rule(p)) // atom
@@ -7721,6 +8438,9 @@ slices_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // slice !','
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = slice_rule(p)) // slice
@@ -7738,6 +8458,9 @@ slices_rule(Parser *p)
p->mark = _mark;
}
{ // ','.slice+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -7787,6 +8510,9 @@ slice_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // expression? ':' expression? [':' expression?]
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *a;
void *b;
@@ -7819,6 +8545,9 @@ slice_rule(Parser *p)
p->mark = _mark;
}
{ // expression
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = expression_rule(p)) // expression
@@ -7867,6 +8596,9 @@ atom_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty name_var;
if (
(name_var = _PyPegen_name_token(p)) // NAME
@@ -7878,6 +8610,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // 'True'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 527)) // token='True'
@@ -7901,6 +8636,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // 'False'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 528)) // token='False'
@@ -7924,6 +8662,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // 'None'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 529)) // token='None'
@@ -7947,6 +8688,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // '__new_parser__'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 530)) // token='__new_parser__'
@@ -7962,6 +8706,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // &STRING strings
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty strings_var;
if (
_PyPegen_lookahead(1, _PyPegen_string_token, p)
@@ -7975,6 +8722,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // NUMBER
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty number_var;
if (
(number_var = _PyPegen_number_token(p)) // NUMBER
@@ -7986,6 +8736,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // &'(' (tuple | group | genexp)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_96_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 7) // token='('
@@ -7999,6 +8752,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // &'[' (list | listcomp)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_97_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 9) // token='['
@@ -8012,6 +8768,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // &'{' (dict | set | dictcomp | setcomp)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_98_var;
if (
_PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 25) // token='{'
@@ -8025,6 +8784,9 @@ atom_rule(Parser *p)
p->mark = _mark;
}
{ // '...'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 52)) // token='...'
@@ -8064,6 +8826,9 @@ strings_rule(Parser *p)
return _res;
int _mark = p->mark;
{ // STRING+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * a;
if (
(a = _loop1_99_rule(p)) // STRING+
@@ -8102,6 +8867,9 @@ list_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '[' star_named_expressions? ']'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -8153,6 +8921,9 @@ listcomp_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '[' named_expression for_if_clauses ']'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -8185,6 +8956,9 @@ listcomp_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_comprehension
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_comprehension_var;
if (
(invalid_comprehension_var = invalid_comprehension_rule(p)) // invalid_comprehension
@@ -8218,6 +8992,9 @@ tuple_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '(' [star_named_expression ',' star_named_expressions?] ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -8261,6 +9038,9 @@ group_rule(Parser *p)
expr_ty _res = NULL;
int _mark = p->mark;
{ // '(' (yield_expr | named_expression) ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -8304,6 +9084,9 @@ genexp_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '(' expression for_if_clauses ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -8336,6 +9119,9 @@ genexp_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_comprehension
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_comprehension_var;
if (
(invalid_comprehension_var = invalid_comprehension_rule(p)) // invalid_comprehension
@@ -8369,6 +9155,9 @@ set_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '{' expressions_list '}'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq* a;
@@ -8420,6 +9209,9 @@ setcomp_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '{' expression for_if_clauses '}'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -8452,6 +9244,9 @@ setcomp_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_comprehension
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_comprehension_var;
if (
(invalid_comprehension_var = invalid_comprehension_rule(p)) // invalid_comprehension
@@ -8485,6 +9280,9 @@ dict_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '{' kvpairs? '}'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -8536,6 +9334,9 @@ dictcomp_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '{' kvpair for_if_clauses '}'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
KeyValuePair* a;
@@ -8582,6 +9383,9 @@ kvpairs_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.kvpair+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -8615,6 +9419,9 @@ kvpair_rule(Parser *p)
KeyValuePair* _res = NULL;
int _mark = p->mark;
{ // '**' bitwise_or
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -8633,6 +9440,9 @@ kvpair_rule(Parser *p)
p->mark = _mark;
}
{ // expression ':' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -8668,6 +9478,9 @@ for_if_clauses_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // for_if_clause+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * _loop1_104_var;
if (
(_loop1_104_var = _loop1_104_rule(p)) // for_if_clause+
@@ -8695,6 +9508,9 @@ for_if_clause_rule(Parser *p)
comprehension_ty _res = NULL;
int _mark = p->mark;
{ // ASYNC 'for' star_targets 'in' disjunction (('if' disjunction))*
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
expr_ty a;
@@ -8725,6 +9541,9 @@ for_if_clause_rule(Parser *p)
p->mark = _mark;
}
{ // 'for' star_targets 'in' disjunction (('if' disjunction))*
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
expr_ty a;
@@ -8774,6 +9593,9 @@ yield_expr_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // 'yield' 'from' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
Token * _keyword_1;
expr_ty a;
@@ -8803,6 +9625,9 @@ yield_expr_rule(Parser *p)
p->mark = _mark;
}
{ // 'yield' star_expressions?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
void *a;
if (
@@ -8845,6 +9670,9 @@ arguments_rule(Parser *p)
return _res;
int _mark = p->mark;
{ // args ','? &')'
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty a;
@@ -8866,6 +9694,9 @@ arguments_rule(Parser *p)
p->mark = _mark;
}
{ // incorrect_arguments
+ if (p->error_indicator) {
+ return NULL;
+ }
void *incorrect_arguments_var;
if (
(incorrect_arguments_var = incorrect_arguments_rule(p)) // incorrect_arguments
@@ -8900,6 +9731,9 @@ args_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // starred_expression [',' args]
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
void *b;
if (
@@ -8926,6 +9760,9 @@ args_rule(Parser *p)
p->mark = _mark;
}
{ // kwargs
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* a;
if (
(a = kwargs_rule(p)) // kwargs
@@ -8949,6 +9786,9 @@ args_rule(Parser *p)
p->mark = _mark;
}
{ // named_expression [',' args]
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
void *b;
if (
@@ -8992,6 +9832,9 @@ kwargs_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
asdl_seq * a;
asdl_seq * b;
@@ -9013,6 +9856,9 @@ kwargs_rule(Parser *p)
p->mark = _mark;
}
{ // ','.kwarg_or_starred+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * _gather_113_var;
if (
(_gather_113_var = _gather_113_rule(p)) // ','.kwarg_or_starred+
@@ -9024,6 +9870,9 @@ kwargs_rule(Parser *p)
p->mark = _mark;
}
{ // ','.kwarg_or_double_starred+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * _gather_115_var;
if (
(_gather_115_var = _gather_115_rule(p)) // ','.kwarg_or_double_starred+
@@ -9057,6 +9906,9 @@ starred_expression_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '*' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -9105,6 +9957,9 @@ kwarg_or_starred_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME '=' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -9134,6 +9989,9 @@ kwarg_or_starred_rule(Parser *p)
p->mark = _mark;
}
{ // starred_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = starred_expression_rule(p)) // starred_expression
@@ -9149,6 +10007,9 @@ kwarg_or_starred_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_kwarg
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_kwarg_var;
if (
(invalid_kwarg_var = invalid_kwarg_rule(p)) // invalid_kwarg
@@ -9182,6 +10043,9 @@ kwarg_or_double_starred_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME '=' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -9211,6 +10075,9 @@ kwarg_or_double_starred_rule(Parser *p)
p->mark = _mark;
}
{ // '**' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -9237,6 +10104,9 @@ kwarg_or_double_starred_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_kwarg
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_kwarg_var;
if (
(invalid_kwarg_var = invalid_kwarg_rule(p)) // invalid_kwarg
@@ -9270,6 +10140,9 @@ star_targets_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // star_target !','
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = star_target_rule(p)) // star_target
@@ -9287,6 +10160,9 @@ star_targets_rule(Parser *p)
p->mark = _mark;
}
{ // star_target ((',' star_target))* ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty a;
@@ -9331,6 +10207,9 @@ star_targets_seq_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.star_target+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -9378,6 +10257,9 @@ star_target_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // '*' (!'*' star_target)
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *a;
if (
@@ -9404,6 +10286,9 @@ star_target_rule(Parser *p)
p->mark = _mark;
}
{ // t_primary '.' NAME !t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -9435,6 +10320,9 @@ star_target_rule(Parser *p)
p->mark = _mark;
}
{ // t_primary '[' slices ']' !t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -9469,6 +10357,9 @@ star_target_rule(Parser *p)
p->mark = _mark;
}
{ // star_atom
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_atom_var;
if (
(star_atom_var = star_atom_rule(p)) // star_atom
@@ -9507,6 +10398,9 @@ star_atom_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = _PyPegen_name_token(p)) // NAME
@@ -9522,6 +10416,9 @@ star_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '(' star_target ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -9543,6 +10440,9 @@ star_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '(' star_targets_seq? ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -9572,6 +10472,9 @@ star_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '[' star_targets_seq? ']'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -9615,6 +10518,9 @@ single_target_rule(Parser *p)
expr_ty _res = NULL;
int _mark = p->mark;
{ // single_subscript_attribute_target
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty single_subscript_attribute_target_var;
if (
(single_subscript_attribute_target_var = single_subscript_attribute_target_rule(p)) // single_subscript_attribute_target
@@ -9626,6 +10532,9 @@ single_target_rule(Parser *p)
p->mark = _mark;
}
{ // NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = _PyPegen_name_token(p)) // NAME
@@ -9641,6 +10550,9 @@ single_target_rule(Parser *p)
p->mark = _mark;
}
{ // '(' single_target ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -9686,6 +10598,9 @@ single_subscript_attribute_target_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // t_primary '.' NAME !t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -9717,6 +10632,9 @@ single_subscript_attribute_target_rule(Parser *p)
p->mark = _mark;
}
{ // t_primary '[' slices ']' !t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -9765,6 +10683,9 @@ del_targets_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.del_target+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -9811,6 +10732,9 @@ del_target_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // t_primary '.' NAME &del_target_end
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -9842,6 +10766,9 @@ del_target_rule(Parser *p)
p->mark = _mark;
}
{ // t_primary '[' slices ']' &del_target_end
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -9876,6 +10803,9 @@ del_target_rule(Parser *p)
p->mark = _mark;
}
{ // del_t_atom
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty del_t_atom_var;
if (
(del_t_atom_var = del_t_atom_rule(p)) // del_t_atom
@@ -9915,6 +10845,9 @@ del_t_atom_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME &del_target_end
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = _PyPegen_name_token(p)) // NAME
@@ -9932,6 +10865,9 @@ del_t_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '(' del_target ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -9953,6 +10889,9 @@ del_t_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '(' del_targets? ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -9982,6 +10921,9 @@ del_t_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '[' del_targets? ']'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *a;
@@ -10011,6 +10953,9 @@ del_t_atom_rule(Parser *p)
p->mark = _mark;
}
{ // invalid_del_target
+ if (p->error_indicator) {
+ return NULL;
+ }
void *invalid_del_target_var;
if (
(invalid_del_target_var = invalid_del_target_rule(p)) // invalid_del_target
@@ -10036,6 +10981,9 @@ del_target_end_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 8)) // token=')'
@@ -10047,6 +10995,9 @@ del_target_end_rule(Parser *p)
p->mark = _mark;
}
{ // ']'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 10)) // token=']'
@@ -10058,6 +11009,9 @@ del_target_end_rule(Parser *p)
p->mark = _mark;
}
{ // ','
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
@@ -10069,6 +11023,9 @@ del_target_end_rule(Parser *p)
p->mark = _mark;
}
{ // ';'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 13)) // token=';'
@@ -10080,6 +11037,9 @@ del_target_end_rule(Parser *p)
p->mark = _mark;
}
{ // NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * newline_var;
if (
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
@@ -10105,6 +11065,9 @@ targets_rule(Parser *p)
asdl_seq* _res = NULL;
int _mark = p->mark;
{ // ','.target+ ','?
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
asdl_seq * a;
@@ -10151,6 +11114,9 @@ target_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // t_primary '.' NAME !t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -10182,6 +11148,9 @@ target_rule(Parser *p)
p->mark = _mark;
}
{ // t_primary '[' slices ']' !t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -10216,6 +11185,9 @@ target_rule(Parser *p)
p->mark = _mark;
}
{ // t_atom
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty t_atom_var;
if (
(t_atom_var = t_atom_rule(p)) // t_atom
@@ -10280,6 +11252,9 @@ t_primary_raw(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // t_primary '.' NAME &t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty b;
@@ -10311,6 +11286,9 @@ t_primary_raw(Parser *p)
p->mark = _mark;
}
{ // t_primary '[' slices ']' &t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -10345,6 +11323,9 @@ t_primary_raw(Parser *p)
p->mark = _mark;
}
{ // t_primary genexp &t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
expr_ty b;
if (
@@ -10373,6 +11354,9 @@ t_primary_raw(Parser *p)
p->mark = _mark;
}
{ // t_primary '(' arguments? ')' &t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -10407,6 +11391,9 @@ t_primary_raw(Parser *p)
p->mark = _mark;
}
{ // atom &t_lookahead
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = atom_rule(p)) // atom
@@ -10438,6 +11425,9 @@ t_lookahead_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '('
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 7)) // token='('
@@ -10449,6 +11439,9 @@ t_lookahead_rule(Parser *p)
p->mark = _mark;
}
{ // '['
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 9)) // token='['
@@ -10460,6 +11453,9 @@ t_lookahead_rule(Parser *p)
p->mark = _mark;
}
{ // '.'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 23)) // token='.'
@@ -10493,6 +11489,9 @@ t_atom_rule(Parser *p)
int _start_col_offset = p->tokens[_mark]->col_offset;
UNUSED(_start_col_offset); // Only used by EXTRA macro
{ // NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = _PyPegen_name_token(p)) // NAME
@@ -10508,6 +11507,9 @@ t_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '(' target ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty a;
@@ -10529,6 +11531,9 @@ t_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '(' targets? ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *b;
@@ -10558,6 +11563,9 @@ t_atom_rule(Parser *p)
p->mark = _mark;
}
{ // '[' targets? ']'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *b;
@@ -10604,6 +11612,9 @@ incorrect_arguments_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // args ',' '*'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty args_var;
@@ -10625,6 +11636,9 @@ incorrect_arguments_rule(Parser *p)
p->mark = _mark;
}
{ // expression for_if_clauses ',' [args | expression for_if_clauses]
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
@@ -10650,6 +11664,9 @@ incorrect_arguments_rule(Parser *p)
p->mark = _mark;
}
{ // args ',' args
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty args_var;
@@ -10685,6 +11702,9 @@ invalid_kwarg_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // expression '='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -10717,6 +11737,9 @@ invalid_named_expression_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // expression ':=' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
expr_ty expression_var;
@@ -10758,6 +11781,9 @@ invalid_assignment_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // list ':'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -10776,6 +11802,9 @@ invalid_assignment_rule(Parser *p)
p->mark = _mark;
}
{ // tuple ':'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty a;
if (
@@ -10794,6 +11823,9 @@ invalid_assignment_rule(Parser *p)
p->mark = _mark;
}
{ // star_named_expression ',' star_named_expressions* ':'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
asdl_seq * _loop0_126_var;
@@ -10818,6 +11850,9 @@ invalid_assignment_rule(Parser *p)
p->mark = _mark;
}
{ // expression ':' expression ['=' annotated_rhs]
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
@@ -10843,6 +11878,9 @@ invalid_assignment_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions '=' (yield_expr | star_expressions)
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *_tmp_128_var;
expr_ty a;
@@ -10864,6 +11902,9 @@ invalid_assignment_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions augassign (yield_expr | star_expressions)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_129_var;
expr_ty a;
AugOperator* augassign_var;
@@ -10899,6 +11940,9 @@ invalid_block_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // NEWLINE !INDENT
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * newline_var;
if (
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
@@ -10930,6 +11974,9 @@ invalid_comprehension_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ('[' | '(' | '{') starred_expression for_if_clauses
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_130_var;
expr_ty a;
asdl_seq* for_if_clauses_var;
@@ -10966,6 +12013,9 @@ invalid_parameters_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // param_no_default* (slash_with_default | param_with_default+) param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * _loop0_131_var;
void *_tmp_132_var;
arg_ty param_no_default_var;
@@ -11001,6 +12051,9 @@ invalid_star_etc_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '*' (')' | ',' (')' | '**'))
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *_tmp_133_var;
if (
@@ -11033,6 +12086,9 @@ invalid_lambda_star_etc_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '*' (':' | ',' (':' | '**'))
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *_tmp_134_var;
if (
@@ -11065,6 +12121,9 @@ invalid_double_type_comments_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * indent_var;
Token * newline_var;
Token * newline_var_1;
@@ -11106,6 +12165,9 @@ invalid_del_target_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // star_expression &del_target_end
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty a;
if (
(a = star_expression_rule(p)) // star_expression
@@ -11146,6 +12208,9 @@ _loop0_1_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * newline_var;
while (
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
@@ -11199,6 +12264,9 @@ _loop0_2_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * newline_var;
while (
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
@@ -11252,6 +12320,9 @@ _loop0_4_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -11304,6 +12375,9 @@ _gather_3_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // expression _loop0_4
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -11341,6 +12415,9 @@ _loop0_6_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -11393,6 +12470,9 @@ _gather_5_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // expression _loop0_6
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -11430,6 +12510,9 @@ _loop0_8_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -11482,6 +12565,9 @@ _gather_7_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // expression _loop0_8
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -11519,6 +12605,9 @@ _loop0_10_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -11571,6 +12660,9 @@ _gather_9_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // expression _loop0_10
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -11608,6 +12700,9 @@ _loop1_11_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // statement
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* statement_var;
while (
(statement_var = statement_rule(p)) // statement
@@ -11665,6 +12760,9 @@ _loop0_13_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ';' small_stmt
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
stmt_ty elem;
while (
@@ -11717,6 +12815,9 @@ _gather_12_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // small_stmt _loop0_13
+ if (p->error_indicator) {
+ return NULL;
+ }
stmt_ty elem;
asdl_seq * seq;
if (
@@ -11745,6 +12846,9 @@ _tmp_14_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'import'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 513)) // token='import'
@@ -11756,6 +12860,9 @@ _tmp_14_rule(Parser *p)
p->mark = _mark;
}
{ // 'from'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 514)) // token='from'
@@ -11781,6 +12888,9 @@ _tmp_15_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'def'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 522)) // token='def'
@@ -11792,6 +12902,9 @@ _tmp_15_rule(Parser *p)
p->mark = _mark;
}
{ // '@'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 49)) // token='@'
@@ -11803,6 +12916,9 @@ _tmp_15_rule(Parser *p)
p->mark = _mark;
}
{ // ASYNC
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * async_var;
if (
(async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC'
@@ -11828,6 +12944,9 @@ _tmp_16_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'class'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 523)) // token='class'
@@ -11839,6 +12958,9 @@ _tmp_16_rule(Parser *p)
p->mark = _mark;
}
{ // '@'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 49)) // token='@'
@@ -11864,6 +12986,9 @@ _tmp_17_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'with'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 519)) // token='with'
@@ -11875,6 +13000,9 @@ _tmp_17_rule(Parser *p)
p->mark = _mark;
}
{ // ASYNC
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * async_var;
if (
(async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC'
@@ -11900,6 +13028,9 @@ _tmp_18_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'for'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 517)) // token='for'
@@ -11911,6 +13042,9 @@ _tmp_18_rule(Parser *p)
p->mark = _mark;
}
{ // ASYNC
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * async_var;
if (
(async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC'
@@ -11936,6 +13070,9 @@ _tmp_19_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '=' annotated_rhs
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty d;
if (
@@ -11968,6 +13105,9 @@ _tmp_20_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '(' single_target ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
expr_ty b;
@@ -11989,6 +13129,9 @@ _tmp_20_rule(Parser *p)
p->mark = _mark;
}
{ // single_subscript_attribute_target
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty single_subscript_attribute_target_var;
if (
(single_subscript_attribute_target_var = single_subscript_attribute_target_rule(p)) // single_subscript_attribute_target
@@ -12014,6 +13157,9 @@ _tmp_21_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '=' annotated_rhs
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty d;
if (
@@ -12055,6 +13201,9 @@ _loop1_22_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // (star_targets '=')
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_135_var;
while (
(_tmp_135_var = _tmp_135_rule(p)) // star_targets '='
@@ -12103,6 +13252,9 @@ _tmp_23_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // yield_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty yield_expr_var;
if (
(yield_expr_var = yield_expr_rule(p)) // yield_expr
@@ -12114,6 +13266,9 @@ _tmp_23_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
@@ -12139,6 +13294,9 @@ _tmp_24_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // yield_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty yield_expr_var;
if (
(yield_expr_var = yield_expr_rule(p)) // yield_expr
@@ -12150,6 +13308,9 @@ _tmp_24_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
@@ -12184,6 +13345,9 @@ _loop0_26_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -12236,6 +13400,9 @@ _gather_25_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // NAME _loop0_26
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -12273,6 +13440,9 @@ _loop0_28_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -12325,6 +13495,9 @@ _gather_27_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // NAME _loop0_28
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -12353,6 +13526,9 @@ _tmp_29_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ',' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty z;
if (
@@ -12394,6 +13570,9 @@ _loop0_30_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ('.' | '...')
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_136_var;
while (
(_tmp_136_var = _tmp_136_rule(p)) // '.' | '...'
@@ -12447,6 +13626,9 @@ _loop1_31_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ('.' | '...')
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_137_var;
while (
(_tmp_137_var = _tmp_137_rule(p)) // '.' | '...'
@@ -12504,6 +13686,9 @@ _loop0_33_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' import_from_as_name
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
alias_ty elem;
while (
@@ -12556,6 +13741,9 @@ _gather_32_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // import_from_as_name _loop0_33
+ if (p->error_indicator) {
+ return NULL;
+ }
alias_ty elem;
asdl_seq * seq;
if (
@@ -12584,6 +13772,9 @@ _tmp_34_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'as' NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty z;
if (
@@ -12625,6 +13816,9 @@ _loop0_36_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' dotted_as_name
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
alias_ty elem;
while (
@@ -12677,6 +13871,9 @@ _gather_35_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // dotted_as_name _loop0_36
+ if (p->error_indicator) {
+ return NULL;
+ }
alias_ty elem;
asdl_seq * seq;
if (
@@ -12705,6 +13902,9 @@ _tmp_37_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'as' NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty z;
if (
@@ -12746,6 +13946,9 @@ _loop0_39_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' with_item
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
withitem_ty elem;
while (
@@ -12798,6 +14001,9 @@ _gather_38_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // with_item _loop0_39
+ if (p->error_indicator) {
+ return NULL;
+ }
withitem_ty elem;
asdl_seq * seq;
if (
@@ -12835,6 +14041,9 @@ _loop0_41_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' with_item
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
withitem_ty elem;
while (
@@ -12887,6 +14096,9 @@ _gather_40_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // with_item _loop0_41
+ if (p->error_indicator) {
+ return NULL;
+ }
withitem_ty elem;
asdl_seq * seq;
if (
@@ -12924,6 +14136,9 @@ _loop0_43_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' with_item
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
withitem_ty elem;
while (
@@ -12976,6 +14191,9 @@ _gather_42_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // with_item _loop0_43
+ if (p->error_indicator) {
+ return NULL;
+ }
withitem_ty elem;
asdl_seq * seq;
if (
@@ -13013,6 +14231,9 @@ _loop0_45_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' with_item
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
withitem_ty elem;
while (
@@ -13065,6 +14286,9 @@ _gather_44_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // with_item _loop0_45
+ if (p->error_indicator) {
+ return NULL;
+ }
withitem_ty elem;
asdl_seq * seq;
if (
@@ -13093,6 +14317,9 @@ _tmp_46_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'as' target
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty t;
if (
@@ -13134,6 +14361,9 @@ _loop1_47_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // except_block
+ if (p->error_indicator) {
+ return NULL;
+ }
excepthandler_ty except_block_var;
while (
(except_block_var = except_block_rule(p)) // except_block
@@ -13182,6 +14412,9 @@ _tmp_48_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'as' NAME
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty z;
if (
@@ -13214,6 +14447,9 @@ _tmp_49_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'from' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty z;
if (
@@ -13246,6 +14482,9 @@ _tmp_50_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '->' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty z;
if (
@@ -13278,6 +14517,9 @@ _tmp_51_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '->' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty z;
if (
@@ -13310,6 +14552,9 @@ _tmp_52_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // NEWLINE INDENT
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * indent_var;
Token * newline_var;
if (
@@ -13347,6 +14592,9 @@ _loop0_53_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -13400,6 +14648,9 @@ _loop0_54_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -13453,6 +14704,9 @@ _loop0_55_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -13506,6 +14760,9 @@ _loop1_56_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -13563,6 +14820,9 @@ _loop0_57_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -13616,6 +14876,9 @@ _loop1_58_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -13673,6 +14936,9 @@ _loop1_59_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -13730,6 +14996,9 @@ _loop1_60_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -13787,6 +15056,9 @@ _loop0_61_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -13840,6 +15112,9 @@ _loop1_62_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -13897,6 +15172,9 @@ _loop0_63_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -13950,6 +15228,9 @@ _loop1_64_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -14007,6 +15288,9 @@ _loop0_65_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_maybe_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_maybe_default_var;
while (
(param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default
@@ -14060,6 +15344,9 @@ _loop1_66_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_maybe_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_maybe_default_var;
while (
(param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default
@@ -14117,6 +15404,9 @@ _loop1_67_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ('@' named_expression NEWLINE)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_138_var;
while (
(_tmp_138_var = _tmp_138_rule(p)) // '@' named_expression NEWLINE
@@ -14165,6 +15455,9 @@ _tmp_68_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '(' arguments? ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
Token * _literal_1;
void *z;
@@ -14209,6 +15502,9 @@ _loop0_70_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' star_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -14261,6 +15557,9 @@ _gather_69_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // star_expression _loop0_70
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -14298,6 +15597,9 @@ _loop1_71_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // (',' star_expression)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_139_var;
while (
(_tmp_139_var = _tmp_139_rule(p)) // ',' star_expression
@@ -14355,6 +15657,9 @@ _loop0_73_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' star_named_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -14407,6 +15712,9 @@ _gather_72_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // star_named_expression _loop0_73
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -14444,6 +15752,9 @@ _loop1_74_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // (',' expression)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_140_var;
while (
(_tmp_140_var = _tmp_140_rule(p)) // ',' expression
@@ -14501,6 +15812,9 @@ _loop0_75_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -14554,6 +15868,9 @@ _loop0_76_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_with_default_var;
while (
(lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default
@@ -14607,6 +15924,9 @@ _loop0_77_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_with_default_var;
while (
(lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default
@@ -14660,6 +15980,9 @@ _loop1_78_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -14717,6 +16040,9 @@ _loop0_79_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_with_default_var;
while (
(lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default
@@ -14770,6 +16096,9 @@ _loop1_80_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_with_default_var;
while (
(lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default
@@ -14827,6 +16156,9 @@ _loop1_81_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -14884,6 +16216,9 @@ _loop1_82_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -14941,6 +16276,9 @@ _loop0_83_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -14994,6 +16332,9 @@ _loop1_84_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_with_default_var;
while (
(lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default
@@ -15051,6 +16392,9 @@ _loop0_85_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -15104,6 +16448,9 @@ _loop1_86_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_with_default_var;
while (
(lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default
@@ -15161,6 +16508,9 @@ _loop0_87_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_maybe_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_maybe_default_var;
while (
(lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default
@@ -15214,6 +16564,9 @@ _loop1_88_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // lambda_param_maybe_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* lambda_param_maybe_default_var;
while (
(lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default
@@ -15271,6 +16624,9 @@ _loop1_89_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ('or' conjunction)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_141_var;
while (
(_tmp_141_var = _tmp_141_rule(p)) // 'or' conjunction
@@ -15328,6 +16684,9 @@ _loop1_90_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ('and' inversion)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_142_var;
while (
(_tmp_142_var = _tmp_142_rule(p)) // 'and' inversion
@@ -15385,6 +16744,9 @@ _loop1_91_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // compare_op_bitwise_or_pair
+ if (p->error_indicator) {
+ return NULL;
+ }
CmpopExprPair* compare_op_bitwise_or_pair_var;
while (
(compare_op_bitwise_or_pair_var = compare_op_bitwise_or_pair_rule(p)) // compare_op_bitwise_or_pair
@@ -15433,6 +16795,9 @@ _tmp_92_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '!='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * tok;
if (
(tok = _PyPegen_expect_token(p, 28)) // token='!='
@@ -15471,6 +16836,9 @@ _loop0_94_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' slice
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -15523,6 +16891,9 @@ _gather_93_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // slice _loop0_94
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -15551,6 +16922,9 @@ _tmp_95_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ':' expression?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *d;
if (
@@ -15583,6 +16957,9 @@ _tmp_96_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // tuple
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty tuple_var;
if (
(tuple_var = tuple_rule(p)) // tuple
@@ -15594,6 +16971,9 @@ _tmp_96_rule(Parser *p)
p->mark = _mark;
}
{ // group
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty group_var;
if (
(group_var = group_rule(p)) // group
@@ -15605,6 +16985,9 @@ _tmp_96_rule(Parser *p)
p->mark = _mark;
}
{ // genexp
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty genexp_var;
if (
(genexp_var = genexp_rule(p)) // genexp
@@ -15630,6 +17013,9 @@ _tmp_97_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // list
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty list_var;
if (
(list_var = list_rule(p)) // list
@@ -15641,6 +17027,9 @@ _tmp_97_rule(Parser *p)
p->mark = _mark;
}
{ // listcomp
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty listcomp_var;
if (
(listcomp_var = listcomp_rule(p)) // listcomp
@@ -15666,6 +17055,9 @@ _tmp_98_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // dict
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty dict_var;
if (
(dict_var = dict_rule(p)) // dict
@@ -15677,6 +17069,9 @@ _tmp_98_rule(Parser *p)
p->mark = _mark;
}
{ // set
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty set_var;
if (
(set_var = set_rule(p)) // set
@@ -15688,6 +17083,9 @@ _tmp_98_rule(Parser *p)
p->mark = _mark;
}
{ // dictcomp
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty dictcomp_var;
if (
(dictcomp_var = dictcomp_rule(p)) // dictcomp
@@ -15699,6 +17097,9 @@ _tmp_98_rule(Parser *p)
p->mark = _mark;
}
{ // setcomp
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty setcomp_var;
if (
(setcomp_var = setcomp_rule(p)) // setcomp
@@ -15733,6 +17134,9 @@ _loop1_99_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // STRING
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty string_var;
while (
(string_var = _PyPegen_string_token(p)) // STRING
@@ -15781,6 +17185,9 @@ _tmp_100_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // star_named_expression ',' star_named_expressions?
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty y;
void *z;
@@ -15816,6 +17223,9 @@ _tmp_101_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // yield_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty yield_expr_var;
if (
(yield_expr_var = yield_expr_rule(p)) // yield_expr
@@ -15827,6 +17237,9 @@ _tmp_101_rule(Parser *p)
p->mark = _mark;
}
{ // named_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty named_expression_var;
if (
(named_expression_var = named_expression_rule(p)) // named_expression
@@ -15861,6 +17274,9 @@ _loop0_103_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' kvpair
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
KeyValuePair* elem;
while (
@@ -15913,6 +17329,9 @@ _gather_102_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // kvpair _loop0_103
+ if (p->error_indicator) {
+ return NULL;
+ }
KeyValuePair* elem;
asdl_seq * seq;
if (
@@ -15950,6 +17369,9 @@ _loop1_104_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // for_if_clause
+ if (p->error_indicator) {
+ return NULL;
+ }
comprehension_ty for_if_clause_var;
while (
(for_if_clause_var = for_if_clause_rule(p)) // for_if_clause
@@ -16007,6 +17429,9 @@ _loop0_105_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ('if' disjunction)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_143_var;
while (
(_tmp_143_var = _tmp_143_rule(p)) // 'if' disjunction
@@ -16060,6 +17485,9 @@ _loop0_106_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ('if' disjunction)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_144_var;
while (
(_tmp_144_var = _tmp_144_rule(p)) // 'if' disjunction
@@ -16104,6 +17532,9 @@ _tmp_107_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ',' args
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty c;
if (
@@ -16136,6 +17567,9 @@ _tmp_108_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ',' args
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty c;
if (
@@ -16177,6 +17611,9 @@ _loop0_110_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' kwarg_or_starred
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
KeywordOrStarred* elem;
while (
@@ -16229,6 +17666,9 @@ _gather_109_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // kwarg_or_starred _loop0_110
+ if (p->error_indicator) {
+ return NULL;
+ }
KeywordOrStarred* elem;
asdl_seq * seq;
if (
@@ -16266,6 +17706,9 @@ _loop0_112_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' kwarg_or_double_starred
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
KeywordOrStarred* elem;
while (
@@ -16318,6 +17761,9 @@ _gather_111_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // kwarg_or_double_starred _loop0_112
+ if (p->error_indicator) {
+ return NULL;
+ }
KeywordOrStarred* elem;
asdl_seq * seq;
if (
@@ -16355,6 +17801,9 @@ _loop0_114_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' kwarg_or_starred
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
KeywordOrStarred* elem;
while (
@@ -16407,6 +17856,9 @@ _gather_113_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // kwarg_or_starred _loop0_114
+ if (p->error_indicator) {
+ return NULL;
+ }
KeywordOrStarred* elem;
asdl_seq * seq;
if (
@@ -16444,6 +17896,9 @@ _loop0_116_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' kwarg_or_double_starred
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
KeywordOrStarred* elem;
while (
@@ -16496,6 +17951,9 @@ _gather_115_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // kwarg_or_double_starred _loop0_116
+ if (p->error_indicator) {
+ return NULL;
+ }
KeywordOrStarred* elem;
asdl_seq * seq;
if (
@@ -16533,6 +17991,9 @@ _loop0_117_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // (',' star_target)
+ if (p->error_indicator) {
+ return NULL;
+ }
void *_tmp_145_var;
while (
(_tmp_145_var = _tmp_145_rule(p)) // ',' star_target
@@ -16586,6 +18047,9 @@ _loop0_119_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' star_target
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -16638,6 +18102,9 @@ _gather_118_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // star_target _loop0_119
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -16666,6 +18133,9 @@ _tmp_120_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // !'*' star_target
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_target_var;
if (
_PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 16) // token='*'
@@ -16702,6 +18172,9 @@ _loop0_122_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' del_target
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -16754,6 +18227,9 @@ _gather_121_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // del_target _loop0_122
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -16791,6 +18267,9 @@ _loop0_124_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // ',' target
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty elem;
while (
@@ -16843,6 +18322,9 @@ _gather_123_rule(Parser *p)
asdl_seq * _res = NULL;
int _mark = p->mark;
{ // target _loop0_124
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty elem;
asdl_seq * seq;
if (
@@ -16871,6 +18353,9 @@ _tmp_125_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // args
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty args_var;
if (
(args_var = args_rule(p)) // args
@@ -16882,6 +18367,9 @@ _tmp_125_rule(Parser *p)
p->mark = _mark;
}
{ // expression for_if_clauses
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty expression_var;
asdl_seq* for_if_clauses_var;
if (
@@ -16919,6 +18407,9 @@ _loop0_126_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // star_named_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq* star_named_expressions_var;
while (
(star_named_expressions_var = star_named_expressions_rule(p)) // star_named_expressions
@@ -16963,6 +18454,9 @@ _tmp_127_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '=' annotated_rhs
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty annotated_rhs_var;
if (
@@ -16991,6 +18485,9 @@ _tmp_128_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // yield_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty yield_expr_var;
if (
(yield_expr_var = yield_expr_rule(p)) // yield_expr
@@ -17002,6 +18499,9 @@ _tmp_128_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
@@ -17027,6 +18527,9 @@ _tmp_129_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // yield_expr
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty yield_expr_var;
if (
(yield_expr_var = yield_expr_rule(p)) // yield_expr
@@ -17038,6 +18541,9 @@ _tmp_129_rule(Parser *p)
p->mark = _mark;
}
{ // star_expressions
+ if (p->error_indicator) {
+ return NULL;
+ }
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
@@ -17063,6 +18569,9 @@ _tmp_130_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '['
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 9)) // token='['
@@ -17074,6 +18583,9 @@ _tmp_130_rule(Parser *p)
p->mark = _mark;
}
{ // '('
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 7)) // token='('
@@ -17085,6 +18597,9 @@ _tmp_130_rule(Parser *p)
p->mark = _mark;
}
{ // '{'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
@@ -17119,6 +18634,9 @@ _loop0_131_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_no_default
+ if (p->error_indicator) {
+ return NULL;
+ }
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -17163,6 +18681,9 @@ _tmp_132_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // slash_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
SlashWithDefault* slash_with_default_var;
if (
(slash_with_default_var = slash_with_default_rule(p)) // slash_with_default
@@ -17174,6 +18695,9 @@ _tmp_132_rule(Parser *p)
p->mark = _mark;
}
{ // param_with_default+
+ if (p->error_indicator) {
+ return NULL;
+ }
asdl_seq * _loop1_146_var;
if (
(_loop1_146_var = _loop1_146_rule(p)) // param_with_default+
@@ -17199,6 +18723,9 @@ _tmp_133_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 8)) // token=')'
@@ -17210,6 +18737,9 @@ _tmp_133_rule(Parser *p)
p->mark = _mark;
}
{ // ',' (')' | '**')
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *_tmp_147_var;
if (
@@ -17238,6 +18768,9 @@ _tmp_134_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ':'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
@@ -17249,6 +18782,9 @@ _tmp_134_rule(Parser *p)
p->mark = _mark;
}
{ // ',' (':' | '**')
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
void *_tmp_148_var;
if (
@@ -17277,6 +18813,9 @@ _tmp_135_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // star_targets '='
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty z;
if (
@@ -17309,6 +18848,9 @@ _tmp_136_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '.'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 23)) // token='.'
@@ -17320,6 +18862,9 @@ _tmp_136_rule(Parser *p)
p->mark = _mark;
}
{ // '...'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 52)) // token='...'
@@ -17345,6 +18890,9 @@ _tmp_137_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '.'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 23)) // token='.'
@@ -17356,6 +18904,9 @@ _tmp_137_rule(Parser *p)
p->mark = _mark;
}
{ // '...'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 52)) // token='...'
@@ -17381,6 +18932,9 @@ _tmp_138_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // '@' named_expression NEWLINE
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty f;
Token * newline_var;
@@ -17416,6 +18970,9 @@ _tmp_139_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ',' star_expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty c;
if (
@@ -17448,6 +19005,9 @@ _tmp_140_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ',' expression
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty c;
if (
@@ -17480,6 +19040,9 @@ _tmp_141_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'or' conjunction
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty c;
if (
@@ -17512,6 +19075,9 @@ _tmp_142_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'and' inversion
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty c;
if (
@@ -17544,6 +19110,9 @@ _tmp_143_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'if' disjunction
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty z;
if (
@@ -17576,6 +19145,9 @@ _tmp_144_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // 'if' disjunction
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _keyword;
expr_ty z;
if (
@@ -17608,6 +19180,9 @@ _tmp_145_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ',' star_target
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
expr_ty c;
if (
@@ -17649,6 +19224,9 @@ _loop1_146_rule(Parser *p)
ssize_t _children_capacity = 1;
ssize_t _n = 0;
{ // param_with_default
+ if (p->error_indicator) {
+ return NULL;
+ }
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -17697,6 +19275,9 @@ _tmp_147_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ')'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 8)) // token=')'
@@ -17708,6 +19289,9 @@ _tmp_147_rule(Parser *p)
p->mark = _mark;
}
{ // '**'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 35)) // token='**'
@@ -17733,6 +19317,9 @@ _tmp_148_rule(Parser *p)
void * _res = NULL;
int _mark = p->mark;
{ // ':'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
@@ -17744,6 +19331,9 @@ _tmp_148_rule(Parser *p)
p->mark = _mark;
}
{ // '**'
+ if (p->error_indicator) {
+ return NULL;
+ }
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 35)) // token='**'
diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py
index 8f9972b..c93b348 100644
--- a/Tools/peg_generator/pegen/c_generator.py
+++ b/Tools/peg_generator/pegen/c_generator.py
@@ -433,6 +433,12 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
self.print("int _end_col_offset = _token->end_col_offset;")
self.print("UNUSED(_end_col_offset); // Only used by EXTRA macro")
+ def _check_for_errors(self) -> None:
+ self.print("if (p->error_indicator) {")
+ with self.indent():
+ self.print("return NULL;")
+ self.print("}")
+
def _set_up_rule_memoization(self, node: Rule, result_type: str) -> None:
self.print("{")
with self.indent():
@@ -468,10 +474,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
memoize = self._should_memoize(node)
with self.indent():
- self.print("if (p->error_indicator) {")
- with self.indent():
- self.print("return NULL;")
- self.print("}")
+ self._check_for_errors()
self.print(f"{result_type} _res = NULL;")
if memoize:
self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &_res))")
@@ -500,10 +503,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
is_repeat1 = node.name.startswith("_loop1")
with self.indent():
- self.print("if (p->error_indicator) {")
- with self.indent():
- self.print("return NULL;")
- self.print("}")
+ self._check_for_errors()
self.print("void *_res = NULL;")
if memoize:
self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &_res))")
@@ -687,6 +687,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
) -> None:
self.print(f"{{ // {node}")
with self.indent():
+ self._check_for_errors()
# Prepare variable declarations for the alternative
vars = self.collect_vars(node)
for v, var_type in sorted(item for item in vars.items() if item[0] is not None):