From 800a35c623bbcdb5793c7d7a4974524286311479 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Mon, 25 May 2020 18:38:45 +0100 Subject: [PATCH] bpo-40750: Support -d flag in the new parser (GH-20340) --- .../2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst | 1 + Parser/pegen/parse.c | 4399 ++++++++++++++++- Parser/pegen/pegen.c | 1 + Parser/pegen/pegen.h | 1 + Tools/peg_generator/pegen/c_generator.py | 84 +- Tools/peg_generator/pegen/testutil.py | 2 +- 6 files changed, 4440 insertions(+), 48 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst new file mode 100644 index 00000000000..4032b801690 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst @@ -0,0 +1 @@ +Support the "-d" debug flag in the new PEG parser. Patch by Pablo Galindo diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c index 5dff77abc9f..2b735472ad6 100644 --- a/Parser/pegen/parse.c +++ b/Parser/pegen/parse.c @@ -1,5 +1,12 @@ // @generated by pegen.py from ./Grammar/python.gram #include "pegen.h" + +#ifdef Py_DEBUG +extern int Py_DebugFlag; +#define D(x) if (Py_DebugFlag) x; +#else +#define D(x) +#endif static const int n_keyword_lists = 15; static KeywordToken *reserved_keywords[] = { NULL, @@ -683,15 +690,19 @@ static void *_tmp_148_rule(Parser *p); static mod_ty file_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } mod_ty _res = NULL; int _mark = p->mark; { // statements? $ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> file[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statements? $")); void *a; Token * endmarker_var; if ( @@ -700,17 +711,22 @@ file_rule(Parser *p) (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER' ) { + D(fprintf(stderr, "%*c+ file[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statements? $")); _res = _PyPegen_make_module ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s file[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statements? $")); } _res = NULL; done: + D(p->level--); return _res; } @@ -718,31 +734,40 @@ file_rule(Parser *p) static mod_ty interactive_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } mod_ty _res = NULL; int _mark = p->mark; { // statement_newline if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> interactive[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement_newline")); asdl_seq* a; if ( (a = statement_newline_rule(p)) // statement_newline ) { + D(fprintf(stderr, "%*c+ interactive[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement_newline")); _res = Interactive ( a , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s interactive[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement_newline")); } _res = NULL; done: + D(p->level--); return _res; } @@ -750,15 +775,19 @@ interactive_rule(Parser *p) static mod_ty eval_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } mod_ty _res = NULL; int _mark = p->mark; { // expressions NEWLINE* $ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> eval[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions NEWLINE* $")); asdl_seq * _loop0_1_var; expr_ty a; Token * endmarker_var; @@ -770,17 +799,22 @@ eval_rule(Parser *p) (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER' ) { + D(fprintf(stderr, "%*c+ eval[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions NEWLINE* $")); _res = Expression ( a , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s eval[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expressions NEWLINE* $")); } _res = NULL; done: + D(p->level--); return _res; } @@ -788,15 +822,19 @@ eval_rule(Parser *p) static mod_ty func_type_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } mod_ty _res = NULL; int _mark = p->mark; { // '(' type_expressions? ')' '->' expression NEWLINE* $ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> func_type[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $")); Token * _literal; Token * _literal_1; Token * _literal_2; @@ -820,17 +858,22 @@ func_type_rule(Parser *p) (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER' ) { + D(fprintf(stderr, "%*c+ func_type[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $")); _res = FunctionType ( a , b , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s func_type[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $")); } _res = NULL; done: + D(p->level--); return _res; } @@ -838,27 +881,35 @@ func_type_rule(Parser *p) static expr_ty fstring_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; { // star_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> fstring[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { + D(fprintf(stderr, "%*c+ fstring[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); _res = star_expressions_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s fstring[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } _res = NULL; done: + D(p->level--); return _res; } @@ -873,15 +924,19 @@ fstring_rule(Parser *p) static asdl_seq* type_expressions_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.expression+ ',' '*' expression ',' '**' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression")); Token * _literal; Token * _literal_1; Token * _literal_2; @@ -905,19 +960,25 @@ type_expressions_rule(Parser *p) (c = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression")); _res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_seq_append_to_end ( p , a , b ) ) , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '*' expression ',' '**' expression")); } { // ','.expression+ ',' '*' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression")); Token * _literal; Token * _literal_1; asdl_seq * a; @@ -932,19 +993,25 @@ type_expressions_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '*' expression")); _res = _PyPegen_seq_append_to_end ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '*' expression")); } { // ','.expression+ ',' '**' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '**' expression")); Token * _literal; Token * _literal_1; asdl_seq * a; @@ -959,19 +1026,25 @@ type_expressions_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+ ',' '**' expression")); _res = _PyPegen_seq_append_to_end ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+ ',' '**' expression")); } { // '*' expression ',' '**' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression ',' '**' expression")); Token * _literal; Token * _literal_1; Token * _literal_2; @@ -989,19 +1062,25 @@ type_expressions_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression ',' '**' expression")); _res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_singleton_seq ( p , a ) ) , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression ',' '**' expression")); } { // '*' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression")); Token * _literal; expr_ty a; if ( @@ -1010,19 +1089,25 @@ type_expressions_rule(Parser *p) (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression")); _res = _PyPegen_singleton_seq ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression")); } { // '**' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' expression")); Token * _literal; expr_ty a; if ( @@ -1031,31 +1116,41 @@ type_expressions_rule(Parser *p) (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' expression")); _res = _PyPegen_singleton_seq ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' expression")); } { // ','.expression+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> type_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.expression+")); asdl_seq * _gather_9_var; if ( (_gather_9_var = _gather_9_rule(p)) // ','.expression+ ) { + D(fprintf(stderr, "%*c+ type_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.expression+")); _res = _gather_9_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s type_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.expression+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -1063,31 +1158,40 @@ type_expressions_rule(Parser *p) static asdl_seq* statements_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // statement+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> statements[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement+")); asdl_seq * a; if ( (a = _loop1_11_rule(p)) // statement+ ) { + D(fprintf(stderr, "%*c+ statements[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement+")); _res = _PyPegen_seq_flatten ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s statements[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -1095,45 +1199,59 @@ statements_rule(Parser *p) static asdl_seq* statement_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // compound_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> statement[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compound_stmt")); stmt_ty a; if ( (a = compound_stmt_rule(p)) // compound_stmt ) { + D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt")); _res = _PyPegen_singleton_seq ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s statement[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compound_stmt")); } { // simple_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> statement[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt")); asdl_seq* simple_stmt_var; if ( (simple_stmt_var = simple_stmt_rule(p)) // simple_stmt ) { + D(fprintf(stderr, "%*c+ statement[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt")); _res = simple_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s statement[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt")); } _res = NULL; done: + D(p->level--); return _res; } @@ -1141,13 +1259,16 @@ statement_rule(Parser *p) static asdl_seq* statement_newline_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -1156,8 +1277,10 @@ statement_newline_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // compound_stmt NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compound_stmt NEWLINE")); stmt_ty a; Token * newline_var; if ( @@ -1166,40 +1289,53 @@ statement_newline_rule(Parser *p) (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) { + D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "compound_stmt NEWLINE")); _res = _PyPegen_singleton_seq ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compound_stmt NEWLINE")); } { // simple_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt")); asdl_seq* simple_stmt_var; if ( (simple_stmt_var = simple_stmt_rule(p)) // simple_stmt ) { + D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt")); _res = simple_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt")); } { // NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE")); Token * newline_var; if ( (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) { + D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1209,32 +1345,42 @@ statement_newline_rule(Parser *p) _res = _PyPegen_singleton_seq ( p , CHECK ( _Py_Pass ( EXTRA ) ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE")); } { // $ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> statement_newline[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "$")); Token * endmarker_var; if ( (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) // token='ENDMARKER' ) { + D(fprintf(stderr, "%*c+ statement_newline[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "$")); _res = _PyPegen_interactive_exit ( p ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s statement_newline[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "$")); } _res = NULL; done: + D(p->level--); return _res; } @@ -1242,15 +1388,19 @@ statement_newline_rule(Parser *p) static asdl_seq* simple_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // small_stmt !';' NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "small_stmt !';' NEWLINE")); stmt_ty a; Token * newline_var; if ( @@ -1261,19 +1411,25 @@ simple_stmt_rule(Parser *p) (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) { + D(fprintf(stderr, "%*c+ simple_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "small_stmt !';' NEWLINE")); _res = _PyPegen_singleton_seq ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s simple_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "small_stmt !';' NEWLINE")); } { // ';'.small_stmt+ ';'? NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> simple_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -1286,17 +1442,22 @@ simple_stmt_rule(Parser *p) (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) { + D(fprintf(stderr, "%*c+ simple_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s simple_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';'.small_stmt+ ';'? NEWLINE")); } _res = NULL; done: + D(p->level--); return _res; } @@ -1317,15 +1478,20 @@ simple_stmt_rule(Parser *p) static stmt_ty small_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; - if (_PyPegen_is_memoized(p, small_stmt_type, &_res)) + if (_PyPegen_is_memoized(p, small_stmt_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -1334,29 +1500,38 @@ small_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // assignment if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "assignment")); stmt_ty assignment_var; if ( (assignment_var = assignment_rule(p)) // assignment ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "assignment")); _res = assignment_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "assignment")); } { // star_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty e; if ( (e = star_expressions_rule(p)) // star_expressions ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1366,16 +1541,21 @@ small_stmt_rule(Parser *p) _res = _Py_Expr ( e , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } { // &'return' return_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'return' return_stmt")); stmt_ty return_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 500) // token='return' @@ -1383,15 +1563,20 @@ small_stmt_rule(Parser *p) (return_stmt_var = return_stmt_rule(p)) // return_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'return' return_stmt")); _res = return_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'return' return_stmt")); } { // &('import' | 'from') import_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('import' | 'from') import_stmt")); stmt_ty import_stmt_var; if ( _PyPegen_lookahead(1, _tmp_14_rule, p) @@ -1399,15 +1584,20 @@ small_stmt_rule(Parser *p) (import_stmt_var = import_stmt_rule(p)) // import_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('import' | 'from') import_stmt")); _res = import_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('import' | 'from') import_stmt")); } { // &'raise' raise_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'raise' raise_stmt")); stmt_ty raise_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 501) // token='raise' @@ -1415,22 +1605,29 @@ small_stmt_rule(Parser *p) (raise_stmt_var = raise_stmt_rule(p)) // raise_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'raise' raise_stmt")); _res = raise_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'raise' raise_stmt")); } { // 'pass' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'pass'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 502)) // token='pass' ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'pass'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1440,16 +1637,21 @@ small_stmt_rule(Parser *p) _res = _Py_Pass ( EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'pass'")); } { // &'del' del_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'del' del_stmt")); stmt_ty del_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 503) // token='del' @@ -1457,15 +1659,20 @@ small_stmt_rule(Parser *p) (del_stmt_var = del_stmt_rule(p)) // del_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'del' del_stmt")); _res = del_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'del' del_stmt")); } { // &'yield' yield_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'yield' yield_stmt")); stmt_ty yield_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 504) // token='yield' @@ -1473,15 +1680,20 @@ small_stmt_rule(Parser *p) (yield_stmt_var = yield_stmt_rule(p)) // yield_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'yield' yield_stmt")); _res = yield_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'yield' yield_stmt")); } { // &'assert' assert_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'assert' assert_stmt")); stmt_ty assert_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 505) // token='assert' @@ -1489,22 +1701,29 @@ small_stmt_rule(Parser *p) (assert_stmt_var = assert_stmt_rule(p)) // assert_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'assert' assert_stmt")); _res = assert_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'assert' assert_stmt")); } { // 'break' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'break'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 506)) // token='break' ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'break'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1514,23 +1733,30 @@ small_stmt_rule(Parser *p) _res = _Py_Break ( EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'break'")); } { // 'continue' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'continue'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 507)) // token='continue' ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'continue'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1540,16 +1766,21 @@ small_stmt_rule(Parser *p) _res = _Py_Continue ( EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'continue'")); } { // &'global' global_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'global' global_stmt")); stmt_ty global_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 508) // token='global' @@ -1557,15 +1788,20 @@ small_stmt_rule(Parser *p) (global_stmt_var = global_stmt_rule(p)) // global_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'global' global_stmt")); _res = global_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'global' global_stmt")); } { // &'nonlocal' nonlocal_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> small_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'nonlocal' nonlocal_stmt")); stmt_ty nonlocal_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 509) // token='nonlocal' @@ -1573,14 +1809,18 @@ small_stmt_rule(Parser *p) (nonlocal_stmt_var = nonlocal_stmt_rule(p)) // nonlocal_stmt ) { + D(fprintf(stderr, "%*c+ small_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'nonlocal' nonlocal_stmt")); _res = nonlocal_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s small_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'nonlocal' nonlocal_stmt")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, small_stmt_type, _res); + D(p->level--); return _res; } @@ -1595,15 +1835,19 @@ small_stmt_rule(Parser *p) static stmt_ty compound_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; { // &('def' | '@' | ASYNC) function_def if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('def' | '@' | ASYNC) function_def")); stmt_ty function_def_var; if ( _PyPegen_lookahead(1, _tmp_15_rule, p) @@ -1611,15 +1855,20 @@ compound_stmt_rule(Parser *p) (function_def_var = function_def_rule(p)) // function_def ) { + D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('def' | '@' | ASYNC) function_def")); _res = function_def_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('def' | '@' | ASYNC) function_def")); } { // &'if' if_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'if' if_stmt")); stmt_ty if_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 510) // token='if' @@ -1627,15 +1876,20 @@ compound_stmt_rule(Parser *p) (if_stmt_var = if_stmt_rule(p)) // if_stmt ) { + D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'if' if_stmt")); _res = if_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'if' if_stmt")); } { // &('class' | '@') class_def if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('class' | '@') class_def")); stmt_ty class_def_var; if ( _PyPegen_lookahead(1, _tmp_16_rule, p) @@ -1643,15 +1897,20 @@ compound_stmt_rule(Parser *p) (class_def_var = class_def_rule(p)) // class_def ) { + D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('class' | '@') class_def")); _res = class_def_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('class' | '@') class_def")); } { // &('with' | ASYNC) with_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('with' | ASYNC) with_stmt")); stmt_ty with_stmt_var; if ( _PyPegen_lookahead(1, _tmp_17_rule, p) @@ -1659,15 +1918,20 @@ compound_stmt_rule(Parser *p) (with_stmt_var = with_stmt_rule(p)) // with_stmt ) { + D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('with' | ASYNC) with_stmt")); _res = with_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('with' | ASYNC) with_stmt")); } { // &('for' | ASYNC) for_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&('for' | ASYNC) for_stmt")); stmt_ty for_stmt_var; if ( _PyPegen_lookahead(1, _tmp_18_rule, p) @@ -1675,15 +1939,20 @@ compound_stmt_rule(Parser *p) (for_stmt_var = for_stmt_rule(p)) // for_stmt ) { + D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&('for' | ASYNC) for_stmt")); _res = for_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&('for' | ASYNC) for_stmt")); } { // &'try' try_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'try' try_stmt")); stmt_ty try_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 511) // token='try' @@ -1691,15 +1960,20 @@ compound_stmt_rule(Parser *p) (try_stmt_var = try_stmt_rule(p)) // try_stmt ) { + D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'try' try_stmt")); _res = try_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'try' try_stmt")); } { // &'while' while_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compound_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'while' while_stmt")); stmt_ty while_stmt_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 512) // token='while' @@ -1707,13 +1981,17 @@ compound_stmt_rule(Parser *p) (while_stmt_var = while_stmt_rule(p)) // while_stmt ) { + D(fprintf(stderr, "%*c+ compound_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'while' while_stmt")); _res = while_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compound_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'while' while_stmt")); } _res = NULL; done: + D(p->level--); return _res; } @@ -1726,13 +2004,16 @@ compound_stmt_rule(Parser *p) static stmt_ty assignment_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -1741,8 +2022,10 @@ assignment_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME ':' expression ['=' annotated_rhs] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]")); Token * _literal; expr_ty a; expr_ty b; @@ -1757,8 +2040,10 @@ assignment_rule(Parser *p) (c = _tmp_19_rule(p), 1) // ['=' annotated_rhs] ) { + D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1768,16 +2053,21 @@ assignment_rule(Parser *p) _res = CHECK_VERSION ( 6 , "Variable annotation syntax is" , _Py_AnnAssign ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ':' expression ['=' annotated_rhs]")); } { // ('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]")); Token * _literal; void *a; expr_ty b; @@ -1792,8 +2082,10 @@ assignment_rule(Parser *p) (c = _tmp_21_rule(p), 1) // ['=' annotated_rhs] ) { + D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1803,16 +2095,21 @@ assignment_rule(Parser *p) _res = CHECK_VERSION ( 6 , "Variable annotations syntax is" , _Py_AnnAssign ( a , b , c , 0 , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('(' single_target ')' | single_subscript_attribute_target) ':' expression ['=' annotated_rhs]")); } { // ((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT?")); asdl_seq * a; void *b; void *tc; @@ -1824,8 +2121,10 @@ assignment_rule(Parser *p) (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) // TYPE_COMMENT? ) { + D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1835,16 +2134,21 @@ assignment_rule(Parser *p) _res = _Py_Assign ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT?")); } { // single_target augassign (yield_expr | star_expressions) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "single_target augassign (yield_expr | star_expressions)")); expr_ty a; AugOperator* b; void *c; @@ -1856,8 +2160,10 @@ assignment_rule(Parser *p) (c = _tmp_24_rule(p)) // yield_expr | star_expressions ) { + D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "single_target augassign (yield_expr | star_expressions)")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -1867,28 +2173,37 @@ assignment_rule(Parser *p) _res = _Py_AugAssign ( a , b -> kind , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "single_target augassign (yield_expr | star_expressions)")); } { // invalid_assignment if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_assignment")); void *invalid_assignment_var; if ( (invalid_assignment_var = invalid_assignment_rule(p)) // invalid_assignment ) { + D(fprintf(stderr, "%*c+ assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_assignment")); _res = invalid_assignment_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_assignment")); } _res = NULL; done: + D(p->level--); return _res; } @@ -1909,247 +2224,328 @@ assignment_rule(Parser *p) static AugOperator* augassign_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } AugOperator* _res = NULL; int _mark = p->mark; { // '+=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'+='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 36)) // token='+=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'+='")); _res = _PyPegen_augoperator ( p , Add ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'+='")); } { // '-=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'-='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 37)) // token='-=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'-='")); _res = _PyPegen_augoperator ( p , Sub ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'-='")); } { // '*=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 38)) // token='*=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*='")); _res = _PyPegen_augoperator ( p , Mult ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*='")); } { // '@=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 50)) // token='@=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@='")); _res = CHECK_VERSION ( 5 , "The '@' operator is" , _PyPegen_augoperator ( p , MatMult ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@='")); } { // '/=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'/='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 39)) // token='/=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'/='")); _res = _PyPegen_augoperator ( p , Div ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'/='")); } { // '%=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'%='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 40)) // token='%=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'%='")); _res = _PyPegen_augoperator ( p , Mod ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'%='")); } { // '&=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'&='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 41)) // token='&=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'&='")); _res = _PyPegen_augoperator ( p , BitAnd ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'&='")); } { // '|=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'|='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 42)) // token='|=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'|='")); _res = _PyPegen_augoperator ( p , BitOr ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'|='")); } { // '^=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'^='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 43)) // token='^=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'^='")); _res = _PyPegen_augoperator ( p , BitXor ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'^='")); } { // '<<=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'<<='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 44)) // token='<<=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'<<='")); _res = _PyPegen_augoperator ( p , LShift ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'<<='")); } { // '>>=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'>>='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 45)) // token='>>=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'>>='")); _res = _PyPegen_augoperator ( p , RShift ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'>>='")); } { // '**=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 46)) // token='**=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**='")); _res = _PyPegen_augoperator ( p , Pow ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**='")); } { // '//=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> augassign[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'//='")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 48)) // token='//=' ) { + D(fprintf(stderr, "%*c+ augassign[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'//='")); _res = _PyPegen_augoperator ( p , FloorDiv ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s augassign[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'//='")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2157,13 +2553,16 @@ augassign_rule(Parser *p) static stmt_ty global_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2172,8 +2571,10 @@ global_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'global' ','.NAME+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> global_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'global' ','.NAME+")); Token * _keyword; asdl_seq * a; if ( @@ -2182,8 +2583,10 @@ global_stmt_rule(Parser *p) (a = _gather_25_rule(p)) // ','.NAME+ ) { + D(fprintf(stderr, "%*c+ global_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'global' ','.NAME+")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2193,14 +2596,18 @@ global_stmt_rule(Parser *p) _res = _Py_Global ( CHECK ( _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s global_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'global' ','.NAME+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2208,13 +2615,16 @@ global_stmt_rule(Parser *p) static stmt_ty nonlocal_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2223,8 +2633,10 @@ nonlocal_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'nonlocal' ','.NAME+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> nonlocal_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'nonlocal' ','.NAME+")); Token * _keyword; asdl_seq * a; if ( @@ -2233,8 +2645,10 @@ nonlocal_stmt_rule(Parser *p) (a = _gather_27_rule(p)) // ','.NAME+ ) { + D(fprintf(stderr, "%*c+ nonlocal_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'nonlocal' ','.NAME+")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2244,14 +2658,18 @@ nonlocal_stmt_rule(Parser *p) _res = _Py_Nonlocal ( CHECK ( _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s nonlocal_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'nonlocal' ','.NAME+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2259,13 +2677,16 @@ nonlocal_stmt_rule(Parser *p) static stmt_ty yield_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2274,15 +2695,19 @@ yield_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // yield_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> yield_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty y; if ( (y = yield_expr_rule(p)) // yield_expr ) { + D(fprintf(stderr, "%*c+ yield_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2292,14 +2717,18 @@ yield_stmt_rule(Parser *p) _res = _Py_Expr ( y , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s yield_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2307,13 +2736,16 @@ yield_stmt_rule(Parser *p) static stmt_ty assert_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2322,8 +2754,10 @@ assert_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'assert' expression [',' expression] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> assert_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'assert' expression [',' expression]")); Token * _keyword; expr_ty a; void *b; @@ -2335,8 +2769,10 @@ assert_stmt_rule(Parser *p) (b = _tmp_29_rule(p), 1) // [',' expression] ) { + D(fprintf(stderr, "%*c+ assert_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'assert' expression [',' expression]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2346,14 +2782,18 @@ assert_stmt_rule(Parser *p) _res = _Py_Assert ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s assert_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'assert' expression [',' expression]")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2361,13 +2801,16 @@ assert_stmt_rule(Parser *p) static stmt_ty del_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2376,8 +2819,10 @@ del_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'del' del_targets if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'del' del_targets")); Token * _keyword; asdl_seq* a; if ( @@ -2386,8 +2831,10 @@ del_stmt_rule(Parser *p) (a = del_targets_rule(p)) // del_targets ) { + D(fprintf(stderr, "%*c+ del_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'del' del_targets")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2397,14 +2844,18 @@ del_stmt_rule(Parser *p) _res = _Py_Delete ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'del' del_targets")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2412,41 +2863,54 @@ del_stmt_rule(Parser *p) static stmt_ty import_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; { // import_name if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_name")); stmt_ty import_name_var; if ( (import_name_var = import_name_rule(p)) // import_name ) { + D(fprintf(stderr, "%*c+ import_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_name")); _res = import_name_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_name")); } { // import_from if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from")); stmt_ty import_from_var; if ( (import_from_var = import_from_rule(p)) // import_from ) { + D(fprintf(stderr, "%*c+ import_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from")); _res = import_from_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2454,13 +2918,16 @@ import_stmt_rule(Parser *p) static stmt_ty import_name_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2469,8 +2936,10 @@ import_name_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'import' dotted_as_names if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'import' dotted_as_names")); Token * _keyword; asdl_seq* a; if ( @@ -2479,8 +2948,10 @@ import_name_rule(Parser *p) (a = dotted_as_names_rule(p)) // dotted_as_names ) { + D(fprintf(stderr, "%*c+ import_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'import' dotted_as_names")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2490,14 +2961,18 @@ import_name_rule(Parser *p) _res = _Py_Import ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_name[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'import' dotted_as_names")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2507,13 +2982,16 @@ import_name_rule(Parser *p) static stmt_ty import_from_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2522,8 +3000,10 @@ import_from_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'from' (('.' | '...'))* dotted_name 'import' import_from_targets if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); Token * _keyword; Token * _keyword_1; asdl_seq * a; @@ -2541,8 +3021,10 @@ import_from_rule(Parser *p) (c = import_from_targets_rule(p)) // import_from_targets ) { + D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2552,16 +3034,21 @@ import_from_rule(Parser *p) _res = _Py_ImportFrom ( b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' (('.' | '...'))* dotted_name 'import' import_from_targets")); } { // 'from' (('.' | '...'))+ 'import' import_from_targets if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets")); Token * _keyword; Token * _keyword_1; asdl_seq * a; @@ -2576,8 +3063,10 @@ import_from_rule(Parser *p) (b = import_from_targets_rule(p)) // import_from_targets ) { + D(fprintf(stderr, "%*c+ import_from[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2587,14 +3076,18 @@ import_from_rule(Parser *p) _res = _Py_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' (('.' | '...'))+ 'import' import_from_targets")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2606,15 +3099,19 @@ import_from_rule(Parser *p) static asdl_seq* import_from_targets_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // '(' import_from_as_names ','? ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' import_from_as_names ','? ')'")); Token * _literal; Token * _literal_1; void *_opt_var; @@ -2630,19 +3127,25 @@ import_from_targets_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' import_from_as_names ','? ')'")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' import_from_as_names ','? ')'")); } { // import_from_as_names !',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_names !','")); asdl_seq* import_from_as_names_var; if ( (import_from_as_names_var = import_from_as_names_rule(p)) // import_from_as_names @@ -2650,45 +3153,60 @@ import_from_targets_rule(Parser *p) _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12) // token=',' ) { + D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from_as_names !','")); _res = import_from_as_names_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from_as_names !','")); } { // '*' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 16)) // token='*' ) { + D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'")); _res = _PyPegen_singleton_seq ( p , CHECK ( _PyPegen_alias_for_star ( p ) ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*'")); } { // invalid_import_from_targets if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_import_from_targets")); void *invalid_import_from_targets_var; if ( (invalid_import_from_targets_var = invalid_import_from_targets_rule(p)) // invalid_import_from_targets ) { + D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_import_from_targets")); _res = invalid_import_from_targets_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_import_from_targets")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2696,31 +3214,40 @@ import_from_targets_rule(Parser *p) static asdl_seq* import_from_as_names_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.import_from_as_name+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from_as_names[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.import_from_as_name+")); asdl_seq * a; if ( (a = _gather_32_rule(p)) // ','.import_from_as_name+ ) { + D(fprintf(stderr, "%*c+ import_from_as_names[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.import_from_as_name+")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from_as_names[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.import_from_as_name+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2728,15 +3255,19 @@ import_from_as_names_rule(Parser *p) static alias_ty import_from_as_name_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } alias_ty _res = NULL; int _mark = p->mark; { // NAME ['as' NAME] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> import_from_as_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ['as' NAME]")); expr_ty a; void *b; if ( @@ -2745,17 +3276,22 @@ import_from_as_name_rule(Parser *p) (b = _tmp_34_rule(p), 1) // ['as' NAME] ) { + D(fprintf(stderr, "%*c+ import_from_as_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ['as' NAME]")); _res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s import_from_as_name[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ['as' NAME]")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2763,31 +3299,40 @@ import_from_as_name_rule(Parser *p) static asdl_seq* dotted_as_names_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.dotted_as_name+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> dotted_as_names[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.dotted_as_name+")); asdl_seq * a; if ( (a = _gather_35_rule(p)) // ','.dotted_as_name+ ) { + D(fprintf(stderr, "%*c+ dotted_as_names[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.dotted_as_name+")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s dotted_as_names[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.dotted_as_name+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2795,15 +3340,19 @@ dotted_as_names_rule(Parser *p) static alias_ty dotted_as_name_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } alias_ty _res = NULL; int _mark = p->mark; { // dotted_name ['as' NAME] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> dotted_as_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dotted_name ['as' NAME]")); expr_ty a; void *b; if ( @@ -2812,17 +3361,22 @@ dotted_as_name_rule(Parser *p) (b = _tmp_37_rule(p), 1) // ['as' NAME] ) { + D(fprintf(stderr, "%*c+ dotted_as_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dotted_name ['as' NAME]")); _res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s dotted_as_name[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dotted_name ['as' NAME]")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2832,14 +3386,18 @@ static expr_ty dotted_name_raw(Parser *); static expr_ty dotted_name_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, dotted_name_type, &_res)) + if (_PyPegen_is_memoized(p, dotted_name_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_0 = _PyPegen_update_memo(p, _mark, dotted_name_type, _res); if (tmpvar_0) { + D(p->level--); return _res; } p->mark = _mark; @@ -2850,20 +3408,25 @@ dotted_name_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty dotted_name_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; { // dotted_name '.' NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> dotted_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dotted_name '.' NAME")); Token * _literal; expr_ty a; expr_ty b; @@ -2875,31 +3438,41 @@ dotted_name_raw(Parser *p) (b = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ dotted_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dotted_name '.' NAME")); _res = _PyPegen_join_names_with_dot ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s dotted_name[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dotted_name '.' NAME")); } { // NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> dotted_name[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME")); expr_ty name_var; if ( (name_var = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ dotted_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME")); _res = name_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s dotted_name[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME")); } _res = NULL; done: + D(p->level--); return _res; } @@ -2909,13 +3482,16 @@ dotted_name_raw(Parser *p) static stmt_ty if_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -2924,8 +3500,10 @@ if_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'if' named_expression ':' block elif_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block elif_stmt")); Token * _keyword; Token * _literal; expr_ty a; @@ -2943,8 +3521,10 @@ if_stmt_rule(Parser *p) (c = elif_stmt_rule(p)) // elif_stmt ) { + D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block elif_stmt")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2954,16 +3534,21 @@ if_stmt_rule(Parser *p) _res = _Py_If ( a , b , CHECK ( _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s if_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression ':' block elif_stmt")); } { // 'if' named_expression ':' block else_block? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block else_block?")); Token * _keyword; Token * _literal; expr_ty a; @@ -2981,8 +3566,10 @@ if_stmt_rule(Parser *p) (c = else_block_rule(p), 1) // else_block? ) { + D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block else_block?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -2992,14 +3579,18 @@ if_stmt_rule(Parser *p) _res = _Py_If ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s if_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression ':' block else_block?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3009,13 +3600,16 @@ if_stmt_rule(Parser *p) static stmt_ty elif_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3024,8 +3618,10 @@ elif_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'elif' named_expression ':' block elif_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block elif_stmt")); Token * _keyword; Token * _literal; expr_ty a; @@ -3043,8 +3639,10 @@ elif_stmt_rule(Parser *p) (c = elif_stmt_rule(p)) // elif_stmt ) { + D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block elif_stmt")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3054,16 +3652,21 @@ elif_stmt_rule(Parser *p) _res = _Py_If ( a , b , CHECK ( _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s elif_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression ':' block elif_stmt")); } { // 'elif' named_expression ':' block else_block? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block else_block?")); Token * _keyword; Token * _literal; expr_ty a; @@ -3081,8 +3684,10 @@ elif_stmt_rule(Parser *p) (c = else_block_rule(p), 1) // else_block? ) { + D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block else_block?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3092,14 +3697,18 @@ elif_stmt_rule(Parser *p) _res = _Py_If ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s elif_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression ':' block else_block?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3107,15 +3716,19 @@ elif_stmt_rule(Parser *p) static asdl_seq* else_block_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // 'else' ':' block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> else_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'else' ':' block")); Token * _keyword; Token * _literal; asdl_seq* b; @@ -3127,17 +3740,22 @@ else_block_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ else_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else' ':' block")); _res = b; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s else_block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'else' ':' block")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3145,13 +3763,16 @@ else_block_rule(Parser *p) static stmt_ty while_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3160,8 +3781,10 @@ while_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'while' named_expression ':' block else_block? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> while_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'while' named_expression ':' block else_block?")); Token * _keyword; Token * _literal; expr_ty a; @@ -3179,8 +3802,10 @@ while_stmt_rule(Parser *p) (c = else_block_rule(p), 1) // else_block? ) { + D(fprintf(stderr, "%*c+ while_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'while' named_expression ':' block else_block?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3190,14 +3815,18 @@ while_stmt_rule(Parser *p) _res = _Py_While ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s while_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'while' named_expression ':' block else_block?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3207,13 +3836,16 @@ while_stmt_rule(Parser *p) static stmt_ty for_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3222,8 +3854,10 @@ for_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> for_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?")); Token * _keyword; Token * _keyword_1; Token * _literal; @@ -3250,8 +3884,10 @@ for_stmt_rule(Parser *p) (el = else_block_rule(p), 1) // else_block? ) { + D(fprintf(stderr, "%*c+ for_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3261,16 +3897,21 @@ for_stmt_rule(Parser *p) _res = _Py_For ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s for_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?")); } { // ASYNC 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> for_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?")); Token * _keyword; Token * _keyword_1; Token * _literal; @@ -3300,8 +3941,10 @@ for_stmt_rule(Parser *p) (el = else_block_rule(p), 1) // else_block? ) { + D(fprintf(stderr, "%*c+ for_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3311,14 +3954,18 @@ for_stmt_rule(Parser *p) _res = CHECK_VERSION ( 5 , "Async for loops are" , _Py_AsyncFor ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s for_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3330,13 +3977,16 @@ for_stmt_rule(Parser *p) static stmt_ty with_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3345,8 +3995,10 @@ with_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'with' '(' ','.with_item+ ','? ')' ':' block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with' '(' ','.with_item+ ','? ')' ':' block")); Token * _keyword; Token * _literal; Token * _literal_1; @@ -3371,8 +4023,10 @@ with_stmt_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with' '(' ','.with_item+ ','? ')' ':' block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3382,16 +4036,21 @@ with_stmt_rule(Parser *p) _res = _Py_With ( a , b , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'with' '(' ','.with_item+ ','? ')' ':' block")); } { // 'with' ','.with_item+ ':' TYPE_COMMENT? block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with' ','.with_item+ ':' TYPE_COMMENT? block")); Token * _keyword; Token * _literal; asdl_seq * a; @@ -3409,8 +4068,10 @@ with_stmt_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with' ','.with_item+ ':' TYPE_COMMENT? block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3420,16 +4081,21 @@ with_stmt_rule(Parser *p) _res = _Py_With ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'with' ','.with_item+ ':' TYPE_COMMENT? block")); } { // ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block")); Token * _keyword; Token * _literal; Token * _literal_1; @@ -3457,8 +4123,10 @@ with_stmt_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3468,16 +4136,21 @@ with_stmt_rule(Parser *p) _res = CHECK_VERSION ( 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NULL , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'with' '(' ','.with_item+ ','? ')' ':' block")); } { // ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block")); Token * _keyword; Token * _literal; asdl_seq * a; @@ -3498,8 +4171,10 @@ with_stmt_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3509,14 +4184,18 @@ with_stmt_rule(Parser *p) _res = CHECK_VERSION ( 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s with_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3524,15 +4203,19 @@ with_stmt_rule(Parser *p) static withitem_ty with_item_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } withitem_ty _res = NULL; int _mark = p->mark; { // expression ['as' target] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> with_item[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' target]")); expr_ty e; void *o; if ( @@ -3541,17 +4224,22 @@ with_item_rule(Parser *p) (o = _tmp_46_rule(p), 1) // ['as' target] ) { + D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' target]")); _res = _Py_withitem ( e , o , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s with_item[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ['as' target]")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3561,13 +4249,16 @@ with_item_rule(Parser *p) static stmt_ty try_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3576,8 +4267,10 @@ try_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'try' ':' block finally_block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> try_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'try' ':' block finally_block")); Token * _keyword; Token * _literal; asdl_seq* b; @@ -3592,8 +4285,10 @@ try_stmt_rule(Parser *p) (f = finally_block_rule(p)) // finally_block ) { + D(fprintf(stderr, "%*c+ try_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'try' ':' block finally_block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3603,16 +4298,21 @@ try_stmt_rule(Parser *p) _res = _Py_Try ( b , NULL , NULL , f , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s try_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'try' ':' block finally_block")); } { // 'try' ':' block except_block+ else_block? finally_block? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> try_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'try' ':' block except_block+ else_block? finally_block?")); Token * _keyword; Token * _literal; asdl_seq* b; @@ -3633,8 +4333,10 @@ try_stmt_rule(Parser *p) (f = finally_block_rule(p), 1) // finally_block? ) { + D(fprintf(stderr, "%*c+ try_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'try' ':' block except_block+ else_block? finally_block?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3644,14 +4346,18 @@ try_stmt_rule(Parser *p) _res = _Py_Try ( b , ex , el , f , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s try_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'try' ':' block except_block+ else_block? finally_block?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3659,13 +4365,16 @@ try_stmt_rule(Parser *p) static excepthandler_ty except_block_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } excepthandler_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3674,8 +4383,10 @@ except_block_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'except' expression ['as' NAME] ':' block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> except_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except' expression ['as' NAME] ':' block")); Token * _keyword; Token * _literal; asdl_seq* b; @@ -3693,8 +4404,10 @@ except_block_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ except_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except' expression ['as' NAME] ':' block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3704,16 +4417,21 @@ except_block_rule(Parser *p) _res = _Py_ExceptHandler ( e , ( t ) ? ( ( expr_ty ) t ) -> v . Name . id : NULL , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s except_block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'except' expression ['as' NAME] ':' block")); } { // 'except' ':' block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> except_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except' ':' block")); Token * _keyword; Token * _literal; asdl_seq* b; @@ -3725,8 +4443,10 @@ except_block_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ except_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except' ':' block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3736,14 +4456,18 @@ except_block_rule(Parser *p) _res = _Py_ExceptHandler ( NULL , NULL , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s except_block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'except' ':' block")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3751,15 +4475,19 @@ except_block_rule(Parser *p) static asdl_seq* finally_block_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // 'finally' ':' block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> finally_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'finally' ':' block")); Token * _keyword; Token * _literal; asdl_seq* a; @@ -3771,17 +4499,22 @@ finally_block_rule(Parser *p) (a = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ finally_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'finally' ':' block")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s finally_block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'finally' ':' block")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3789,13 +4522,16 @@ finally_block_rule(Parser *p) static stmt_ty return_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3804,8 +4540,10 @@ return_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'return' star_expressions? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> return_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'return' star_expressions?")); Token * _keyword; void *a; if ( @@ -3814,8 +4552,10 @@ return_stmt_rule(Parser *p) (a = star_expressions_rule(p), 1) // star_expressions? ) { + D(fprintf(stderr, "%*c+ return_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'return' star_expressions?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3825,14 +4565,18 @@ return_stmt_rule(Parser *p) _res = _Py_Return ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s return_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'return' star_expressions?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3840,13 +4584,16 @@ return_stmt_rule(Parser *p) static stmt_ty raise_stmt_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3855,8 +4602,10 @@ raise_stmt_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'raise' expression ['from' expression] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> raise_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'raise' expression ['from' expression]")); Token * _keyword; expr_ty a; void *b; @@ -3868,8 +4617,10 @@ raise_stmt_rule(Parser *p) (b = _tmp_49_rule(p), 1) // ['from' expression] ) { + D(fprintf(stderr, "%*c+ raise_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'raise' expression ['from' expression]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3879,23 +4630,30 @@ raise_stmt_rule(Parser *p) _res = _Py_Raise ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s raise_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'raise' expression ['from' expression]")); } { // 'raise' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> raise_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'raise'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 501)) // token='raise' ) { + D(fprintf(stderr, "%*c+ raise_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'raise'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -3905,14 +4663,18 @@ raise_stmt_rule(Parser *p) _res = _Py_Raise ( NULL , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s raise_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'raise'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3920,15 +4682,19 @@ raise_stmt_rule(Parser *p) static stmt_ty function_def_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; { // decorators function_def_raw if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> function_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "decorators function_def_raw")); asdl_seq* d; stmt_ty f; if ( @@ -3937,31 +4703,41 @@ function_def_rule(Parser *p) (f = function_def_raw_rule(p)) // function_def_raw ) { + D(fprintf(stderr, "%*c+ function_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "decorators function_def_raw")); _res = _PyPegen_function_def_decorators ( p , d , f ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s function_def[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "decorators function_def_raw")); } { // function_def_raw if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> function_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "function_def_raw")); stmt_ty function_def_raw_var; if ( (function_def_raw_var = function_def_raw_rule(p)) // function_def_raw ) { + D(fprintf(stderr, "%*c+ function_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "function_def_raw")); _res = function_def_raw_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s function_def[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "function_def_raw")); } _res = NULL; done: + D(p->level--); return _res; } @@ -3971,13 +4747,16 @@ function_def_rule(Parser *p) static stmt_ty function_def_raw_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -3986,8 +4765,10 @@ function_def_raw_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> function_def_raw[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block")); Token * _keyword; Token * _literal; Token * _literal_1; @@ -4017,8 +4798,10 @@ function_def_raw_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ function_def_raw[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -4028,16 +4811,21 @@ function_def_raw_rule(Parser *p) _res = _Py_FunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s function_def_raw[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block")); } { // ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> function_def_raw[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block")); Token * _keyword; Token * _literal; Token * _literal_1; @@ -4070,8 +4858,10 @@ function_def_raw_rule(Parser *p) (b = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ function_def_raw[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -4081,14 +4871,18 @@ function_def_raw_rule(Parser *p) _res = CHECK_VERSION ( 5 , "Async functions are" , _Py_AsyncFunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s function_def_raw[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4099,15 +4893,19 @@ function_def_raw_rule(Parser *p) static Token* func_type_comment_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } Token* _res = NULL; int _mark = p->mark; { // NEWLINE TYPE_COMMENT &(NEWLINE INDENT) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> func_type_comment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE TYPE_COMMENT &(NEWLINE INDENT)")); Token * newline_var; Token * t; if ( @@ -4118,45 +4916,60 @@ func_type_comment_rule(Parser *p) _PyPegen_lookahead(1, _tmp_52_rule, p) ) { + D(fprintf(stderr, "%*c+ func_type_comment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE TYPE_COMMENT &(NEWLINE INDENT)")); _res = t; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s func_type_comment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE TYPE_COMMENT &(NEWLINE INDENT)")); } { // invalid_double_type_comments if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> func_type_comment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_double_type_comments")); void *invalid_double_type_comments_var; if ( (invalid_double_type_comments_var = invalid_double_type_comments_rule(p)) // invalid_double_type_comments ) { + D(fprintf(stderr, "%*c+ func_type_comment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_double_type_comments")); _res = invalid_double_type_comments_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s func_type_comment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_double_type_comments")); } { // TYPE_COMMENT if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> func_type_comment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT")); Token * type_comment_var; if ( (type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT)) // token='TYPE_COMMENT' ) { + D(fprintf(stderr, "%*c+ func_type_comment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT")); _res = type_comment_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s func_type_comment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "TYPE_COMMENT")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4164,41 +4977,54 @@ func_type_comment_rule(Parser *p) static arguments_ty params_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arguments_ty _res = NULL; int _mark = p->mark; { // invalid_parameters if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> params[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_parameters")); void *invalid_parameters_var; if ( (invalid_parameters_var = invalid_parameters_rule(p)) // invalid_parameters ) { + D(fprintf(stderr, "%*c+ params[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_parameters")); _res = invalid_parameters_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s params[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_parameters")); } { // parameters if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> params[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "parameters")); arguments_ty parameters_var; if ( (parameters_var = parameters_rule(p)) // parameters ) { + D(fprintf(stderr, "%*c+ params[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "parameters")); _res = parameters_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s params[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "parameters")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4211,15 +5037,19 @@ params_rule(Parser *p) static arguments_ty parameters_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arguments_ty _res = NULL; int _mark = p->mark; { // slash_no_default param_no_default* param_with_default* star_etc? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_no_default param_no_default* param_with_default* star_etc?")); asdl_seq* a; asdl_seq * b; asdl_seq * c; @@ -4234,19 +5064,25 @@ parameters_rule(Parser *p) (d = star_etc_rule(p), 1) // star_etc? ) { + D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_no_default param_no_default* param_with_default* star_etc?")); _res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_no_default param_no_default* param_with_default* star_etc?")); } { // slash_with_default param_with_default* star_etc? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default param_with_default* star_etc?")); SlashWithDefault* a; asdl_seq * b; void *c; @@ -4258,19 +5094,25 @@ parameters_rule(Parser *p) (c = star_etc_rule(p), 1) // star_etc? ) { + D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default param_with_default* star_etc?")); _res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_with_default param_with_default* star_etc?")); } { // param_no_default+ param_with_default* star_etc? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ param_with_default* star_etc?")); asdl_seq * a; asdl_seq * b; void *c; @@ -4282,19 +5124,25 @@ parameters_rule(Parser *p) (c = star_etc_rule(p), 1) // star_etc? ) { + D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default+ param_with_default* star_etc?")); _res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default+ param_with_default* star_etc?")); } { // param_with_default+ star_etc? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default+ star_etc?")); asdl_seq * a; void *b; if ( @@ -4303,35 +5151,46 @@ parameters_rule(Parser *p) (b = star_etc_rule(p), 1) // star_etc? ) { + D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_with_default+ star_etc?")); _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default+ star_etc?")); } { // star_etc if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_etc")); StarEtc* a; if ( (a = star_etc_rule(p)) // star_etc ) { + D(fprintf(stderr, "%*c+ parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_etc")); _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , NULL , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_etc")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4339,15 +5198,19 @@ parameters_rule(Parser *p) static asdl_seq* slash_no_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // param_no_default+ '/' ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' ','")); Token * _literal; Token * _literal_1; asdl_seq * a; @@ -4359,19 +5222,25 @@ slash_no_default_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' ','")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slash_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default+ '/' ','")); } { // param_no_default+ '/' &')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' &')'")); Token * _literal; asdl_seq * a; if ( @@ -4382,17 +5251,22 @@ slash_no_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) // token=')' ) { + D(fprintf(stderr, "%*c+ slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default+ '/' &')'")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slash_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default+ '/' &')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4402,15 +5276,19 @@ slash_no_default_rule(Parser *p) static SlashWithDefault* slash_with_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } SlashWithDefault* _res = NULL; int _mark = p->mark; { // param_no_default* param_with_default+ '/' ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' ','")); Token * _literal; Token * _literal_1; asdl_seq * a; @@ -4425,19 +5303,25 @@ slash_with_default_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' ','")); _res = _PyPegen_slash_with_default ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slash_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default* param_with_default+ '/' ','")); } { // param_no_default* param_with_default+ '/' &')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' &')'")); Token * _literal; asdl_seq * a; asdl_seq * b; @@ -4451,17 +5335,22 @@ slash_with_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) // token=')' ) { + D(fprintf(stderr, "%*c+ slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* param_with_default+ '/' &')'")); _res = _PyPegen_slash_with_default ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slash_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default* param_with_default+ '/' &')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4473,15 +5362,19 @@ slash_with_default_rule(Parser *p) static StarEtc* star_etc_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } StarEtc* _res = NULL; int _mark = p->mark; { // '*' param_no_default param_maybe_default* kwds? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' param_no_default param_maybe_default* kwds?")); Token * _literal; arg_ty a; asdl_seq * b; @@ -4496,19 +5389,25 @@ star_etc_rule(Parser *p) (c = kwds_rule(p), 1) // kwds? ) { + D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' param_no_default param_maybe_default* kwds?")); _res = _PyPegen_star_etc ( p , a , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' param_no_default param_maybe_default* kwds?")); } { // '*' ',' param_maybe_default+ kwds? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' ',' param_maybe_default+ kwds?")); Token * _literal; Token * _literal_1; asdl_seq * b; @@ -4523,49 +5422,65 @@ star_etc_rule(Parser *p) (c = kwds_rule(p), 1) // kwds? ) { + D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' ',' param_maybe_default+ kwds?")); _res = _PyPegen_star_etc ( p , NULL , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' ',' param_maybe_default+ kwds?")); } { // kwds if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwds")); arg_ty a; if ( (a = kwds_rule(p)) // kwds ) { + D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwds")); _res = _PyPegen_star_etc ( p , NULL , NULL , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwds")); } { // invalid_star_etc if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_star_etc")); void *invalid_star_etc_var; if ( (invalid_star_etc_var = invalid_star_etc_rule(p)) // invalid_star_etc ) { + D(fprintf(stderr, "%*c+ star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_star_etc")); _res = invalid_star_etc_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_star_etc")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4573,15 +5488,19 @@ star_etc_rule(Parser *p) static arg_ty kwds_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arg_ty _res = NULL; int _mark = p->mark; { // '**' param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwds[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' param_no_default")); Token * _literal; arg_ty a; if ( @@ -4590,17 +5509,22 @@ kwds_rule(Parser *p) (a = param_no_default_rule(p)) // param_no_default ) { + D(fprintf(stderr, "%*c+ kwds[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' param_no_default")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwds[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' param_no_default")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4608,15 +5532,19 @@ kwds_rule(Parser *p) static arg_ty param_no_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arg_ty _res = NULL; int _mark = p->mark; { // param ',' TYPE_COMMENT? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param ',' TYPE_COMMENT?")); Token * _literal; arg_ty a; void *tc; @@ -4628,19 +5556,25 @@ param_no_default_rule(Parser *p) (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) // TYPE_COMMENT? ) { + D(fprintf(stderr, "%*c+ param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param ',' TYPE_COMMENT?")); _res = _PyPegen_add_type_comment_to_arg ( p , a , tc ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s param_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param ',' TYPE_COMMENT?")); } { // param TYPE_COMMENT? &')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param TYPE_COMMENT? &')'")); arg_ty a; void *tc; if ( @@ -4651,17 +5585,22 @@ param_no_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) // token=')' ) { + D(fprintf(stderr, "%*c+ param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param TYPE_COMMENT? &')'")); _res = _PyPegen_add_type_comment_to_arg ( p , a , tc ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s param_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param TYPE_COMMENT? &')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4669,15 +5608,19 @@ param_no_default_rule(Parser *p) static NameDefaultPair* param_with_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } NameDefaultPair* _res = NULL; int _mark = p->mark; { // param default ',' TYPE_COMMENT? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default ',' TYPE_COMMENT?")); Token * _literal; arg_ty a; expr_ty c; @@ -4692,19 +5635,25 @@ param_with_default_rule(Parser *p) (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) // TYPE_COMMENT? ) { + D(fprintf(stderr, "%*c+ param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default ',' TYPE_COMMENT?")); _res = _PyPegen_name_default_pair ( p , a , c , tc ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s param_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default ',' TYPE_COMMENT?")); } { // param default TYPE_COMMENT? &')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default TYPE_COMMENT? &')'")); arg_ty a; expr_ty c; void *tc; @@ -4718,17 +5667,22 @@ param_with_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) // token=')' ) { + D(fprintf(stderr, "%*c+ param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default TYPE_COMMENT? &')'")); _res = _PyPegen_name_default_pair ( p , a , c , tc ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s param_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default TYPE_COMMENT? &')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4738,15 +5692,19 @@ param_with_default_rule(Parser *p) static NameDefaultPair* param_maybe_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } NameDefaultPair* _res = NULL; int _mark = p->mark; { // param default? ',' TYPE_COMMENT? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default? ',' TYPE_COMMENT?")); Token * _literal; arg_ty a; void *c; @@ -4761,19 +5719,25 @@ param_maybe_default_rule(Parser *p) (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) // TYPE_COMMENT? ) { + D(fprintf(stderr, "%*c+ param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default? ',' TYPE_COMMENT?")); _res = _PyPegen_name_default_pair ( p , a , c , tc ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default? ',' TYPE_COMMENT?")); } { // param default? TYPE_COMMENT? &')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param default? TYPE_COMMENT? &')'")); arg_ty a; void *c; void *tc; @@ -4787,17 +5751,22 @@ param_maybe_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) // token=')' ) { + D(fprintf(stderr, "%*c+ param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param default? TYPE_COMMENT? &')'")); _res = _PyPegen_name_default_pair ( p , a , c , tc ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param default? TYPE_COMMENT? &')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4805,13 +5774,16 @@ param_maybe_default_rule(Parser *p) static arg_ty param_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arg_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -4820,8 +5792,10 @@ param_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME annotation? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> param[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME annotation?")); expr_ty a; void *b; if ( @@ -4830,8 +5804,10 @@ param_rule(Parser *p) (b = annotation_rule(p), 1) // annotation? ) { + D(fprintf(stderr, "%*c+ param[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME annotation?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -4841,14 +5817,18 @@ param_rule(Parser *p) _res = _Py_arg ( a -> v . Name . id , b , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s param[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME annotation?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4856,15 +5836,19 @@ param_rule(Parser *p) static expr_ty annotation_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; { // ':' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> annotation[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':' expression")); Token * _literal; expr_ty a; if ( @@ -4873,17 +5857,22 @@ annotation_rule(Parser *p) (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ annotation[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':' expression")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s annotation[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4891,15 +5880,19 @@ annotation_rule(Parser *p) static expr_ty default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; { // '=' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'=' expression")); Token * _literal; expr_ty a; if ( @@ -4908,17 +5901,22 @@ default_rule(Parser *p) (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' expression")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'=' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4926,31 +5924,40 @@ default_rule(Parser *p) static asdl_seq* decorators_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // (('@' named_expression NEWLINE))+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> decorators[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(('@' named_expression NEWLINE))+")); asdl_seq * a; if ( (a = _loop1_67_rule(p)) // (('@' named_expression NEWLINE))+ ) { + D(fprintf(stderr, "%*c+ decorators[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(('@' named_expression NEWLINE))+")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s decorators[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(('@' named_expression NEWLINE))+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -4958,15 +5965,19 @@ decorators_rule(Parser *p) static stmt_ty class_def_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; { // decorators class_def_raw if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> class_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "decorators class_def_raw")); asdl_seq* a; stmt_ty b; if ( @@ -4975,31 +5986,41 @@ class_def_rule(Parser *p) (b = class_def_raw_rule(p)) // class_def_raw ) { + D(fprintf(stderr, "%*c+ class_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "decorators class_def_raw")); _res = _PyPegen_class_def_decorators ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s class_def[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "decorators class_def_raw")); } { // class_def_raw if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> class_def[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "class_def_raw")); stmt_ty class_def_raw_var; if ( (class_def_raw_var = class_def_raw_rule(p)) // class_def_raw ) { + D(fprintf(stderr, "%*c+ class_def[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "class_def_raw")); _res = class_def_raw_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s class_def[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "class_def_raw")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5007,13 +6028,16 @@ class_def_rule(Parser *p) static stmt_ty class_def_raw_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } stmt_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5022,8 +6046,10 @@ class_def_raw_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'class' NAME ['(' arguments? ')'] ':' block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> class_def_raw[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'class' NAME ['(' arguments? ')'] ':' block")); Token * _keyword; Token * _literal; expr_ty a; @@ -5041,8 +6067,10 @@ class_def_raw_rule(Parser *p) (c = block_rule(p)) // block ) { + D(fprintf(stderr, "%*c+ class_def_raw[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'class' NAME ['(' arguments? ')'] ':' block")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5052,14 +6080,18 @@ class_def_raw_rule(Parser *p) _res = _Py_ClassDef ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , c , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s class_def_raw[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'class' NAME ['(' arguments? ')'] ':' block")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5067,17 +6099,23 @@ class_def_raw_rule(Parser *p) static asdl_seq* block_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; - if (_PyPegen_is_memoized(p, block_type, &_res)) + if (_PyPegen_is_memoized(p, block_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; { // NEWLINE INDENT statements DEDENT if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT statements DEDENT")); asdl_seq* a; Token * dedent_var; Token * indent_var; @@ -5092,46 +6130,61 @@ block_rule(Parser *p) (dedent_var = _PyPegen_expect_token(p, DEDENT)) // token='DEDENT' ) { + D(fprintf(stderr, "%*c+ block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT statements DEDENT")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE INDENT statements DEDENT")); } { // simple_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "simple_stmt")); asdl_seq* simple_stmt_var; if ( (simple_stmt_var = simple_stmt_rule(p)) // simple_stmt ) { + D(fprintf(stderr, "%*c+ block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "simple_stmt")); _res = simple_stmt_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "simple_stmt")); } { // invalid_block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_block")); void *invalid_block_var; if ( (invalid_block_var = invalid_block_rule(p)) // invalid_block ) { + D(fprintf(stderr, "%*c+ block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_block")); _res = invalid_block_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_block")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, block_type, _res); + D(p->level--); return _res; } @@ -5139,15 +6192,19 @@ block_rule(Parser *p) static asdl_seq* expressions_list_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.star_expression+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> expressions_list[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_expression+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -5157,17 +6214,22 @@ expressions_list_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ expressions_list[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.star_expression+ ','?")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s expressions_list[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.star_expression+ ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5178,13 +6240,16 @@ expressions_list_rule(Parser *p) static expr_ty star_expressions_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5193,8 +6258,10 @@ star_expressions_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // star_expression ((',' star_expression))+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression ((',' star_expression))+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty a; @@ -5207,8 +6274,10 @@ star_expressions_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ star_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression ((',' star_expression))+ ','?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5218,16 +6287,21 @@ star_expressions_rule(Parser *p) _res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression ((',' star_expression))+ ','?")); } { // star_expression ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression ','")); Token * _literal; expr_ty a; if ( @@ -5236,8 +6310,10 @@ star_expressions_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ star_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression ','")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5247,28 +6323,37 @@ star_expressions_rule(Parser *p) _res = _Py_Tuple ( CHECK ( _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression ','")); } { // star_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression")); expr_ty star_expression_var; if ( (star_expression_var = star_expression_rule(p)) // star_expression ) { + D(fprintf(stderr, "%*c+ star_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression")); _res = star_expression_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5276,15 +6361,20 @@ star_expressions_rule(Parser *p) static expr_ty star_expression_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, star_expression_type, &_res)) + if (_PyPegen_is_memoized(p, star_expression_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5293,8 +6383,10 @@ star_expression_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '*' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -5303,8 +6395,10 @@ star_expression_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ star_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5314,29 +6408,38 @@ star_expression_rule(Parser *p) _res = _Py_Starred ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' bitwise_or")); } { // expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression")); expr_ty expression_var; if ( (expression_var = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ star_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression")); _res = expression_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, star_expression_type, _res); + D(p->level--); return _res; } @@ -5344,15 +6447,19 @@ star_expression_rule(Parser *p) static asdl_seq* star_named_expressions_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.star_named_expression+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_named_expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_named_expression+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -5362,17 +6469,22 @@ star_named_expressions_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ star_named_expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.star_named_expression+ ','?")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_named_expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.star_named_expression+ ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5380,13 +6492,16 @@ star_named_expressions_rule(Parser *p) static expr_ty star_named_expression_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5395,8 +6510,10 @@ star_named_expression_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '*' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -5405,8 +6522,10 @@ star_named_expression_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ star_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' bitwise_or")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5416,28 +6535,37 @@ star_named_expression_rule(Parser *p) _res = _Py_Starred ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' bitwise_or")); } { // named_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "named_expression")); expr_ty named_expression_var; if ( (named_expression_var = named_expression_rule(p)) // named_expression ) { + D(fprintf(stderr, "%*c+ star_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "named_expression")); _res = named_expression_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "named_expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5445,13 +6573,16 @@ star_named_expression_rule(Parser *p) static expr_ty named_expression_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5460,8 +6591,10 @@ named_expression_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME ':=' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ':=' expression")); Token * _literal; expr_ty a; expr_ty b; @@ -5473,8 +6606,10 @@ named_expression_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ':=' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5484,16 +6619,21 @@ named_expression_rule(Parser *p) _res = _Py_NamedExpr ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ':=' expression")); } { // expression !':=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression !':='")); expr_ty expression_var; if ( (expression_var = expression_rule(p)) // expression @@ -5501,27 +6641,36 @@ named_expression_rule(Parser *p) _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 53) // token=':=' ) { + D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression !':='")); _res = expression_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression !':='")); } { // invalid_named_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_named_expression")); void *invalid_named_expression_var; if ( (invalid_named_expression_var = invalid_named_expression_rule(p)) // invalid_named_expression ) { + D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_named_expression")); _res = invalid_named_expression_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_named_expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5529,41 +6678,54 @@ named_expression_rule(Parser *p) static expr_ty annotated_rhs_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; { // yield_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> annotated_rhs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { + D(fprintf(stderr, "%*c+ annotated_rhs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); _res = yield_expr_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s annotated_rhs[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } { // star_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> annotated_rhs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { + D(fprintf(stderr, "%*c+ annotated_rhs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); _res = star_expressions_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s annotated_rhs[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5571,13 +6733,16 @@ annotated_rhs_rule(Parser *p) static expr_ty expressions_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5586,8 +6751,10 @@ expressions_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // expression ((',' expression))+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ((',' expression))+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty a; @@ -5600,8 +6767,10 @@ expressions_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ((',' expression))+ ','?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5611,16 +6780,21 @@ expressions_rule(Parser *p) _res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ((',' expression))+ ','?")); } { // expression ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ','")); Token * _literal; expr_ty a; if ( @@ -5629,8 +6803,10 @@ expressions_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ','")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5640,28 +6816,37 @@ expressions_rule(Parser *p) _res = _Py_Tuple ( CHECK ( _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ','")); } { // expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> expressions[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression")); expr_ty expression_var; if ( (expression_var = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ expressions[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression")); _res = expression_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s expressions[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5669,15 +6854,20 @@ expressions_rule(Parser *p) static expr_ty expression_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, expression_type, &_res)) + if (_PyPegen_is_memoized(p, expression_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5686,8 +6876,10 @@ expression_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // disjunction 'if' disjunction 'else' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "disjunction 'if' disjunction 'else' expression")); Token * _keyword; Token * _keyword_1; expr_ty a; @@ -5705,8 +6897,10 @@ expression_rule(Parser *p) (c = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "disjunction 'if' disjunction 'else' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5716,43 +6910,57 @@ expression_rule(Parser *p) _res = _Py_IfExp ( b , a , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "disjunction 'if' disjunction 'else' expression")); } { // disjunction if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "disjunction")); expr_ty disjunction_var; if ( (disjunction_var = disjunction_rule(p)) // disjunction ) { + D(fprintf(stderr, "%*c+ expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "disjunction")); _res = disjunction_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "disjunction")); } { // lambdef if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambdef")); expr_ty lambdef_var; if ( (lambdef_var = lambdef_rule(p)) // lambdef ) { + D(fprintf(stderr, "%*c+ expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambdef")); _res = lambdef_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambdef")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, expression_type, _res); + D(p->level--); return _res; } @@ -5760,13 +6968,16 @@ expression_rule(Parser *p) static expr_ty lambdef_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -5775,8 +6986,10 @@ lambdef_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'lambda' lambda_parameters? ':' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambdef[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'lambda' lambda_parameters? ':' expression")); Token * _keyword; Token * _literal; void *a; @@ -5791,8 +7004,10 @@ lambdef_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ lambdef[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'lambda' lambda_parameters? ':' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -5802,14 +7017,18 @@ lambdef_rule(Parser *p) _res = _Py_Lambda ( ( a ) ? a : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambdef[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'lambda' lambda_parameters? ':' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5822,15 +7041,19 @@ lambdef_rule(Parser *p) static arguments_ty lambda_parameters_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } 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) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?")); asdl_seq* a; asdl_seq * b; asdl_seq * c; @@ -5845,19 +7068,25 @@ lambda_parameters_rule(Parser *p) (d = lambda_star_etc_rule(p), 1) // lambda_star_etc? ) { + D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?")); _res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_no_default lambda_param_no_default* lambda_param_with_default* lambda_star_etc?")); } { // lambda_slash_with_default lambda_param_with_default* lambda_star_etc? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default lambda_param_with_default* lambda_star_etc?")); SlashWithDefault* a; asdl_seq * b; void *c; @@ -5869,19 +7098,25 @@ lambda_parameters_rule(Parser *p) (c = lambda_star_etc_rule(p), 1) // lambda_star_etc? ) { + D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default lambda_param_with_default* lambda_star_etc?")); _res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_with_default lambda_param_with_default* lambda_star_etc?")); } { // lambda_param_no_default+ lambda_param_with_default* lambda_star_etc? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?")); asdl_seq * a; asdl_seq * b; void *c; @@ -5893,19 +7128,25 @@ lambda_parameters_rule(Parser *p) (c = lambda_star_etc_rule(p), 1) // lambda_star_etc? ) { + D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?")); _res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default+ lambda_param_with_default* lambda_star_etc?")); } { // lambda_param_with_default+ lambda_star_etc? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+ lambda_star_etc?")); asdl_seq * a; void *b; if ( @@ -5914,35 +7155,46 @@ lambda_parameters_rule(Parser *p) (b = lambda_star_etc_rule(p), 1) // lambda_star_etc? ) { + D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+ lambda_star_etc?")); _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default+ lambda_star_etc?")); } { // lambda_star_etc if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_star_etc")); StarEtc* a; if ( (a = lambda_star_etc_rule(p)) // lambda_star_etc ) { + D(fprintf(stderr, "%*c+ lambda_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_star_etc")); _res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , NULL , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_star_etc")); } _res = NULL; done: + D(p->level--); return _res; } @@ -5952,15 +7204,19 @@ lambda_parameters_rule(Parser *p) static asdl_seq* lambda_slash_no_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // lambda_param_no_default+ '/' ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' ','")); Token * _literal; Token * _literal_1; asdl_seq * a; @@ -5972,19 +7228,25 @@ lambda_slash_no_default_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ lambda_slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' ','")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_slash_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default+ '/' ','")); } { // lambda_param_no_default+ '/' &':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_slash_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' &':'")); Token * _literal; asdl_seq * a; if ( @@ -5995,17 +7257,22 @@ lambda_slash_no_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11) // token=':' ) { + D(fprintf(stderr, "%*c+ lambda_slash_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default+ '/' &':'")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_slash_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default+ '/' &':'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6015,15 +7282,19 @@ lambda_slash_no_default_rule(Parser *p) static SlashWithDefault* lambda_slash_with_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } SlashWithDefault* _res = NULL; int _mark = p->mark; { // lambda_param_no_default* lambda_param_with_default+ '/' ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' ','")); Token * _literal; Token * _literal_1; asdl_seq * a; @@ -6038,19 +7309,25 @@ lambda_slash_with_default_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ lambda_slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' ','")); _res = _PyPegen_slash_with_default ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_slash_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' ','")); } { // lambda_param_no_default* lambda_param_with_default+ '/' &':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_slash_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' &':'")); Token * _literal; asdl_seq * a; asdl_seq * b; @@ -6064,17 +7341,22 @@ lambda_slash_with_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11) // token=':' ) { + D(fprintf(stderr, "%*c+ lambda_slash_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' &':'")); _res = _PyPegen_slash_with_default ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_slash_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default* lambda_param_with_default+ '/' &':'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6086,15 +7368,19 @@ lambda_slash_with_default_rule(Parser *p) static StarEtc* lambda_star_etc_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } StarEtc* _res = NULL; int _mark = p->mark; { // '*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?")); Token * _literal; arg_ty a; asdl_seq * b; @@ -6109,19 +7395,25 @@ lambda_star_etc_rule(Parser *p) (c = lambda_kwds_rule(p), 1) // lambda_kwds? ) { + D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?")); _res = _PyPegen_star_etc ( p , a , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' lambda_param_no_default lambda_param_maybe_default* lambda_kwds?")); } { // '*' ',' lambda_param_maybe_default+ lambda_kwds? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' ',' lambda_param_maybe_default+ lambda_kwds?")); Token * _literal; Token * _literal_1; asdl_seq * b; @@ -6136,49 +7428,65 @@ lambda_star_etc_rule(Parser *p) (c = lambda_kwds_rule(p), 1) // lambda_kwds? ) { + D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' ',' lambda_param_maybe_default+ lambda_kwds?")); _res = _PyPegen_star_etc ( p , NULL , b , c ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' ',' lambda_param_maybe_default+ lambda_kwds?")); } { // lambda_kwds if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_kwds")); arg_ty a; if ( (a = lambda_kwds_rule(p)) // lambda_kwds ) { + D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_kwds")); _res = _PyPegen_star_etc ( p , NULL , NULL , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_kwds")); } { // invalid_lambda_star_etc if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_lambda_star_etc")); void *invalid_lambda_star_etc_var; if ( (invalid_lambda_star_etc_var = invalid_lambda_star_etc_rule(p)) // invalid_lambda_star_etc ) { + D(fprintf(stderr, "%*c+ lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_lambda_star_etc")); _res = invalid_lambda_star_etc_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_lambda_star_etc")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6186,15 +7494,19 @@ lambda_star_etc_rule(Parser *p) static arg_ty lambda_kwds_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arg_ty _res = NULL; int _mark = p->mark; { // '**' lambda_param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_kwds[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' lambda_param_no_default")); Token * _literal; arg_ty a; if ( @@ -6203,17 +7515,22 @@ lambda_kwds_rule(Parser *p) (a = lambda_param_no_default_rule(p)) // lambda_param_no_default ) { + D(fprintf(stderr, "%*c+ lambda_kwds[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' lambda_param_no_default")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_kwds[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' lambda_param_no_default")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6221,15 +7538,19 @@ lambda_kwds_rule(Parser *p) static arg_ty lambda_param_no_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arg_ty _res = NULL; int _mark = p->mark; { // lambda_param ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param ','")); Token * _literal; arg_ty a; if ( @@ -6238,19 +7559,25 @@ lambda_param_no_default_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ lambda_param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param ','")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_param_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param ','")); } { // lambda_param &':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_param_no_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param &':'")); arg_ty a; if ( (a = lambda_param_rule(p)) // lambda_param @@ -6258,17 +7585,22 @@ lambda_param_no_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11) // token=':' ) { + D(fprintf(stderr, "%*c+ lambda_param_no_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param &':'")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_param_no_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param &':'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6276,15 +7608,19 @@ lambda_param_no_default_rule(Parser *p) static NameDefaultPair* lambda_param_with_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } NameDefaultPair* _res = NULL; int _mark = p->mark; { // lambda_param default ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default ','")); Token * _literal; arg_ty a; expr_ty c; @@ -6296,19 +7632,25 @@ lambda_param_with_default_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ lambda_param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default ','")); _res = _PyPegen_name_default_pair ( p , a , c , NULL ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_param_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default ','")); } { // lambda_param default &':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_param_with_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default &':'")); arg_ty a; expr_ty c; if ( @@ -6319,17 +7661,22 @@ lambda_param_with_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11) // token=':' ) { + D(fprintf(stderr, "%*c+ lambda_param_with_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default &':'")); _res = _PyPegen_name_default_pair ( p , a , c , NULL ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_param_with_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default &':'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6337,15 +7684,19 @@ lambda_param_with_default_rule(Parser *p) static NameDefaultPair* lambda_param_maybe_default_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } NameDefaultPair* _res = NULL; int _mark = p->mark; { // lambda_param default? ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default? ','")); Token * _literal; arg_ty a; void *c; @@ -6357,19 +7708,25 @@ lambda_param_maybe_default_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ lambda_param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default? ','")); _res = _PyPegen_name_default_pair ( p , a , c , NULL ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default? ','")); } { // lambda_param default? &':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_param_maybe_default[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param default? &':'")); arg_ty a; void *c; if ( @@ -6380,17 +7737,22 @@ lambda_param_maybe_default_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 11) // token=':' ) { + D(fprintf(stderr, "%*c+ lambda_param_maybe_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param default? &':'")); _res = _PyPegen_name_default_pair ( p , a , c , NULL ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_param_maybe_default[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param default? &':'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6398,13 +7760,16 @@ lambda_param_maybe_default_rule(Parser *p) static arg_ty lambda_param_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } arg_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -6413,15 +7778,19 @@ lambda_param_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lambda_param[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME")); expr_ty a; if ( (a = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ lambda_param[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -6431,14 +7800,18 @@ lambda_param_rule(Parser *p) _res = _Py_arg ( a -> v . Name . id , NULL , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lambda_param[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6446,15 +7819,20 @@ lambda_param_rule(Parser *p) static expr_ty disjunction_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, disjunction_type, &_res)) + if (_PyPegen_is_memoized(p, disjunction_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -6463,8 +7841,10 @@ disjunction_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // conjunction (('or' conjunction))+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> disjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "conjunction (('or' conjunction))+")); expr_ty a; asdl_seq * b; if ( @@ -6473,8 +7853,10 @@ disjunction_rule(Parser *p) (b = _loop1_89_rule(p)) // (('or' conjunction))+ ) { + D(fprintf(stderr, "%*c+ disjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "conjunction (('or' conjunction))+")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -6484,29 +7866,38 @@ disjunction_rule(Parser *p) _res = _Py_BoolOp ( Or , CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s disjunction[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "conjunction (('or' conjunction))+")); } { // conjunction if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> disjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "conjunction")); expr_ty conjunction_var; if ( (conjunction_var = conjunction_rule(p)) // conjunction ) { + D(fprintf(stderr, "%*c+ disjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "conjunction")); _res = conjunction_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s disjunction[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "conjunction")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, disjunction_type, _res); + D(p->level--); return _res; } @@ -6514,15 +7905,20 @@ disjunction_rule(Parser *p) static expr_ty conjunction_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, conjunction_type, &_res)) + if (_PyPegen_is_memoized(p, conjunction_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -6531,8 +7927,10 @@ conjunction_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // inversion (('and' inversion))+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> conjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "inversion (('and' inversion))+")); expr_ty a; asdl_seq * b; if ( @@ -6541,8 +7939,10 @@ conjunction_rule(Parser *p) (b = _loop1_90_rule(p)) // (('and' inversion))+ ) { + D(fprintf(stderr, "%*c+ conjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "inversion (('and' inversion))+")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -6552,29 +7952,38 @@ conjunction_rule(Parser *p) _res = _Py_BoolOp ( And , CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s conjunction[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "inversion (('and' inversion))+")); } { // inversion if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> conjunction[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "inversion")); expr_ty inversion_var; if ( (inversion_var = inversion_rule(p)) // inversion ) { + D(fprintf(stderr, "%*c+ conjunction[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "inversion")); _res = inversion_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s conjunction[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "inversion")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, conjunction_type, _res); + D(p->level--); return _res; } @@ -6582,15 +7991,20 @@ conjunction_rule(Parser *p) static expr_ty inversion_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, inversion_type, &_res)) + if (_PyPegen_is_memoized(p, inversion_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -6599,8 +8013,10 @@ inversion_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'not' inversion if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> inversion[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'not' inversion")); Token * _keyword; expr_ty a; if ( @@ -6609,8 +8025,10 @@ inversion_rule(Parser *p) (a = inversion_rule(p)) // inversion ) { + D(fprintf(stderr, "%*c+ inversion[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'not' inversion")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -6620,29 +8038,38 @@ inversion_rule(Parser *p) _res = _Py_UnaryOp ( Not , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s inversion[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'not' inversion")); } { // comparison if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> inversion[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "comparison")); expr_ty comparison_var; if ( (comparison_var = comparison_rule(p)) // comparison ) { + D(fprintf(stderr, "%*c+ inversion[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "comparison")); _res = comparison_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s inversion[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "comparison")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, inversion_type, _res); + D(p->level--); return _res; } @@ -6650,13 +8077,16 @@ inversion_rule(Parser *p) static expr_ty comparison_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -6665,8 +8095,10 @@ comparison_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // bitwise_or compare_op_bitwise_or_pair+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> comparison[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_or compare_op_bitwise_or_pair+")); expr_ty a; asdl_seq * b; if ( @@ -6675,8 +8107,10 @@ comparison_rule(Parser *p) (b = _loop1_91_rule(p)) // compare_op_bitwise_or_pair+ ) { + D(fprintf(stderr, "%*c+ comparison[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_or compare_op_bitwise_or_pair+")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -6686,28 +8120,37 @@ comparison_rule(Parser *p) _res = _Py_Compare ( a , CHECK ( _PyPegen_get_cmpops ( p , b ) ) , CHECK ( _PyPegen_get_exprs ( p , b ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s comparison[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_or compare_op_bitwise_or_pair+")); } { // bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> comparison[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_or")); expr_ty bitwise_or_var; if ( (bitwise_or_var = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ comparison[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_or")); _res = bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s comparison[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6725,153 +8168,206 @@ comparison_rule(Parser *p) static CmpopExprPair* compare_op_bitwise_or_pair_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // eq_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "eq_bitwise_or")); CmpopExprPair* eq_bitwise_or_var; if ( (eq_bitwise_or_var = eq_bitwise_or_rule(p)) // eq_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "eq_bitwise_or")); _res = eq_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "eq_bitwise_or")); } { // noteq_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "noteq_bitwise_or")); CmpopExprPair* noteq_bitwise_or_var; if ( (noteq_bitwise_or_var = noteq_bitwise_or_rule(p)) // noteq_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "noteq_bitwise_or")); _res = noteq_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "noteq_bitwise_or")); } { // lte_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lte_bitwise_or")); CmpopExprPair* lte_bitwise_or_var; if ( (lte_bitwise_or_var = lte_bitwise_or_rule(p)) // lte_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lte_bitwise_or")); _res = lte_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lte_bitwise_or")); } { // lt_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lt_bitwise_or")); CmpopExprPair* lt_bitwise_or_var; if ( (lt_bitwise_or_var = lt_bitwise_or_rule(p)) // lt_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lt_bitwise_or")); _res = lt_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lt_bitwise_or")); } { // gte_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "gte_bitwise_or")); CmpopExprPair* gte_bitwise_or_var; if ( (gte_bitwise_or_var = gte_bitwise_or_rule(p)) // gte_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "gte_bitwise_or")); _res = gte_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "gte_bitwise_or")); } { // gt_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "gt_bitwise_or")); CmpopExprPair* gt_bitwise_or_var; if ( (gt_bitwise_or_var = gt_bitwise_or_rule(p)) // gt_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "gt_bitwise_or")); _res = gt_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "gt_bitwise_or")); } { // notin_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "notin_bitwise_or")); CmpopExprPair* notin_bitwise_or_var; if ( (notin_bitwise_or_var = notin_bitwise_or_rule(p)) // notin_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "notin_bitwise_or")); _res = notin_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "notin_bitwise_or")); } { // in_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "in_bitwise_or")); CmpopExprPair* in_bitwise_or_var; if ( (in_bitwise_or_var = in_bitwise_or_rule(p)) // in_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "in_bitwise_or")); _res = in_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "in_bitwise_or")); } { // isnot_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "isnot_bitwise_or")); CmpopExprPair* isnot_bitwise_or_var; if ( (isnot_bitwise_or_var = isnot_bitwise_or_rule(p)) // isnot_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "isnot_bitwise_or")); _res = isnot_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "isnot_bitwise_or")); } { // is_bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> compare_op_bitwise_or_pair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "is_bitwise_or")); CmpopExprPair* is_bitwise_or_var; if ( (is_bitwise_or_var = is_bitwise_or_rule(p)) // is_bitwise_or ) { + D(fprintf(stderr, "%*c+ compare_op_bitwise_or_pair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "is_bitwise_or")); _res = is_bitwise_or_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s compare_op_bitwise_or_pair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "is_bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6879,15 +8375,19 @@ compare_op_bitwise_or_pair_rule(Parser *p) static CmpopExprPair* eq_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // '==' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> eq_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'==' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -6896,17 +8396,22 @@ eq_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ eq_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'==' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , Eq , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s eq_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'==' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6914,15 +8419,19 @@ eq_bitwise_or_rule(Parser *p) static CmpopExprPair* noteq_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // ('!=') bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> noteq_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('!=') bitwise_or")); void *_tmp_92_var; expr_ty a; if ( @@ -6931,17 +8440,22 @@ noteq_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ noteq_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "('!=') bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , NotEq , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s noteq_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('!=') bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6949,15 +8463,19 @@ noteq_bitwise_or_rule(Parser *p) static CmpopExprPair* lte_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // '<=' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lte_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'<=' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -6966,17 +8484,22 @@ lte_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ lte_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'<=' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , LtE , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lte_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'<=' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -6984,15 +8507,19 @@ lte_bitwise_or_rule(Parser *p) static CmpopExprPair* lt_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // '<' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> lt_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'<' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -7001,17 +8528,22 @@ lt_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ lt_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'<' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , Lt , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s lt_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'<' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7019,15 +8551,19 @@ lt_bitwise_or_rule(Parser *p) static CmpopExprPair* gte_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // '>=' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> gte_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'>=' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -7036,17 +8572,22 @@ gte_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ gte_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'>=' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , GtE , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s gte_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'>=' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7054,15 +8595,19 @@ gte_bitwise_or_rule(Parser *p) static CmpopExprPair* gt_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // '>' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> gt_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'>' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -7071,17 +8616,22 @@ gt_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ gt_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'>' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , Gt , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s gt_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'>' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7089,15 +8639,19 @@ gt_bitwise_or_rule(Parser *p) static CmpopExprPair* notin_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // 'not' 'in' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> notin_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'not' 'in' bitwise_or")); Token * _keyword; Token * _keyword_1; expr_ty a; @@ -7109,17 +8663,22 @@ notin_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ notin_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'not' 'in' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , NotIn , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s notin_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'not' 'in' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7127,15 +8686,19 @@ notin_bitwise_or_rule(Parser *p) static CmpopExprPair* in_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // 'in' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> in_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'in' bitwise_or")); Token * _keyword; expr_ty a; if ( @@ -7144,17 +8707,22 @@ in_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ in_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'in' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , In , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s in_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'in' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7162,15 +8730,19 @@ in_bitwise_or_rule(Parser *p) static CmpopExprPair* isnot_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // 'is' 'not' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> isnot_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'is' 'not' bitwise_or")); Token * _keyword; Token * _keyword_1; expr_ty a; @@ -7182,17 +8754,22 @@ isnot_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ isnot_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'is' 'not' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , IsNot , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s isnot_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'is' 'not' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7200,15 +8777,19 @@ isnot_bitwise_or_rule(Parser *p) static CmpopExprPair* is_bitwise_or_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } CmpopExprPair* _res = NULL; int _mark = p->mark; { // 'is' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> is_bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'is' bitwise_or")); Token * _keyword; expr_ty a; if ( @@ -7217,17 +8798,22 @@ is_bitwise_or_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ is_bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'is' bitwise_or")); _res = _PyPegen_cmpop_expr_pair ( p , Is , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s is_bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'is' bitwise_or")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7237,14 +8823,18 @@ static expr_ty bitwise_or_raw(Parser *); static expr_ty bitwise_or_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, bitwise_or_type, &_res)) + if (_PyPegen_is_memoized(p, bitwise_or_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_1 = _PyPegen_update_memo(p, _mark, bitwise_or_type, _res); if (tmpvar_1) { + D(p->level--); return _res; } p->mark = _mark; @@ -7255,18 +8845,22 @@ bitwise_or_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty bitwise_or_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -7275,8 +8869,10 @@ bitwise_or_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // bitwise_or '|' bitwise_xor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_or '|' bitwise_xor")); Token * _literal; expr_ty a; expr_ty b; @@ -7288,8 +8884,10 @@ bitwise_or_raw(Parser *p) (b = bitwise_xor_rule(p)) // bitwise_xor ) { + D(fprintf(stderr, "%*c+ bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_or '|' bitwise_xor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7299,28 +8897,37 @@ bitwise_or_raw(Parser *p) _res = _Py_BinOp ( a , BitOr , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_or '|' bitwise_xor")); } { // bitwise_xor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> bitwise_or[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_xor")); expr_ty bitwise_xor_var; if ( (bitwise_xor_var = bitwise_xor_rule(p)) // bitwise_xor ) { + D(fprintf(stderr, "%*c+ bitwise_or[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_xor")); _res = bitwise_xor_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s bitwise_or[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_xor")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7330,14 +8937,18 @@ static expr_ty bitwise_xor_raw(Parser *); static expr_ty bitwise_xor_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, bitwise_xor_type, &_res)) + if (_PyPegen_is_memoized(p, bitwise_xor_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_2 = _PyPegen_update_memo(p, _mark, bitwise_xor_type, _res); if (tmpvar_2) { + D(p->level--); return _res; } p->mark = _mark; @@ -7348,18 +8959,22 @@ bitwise_xor_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty bitwise_xor_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -7368,8 +8983,10 @@ bitwise_xor_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // bitwise_xor '^' bitwise_and if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> bitwise_xor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_xor '^' bitwise_and")); Token * _literal; expr_ty a; expr_ty b; @@ -7381,8 +8998,10 @@ bitwise_xor_raw(Parser *p) (b = bitwise_and_rule(p)) // bitwise_and ) { + D(fprintf(stderr, "%*c+ bitwise_xor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_xor '^' bitwise_and")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7392,28 +9011,37 @@ bitwise_xor_raw(Parser *p) _res = _Py_BinOp ( a , BitXor , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s bitwise_xor[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_xor '^' bitwise_and")); } { // bitwise_and if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> bitwise_xor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_and")); expr_ty bitwise_and_var; if ( (bitwise_and_var = bitwise_and_rule(p)) // bitwise_and ) { + D(fprintf(stderr, "%*c+ bitwise_xor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_and")); _res = bitwise_and_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s bitwise_xor[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_and")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7423,14 +9051,18 @@ static expr_ty bitwise_and_raw(Parser *); static expr_ty bitwise_and_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, bitwise_and_type, &_res)) + if (_PyPegen_is_memoized(p, bitwise_and_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_3 = _PyPegen_update_memo(p, _mark, bitwise_and_type, _res); if (tmpvar_3) { + D(p->level--); return _res; } p->mark = _mark; @@ -7441,18 +9073,22 @@ bitwise_and_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty bitwise_and_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -7461,8 +9097,10 @@ bitwise_and_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // bitwise_and '&' shift_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> bitwise_and[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "bitwise_and '&' shift_expr")); Token * _literal; expr_ty a; expr_ty b; @@ -7474,8 +9112,10 @@ bitwise_and_raw(Parser *p) (b = shift_expr_rule(p)) // shift_expr ) { + D(fprintf(stderr, "%*c+ bitwise_and[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "bitwise_and '&' shift_expr")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7485,28 +9125,37 @@ bitwise_and_raw(Parser *p) _res = _Py_BinOp ( a , BitAnd , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s bitwise_and[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "bitwise_and '&' shift_expr")); } { // shift_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> bitwise_and[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "shift_expr")); expr_ty shift_expr_var; if ( (shift_expr_var = shift_expr_rule(p)) // shift_expr ) { + D(fprintf(stderr, "%*c+ bitwise_and[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "shift_expr")); _res = shift_expr_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s bitwise_and[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "shift_expr")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7516,14 +9165,18 @@ static expr_ty shift_expr_raw(Parser *); static expr_ty shift_expr_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, shift_expr_type, &_res)) + if (_PyPegen_is_memoized(p, shift_expr_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_4 = _PyPegen_update_memo(p, _mark, shift_expr_type, _res); if (tmpvar_4) { + D(p->level--); return _res; } p->mark = _mark; @@ -7534,18 +9187,22 @@ shift_expr_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty shift_expr_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -7554,8 +9211,10 @@ shift_expr_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // shift_expr '<<' sum if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> shift_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "shift_expr '<<' sum")); Token * _literal; expr_ty a; expr_ty b; @@ -7567,8 +9226,10 @@ shift_expr_raw(Parser *p) (b = sum_rule(p)) // sum ) { + D(fprintf(stderr, "%*c+ shift_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "shift_expr '<<' sum")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7578,16 +9239,21 @@ shift_expr_raw(Parser *p) _res = _Py_BinOp ( a , LShift , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s shift_expr[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "shift_expr '<<' sum")); } { // shift_expr '>>' sum if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> shift_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "shift_expr '>>' sum")); Token * _literal; expr_ty a; expr_ty b; @@ -7599,8 +9265,10 @@ shift_expr_raw(Parser *p) (b = sum_rule(p)) // sum ) { + D(fprintf(stderr, "%*c+ shift_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "shift_expr '>>' sum")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7610,28 +9278,37 @@ shift_expr_raw(Parser *p) _res = _Py_BinOp ( a , RShift , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s shift_expr[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "shift_expr '>>' sum")); } { // sum if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> shift_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "sum")); expr_ty sum_var; if ( (sum_var = sum_rule(p)) // sum ) { + D(fprintf(stderr, "%*c+ shift_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "sum")); _res = sum_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s shift_expr[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "sum")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7641,14 +9318,18 @@ static expr_ty sum_raw(Parser *); static expr_ty sum_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, sum_type, &_res)) + if (_PyPegen_is_memoized(p, sum_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_5 = _PyPegen_update_memo(p, _mark, sum_type, _res); if (tmpvar_5) { + D(p->level--); return _res; } p->mark = _mark; @@ -7659,18 +9340,22 @@ sum_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty sum_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -7679,8 +9364,10 @@ sum_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // sum '+' term if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> sum[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "sum '+' term")); Token * _literal; expr_ty a; expr_ty b; @@ -7692,8 +9379,10 @@ sum_raw(Parser *p) (b = term_rule(p)) // term ) { + D(fprintf(stderr, "%*c+ sum[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "sum '+' term")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7703,16 +9392,21 @@ sum_raw(Parser *p) _res = _Py_BinOp ( a , Add , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s sum[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "sum '+' term")); } { // sum '-' term if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> sum[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "sum '-' term")); Token * _literal; expr_ty a; expr_ty b; @@ -7724,8 +9418,10 @@ sum_raw(Parser *p) (b = term_rule(p)) // term ) { + D(fprintf(stderr, "%*c+ sum[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "sum '-' term")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7735,28 +9431,37 @@ sum_raw(Parser *p) _res = _Py_BinOp ( a , Sub , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s sum[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "sum '-' term")); } { // term if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> sum[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term")); expr_ty term_var; if ( (term_var = term_rule(p)) // term ) { + D(fprintf(stderr, "%*c+ sum[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term")); _res = term_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s sum[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7772,14 +9477,18 @@ static expr_ty term_raw(Parser *); static expr_ty term_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, term_type, &_res)) + if (_PyPegen_is_memoized(p, term_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_6 = _PyPegen_update_memo(p, _mark, term_type, _res); if (tmpvar_6) { + D(p->level--); return _res; } p->mark = _mark; @@ -7790,18 +9499,22 @@ term_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty term_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -7810,8 +9523,10 @@ term_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // term '*' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '*' factor")); Token * _literal; expr_ty a; expr_ty b; @@ -7823,8 +9538,10 @@ term_raw(Parser *p) (b = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '*' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7834,16 +9551,21 @@ term_raw(Parser *p) _res = _Py_BinOp ( a , Mult , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '*' factor")); } { // term '/' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '/' factor")); Token * _literal; expr_ty a; expr_ty b; @@ -7855,8 +9577,10 @@ term_raw(Parser *p) (b = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '/' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7866,16 +9590,21 @@ term_raw(Parser *p) _res = _Py_BinOp ( a , Div , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '/' factor")); } { // term '//' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '//' factor")); Token * _literal; expr_ty a; expr_ty b; @@ -7887,8 +9616,10 @@ term_raw(Parser *p) (b = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '//' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7898,16 +9629,21 @@ term_raw(Parser *p) _res = _Py_BinOp ( a , FloorDiv , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '//' factor")); } { // term '%' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '%' factor")); Token * _literal; expr_ty a; expr_ty b; @@ -7919,8 +9655,10 @@ term_raw(Parser *p) (b = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '%' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7930,16 +9668,21 @@ term_raw(Parser *p) _res = _Py_BinOp ( a , Mod , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '%' factor")); } { // term '@' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "term '@' factor")); Token * _literal; expr_ty a; expr_ty b; @@ -7951,8 +9694,10 @@ term_raw(Parser *p) (b = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "term '@' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -7962,28 +9707,37 @@ term_raw(Parser *p) _res = CHECK_VERSION ( 5 , "The '@' operator is" , _Py_BinOp ( a , MatMult , b , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "term '@' factor")); } { // factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> term[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "factor")); expr_ty factor_var; if ( (factor_var = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ term[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "factor")); _res = factor_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s term[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "factor")); } _res = NULL; done: + D(p->level--); return _res; } @@ -7991,15 +9745,20 @@ term_raw(Parser *p) static expr_ty factor_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, factor_type, &_res)) + if (_PyPegen_is_memoized(p, factor_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8008,8 +9767,10 @@ factor_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '+' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'+' factor")); Token * _literal; expr_ty a; if ( @@ -8018,8 +9779,10 @@ factor_rule(Parser *p) (a = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'+' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8029,16 +9792,21 @@ factor_rule(Parser *p) _res = _Py_UnaryOp ( UAdd , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'+' factor")); } { // '-' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'-' factor")); Token * _literal; expr_ty a; if ( @@ -8047,8 +9815,10 @@ factor_rule(Parser *p) (a = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'-' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8058,16 +9828,21 @@ factor_rule(Parser *p) _res = _Py_UnaryOp ( USub , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'-' factor")); } { // '~' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'~' factor")); Token * _literal; expr_ty a; if ( @@ -8076,8 +9851,10 @@ factor_rule(Parser *p) (a = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'~' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8087,29 +9864,38 @@ factor_rule(Parser *p) _res = _Py_UnaryOp ( Invert , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'~' factor")); } { // power if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> factor[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "power")); expr_ty power_var; if ( (power_var = power_rule(p)) // power ) { + D(fprintf(stderr, "%*c+ factor[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "power")); _res = power_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s factor[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "power")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, factor_type, _res); + D(p->level--); return _res; } @@ -8117,13 +9903,16 @@ factor_rule(Parser *p) static expr_ty power_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8132,8 +9921,10 @@ power_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // await_primary '**' factor if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> power[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "await_primary '**' factor")); Token * _literal; expr_ty a; expr_ty b; @@ -8145,8 +9936,10 @@ power_rule(Parser *p) (b = factor_rule(p)) // factor ) { + D(fprintf(stderr, "%*c+ power[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "await_primary '**' factor")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8156,28 +9949,37 @@ power_rule(Parser *p) _res = _Py_BinOp ( a , Pow , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s power[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "await_primary '**' factor")); } { // await_primary if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> power[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "await_primary")); expr_ty await_primary_var; if ( (await_primary_var = await_primary_rule(p)) // await_primary ) { + D(fprintf(stderr, "%*c+ power[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "await_primary")); _res = await_primary_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s power[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "await_primary")); } _res = NULL; done: + D(p->level--); return _res; } @@ -8185,15 +9987,20 @@ power_rule(Parser *p) static expr_ty await_primary_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, await_primary_type, &_res)) + if (_PyPegen_is_memoized(p, await_primary_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8202,8 +10009,10 @@ await_primary_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // AWAIT primary if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> await_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "AWAIT primary")); expr_ty a; Token * await_var; if ( @@ -8212,8 +10021,10 @@ await_primary_rule(Parser *p) (a = primary_rule(p)) // primary ) { + D(fprintf(stderr, "%*c+ await_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "AWAIT primary")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8223,29 +10034,38 @@ await_primary_rule(Parser *p) _res = CHECK_VERSION ( 5 , "Await expressions are" , _Py_Await ( a , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s await_primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "AWAIT primary")); } { // primary if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> await_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary")); expr_ty primary_var; if ( (primary_var = primary_rule(p)) // primary ) { + D(fprintf(stderr, "%*c+ await_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary")); _res = primary_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s await_primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, await_primary_type, _res); + D(p->level--); return _res; } @@ -8260,14 +10080,18 @@ static expr_ty primary_raw(Parser *); static expr_ty primary_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, primary_type, &_res)) + if (_PyPegen_is_memoized(p, primary_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_7 = _PyPegen_update_memo(p, _mark, primary_type, _res); if (tmpvar_7) { + D(p->level--); return _res; } p->mark = _mark; @@ -8278,18 +10102,22 @@ primary_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty primary_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8298,8 +10126,10 @@ primary_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // primary '.' NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary '.' NAME")); Token * _literal; expr_ty a; expr_ty b; @@ -8311,8 +10141,10 @@ primary_raw(Parser *p) (b = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary '.' NAME")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8322,16 +10154,21 @@ primary_raw(Parser *p) _res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary '.' NAME")); } { // primary genexp if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary genexp")); expr_ty a; expr_ty b; if ( @@ -8340,8 +10177,10 @@ primary_raw(Parser *p) (b = genexp_rule(p)) // genexp ) { + D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary genexp")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8351,16 +10190,21 @@ primary_raw(Parser *p) _res = _Py_Call ( a , CHECK ( _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary genexp")); } { // primary '(' arguments? ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary '(' arguments? ')'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -8375,8 +10219,10 @@ primary_raw(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary '(' arguments? ')'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8386,16 +10232,21 @@ primary_raw(Parser *p) _res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary '(' arguments? ')'")); } { // primary '[' slices ']' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "primary '[' slices ']'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -8410,8 +10261,10 @@ primary_raw(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 10)) // token=']' ) { + D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "primary '[' slices ']'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8421,28 +10274,37 @@ primary_raw(Parser *p) _res = _Py_Subscript ( a , b , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "primary '[' slices ']'")); } { // atom if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "atom")); expr_ty atom_var; if ( (atom_var = atom_rule(p)) // atom ) { + D(fprintf(stderr, "%*c+ primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "atom")); _res = atom_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "atom")); } _res = NULL; done: + D(p->level--); return _res; } @@ -8450,13 +10312,16 @@ primary_raw(Parser *p) static expr_ty slices_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8465,8 +10330,10 @@ slices_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // slice !',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slices[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slice !','")); expr_ty a; if ( (a = slice_rule(p)) // slice @@ -8474,19 +10341,25 @@ slices_rule(Parser *p) _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12) // token=',' ) { + D(fprintf(stderr, "%*c+ slices[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slice !','")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slices[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slice !','")); } { // ','.slice+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slices[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.slice+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -8496,8 +10369,10 @@ slices_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ slices[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.slice+ ','?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8507,14 +10382,18 @@ slices_rule(Parser *p) _res = _Py_Tuple ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slices[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.slice+ ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -8522,13 +10401,16 @@ slices_rule(Parser *p) static expr_ty slice_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8537,8 +10419,10 @@ slice_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // expression? ':' expression? [':' expression?] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slice[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression? ':' expression? [':' expression?]")); Token * _literal; void *a; void *b; @@ -8553,8 +10437,10 @@ slice_rule(Parser *p) (c = _tmp_95_rule(p), 1) // [':' expression?] ) { + D(fprintf(stderr, "%*c+ slice[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression? ':' expression? [':' expression?]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8564,32 +10450,42 @@ slice_rule(Parser *p) _res = _Py_Slice ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slice[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression? ':' expression? [':' expression?]")); } { // expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> slice[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression")); expr_ty a; if ( (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ slice[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s slice[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -8608,13 +10504,16 @@ slice_rule(Parser *p) static expr_ty atom_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8623,29 +10522,38 @@ atom_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME")); expr_ty name_var; if ( (name_var = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME")); _res = name_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME")); } { // 'True' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 527)) // token='True' ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8655,23 +10563,30 @@ atom_rule(Parser *p) _res = _Py_Constant ( Py_True , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'True'")); } { // 'False' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 528)) // token='False' ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8681,23 +10596,30 @@ atom_rule(Parser *p) _res = _Py_Constant ( Py_False , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'False'")); } { // 'None' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 529)) // token='None' ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8707,34 +10629,45 @@ atom_rule(Parser *p) _res = _Py_Constant ( Py_None , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'None'")); } { // '__new_parser__' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'__new_parser__'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 530)) // token='__new_parser__' ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'__new_parser__'")); _res = RAISE_SYNTAX_ERROR ( "You found it!" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'__new_parser__'")); } { // &STRING strings if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&STRING strings")); expr_ty strings_var; if ( _PyPegen_lookahead(1, _PyPegen_string_token, p) @@ -8742,29 +10675,39 @@ atom_rule(Parser *p) (strings_var = strings_rule(p)) // strings ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&STRING strings")); _res = strings_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&STRING strings")); } { // NUMBER if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NUMBER")); expr_ty number_var; if ( (number_var = _PyPegen_number_token(p)) // NUMBER ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NUMBER")); _res = number_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NUMBER")); } { // &'(' (tuple | group | genexp) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'(' (tuple | group | genexp)")); void *_tmp_96_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 7) // token='(' @@ -8772,15 +10715,20 @@ atom_rule(Parser *p) (_tmp_96_var = _tmp_96_rule(p)) // tuple | group | genexp ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'(' (tuple | group | genexp)")); _res = _tmp_96_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'(' (tuple | group | genexp)")); } { // &'[' (list | listcomp) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'[' (list | listcomp)")); void *_tmp_97_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 9) // token='[' @@ -8788,15 +10736,20 @@ atom_rule(Parser *p) (_tmp_97_var = _tmp_97_rule(p)) // list | listcomp ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'[' (list | listcomp)")); _res = _tmp_97_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'[' (list | listcomp)")); } { // &'{' (dict | set | dictcomp | setcomp) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "&'{' (dict | set | dictcomp | setcomp)")); void *_tmp_98_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 25) // token='{' @@ -8804,22 +10757,29 @@ atom_rule(Parser *p) (_tmp_98_var = _tmp_98_rule(p)) // dict | set | dictcomp | setcomp ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "&'{' (dict | set | dictcomp | setcomp)")); _res = _tmp_98_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "&'{' (dict | set | dictcomp | setcomp)")); } { // '...' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 52)) // token='...' ) { + D(fprintf(stderr, "%*c+ atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8829,14 +10789,18 @@ atom_rule(Parser *p) _res = _Py_Constant ( Py_Ellipsis , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -8844,34 +10808,45 @@ atom_rule(Parser *p) static expr_ty strings_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, strings_type, &_res)) + if (_PyPegen_is_memoized(p, strings_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; { // STRING+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> strings[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "STRING+")); asdl_seq * a; if ( (a = _loop1_99_rule(p)) // STRING+ ) { + D(fprintf(stderr, "%*c+ strings[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "STRING+")); _res = _PyPegen_concatenate_strings ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s strings[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "STRING+")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, strings_type, _res); + D(p->level--); return _res; } @@ -8879,13 +10854,16 @@ strings_rule(Parser *p) static expr_ty list_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8894,8 +10872,10 @@ list_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '[' star_named_expressions? ']' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> list[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' star_named_expressions? ']'")); Token * _literal; Token * _literal_1; void *a; @@ -8907,8 +10887,10 @@ list_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 10)) // token=']' ) { + D(fprintf(stderr, "%*c+ list[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' star_named_expressions? ']'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8918,14 +10900,18 @@ list_rule(Parser *p) _res = _Py_List ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s list[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' star_named_expressions? ']'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -8933,13 +10919,16 @@ list_rule(Parser *p) static expr_ty listcomp_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -8948,8 +10937,10 @@ listcomp_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '[' named_expression for_if_clauses ']' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> listcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' named_expression for_if_clauses ']'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -8964,8 +10955,10 @@ listcomp_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 10)) // token=']' ) { + D(fprintf(stderr, "%*c+ listcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' named_expression for_if_clauses ']'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -8975,28 +10968,37 @@ listcomp_rule(Parser *p) _res = _Py_ListComp ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s listcomp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' named_expression for_if_clauses ']'")); } { // invalid_comprehension if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> listcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_comprehension")); void *invalid_comprehension_var; if ( (invalid_comprehension_var = invalid_comprehension_rule(p)) // invalid_comprehension ) { + D(fprintf(stderr, "%*c+ listcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_comprehension")); _res = invalid_comprehension_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s listcomp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_comprehension")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9004,13 +11006,16 @@ listcomp_rule(Parser *p) static expr_ty tuple_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9019,8 +11024,10 @@ tuple_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '(' [star_named_expression ',' star_named_expressions?] ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> tuple[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' [star_named_expression ',' star_named_expressions?] ')'")); Token * _literal; Token * _literal_1; void *a; @@ -9032,8 +11039,10 @@ tuple_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ tuple[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' [star_named_expression ',' star_named_expressions?] ')'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9043,14 +11052,18 @@ tuple_rule(Parser *p) _res = _Py_Tuple ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s tuple[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' [star_named_expression ',' star_named_expressions?] ')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9058,15 +11071,19 @@ tuple_rule(Parser *p) static expr_ty group_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; { // '(' (yield_expr | named_expression) ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> group[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' (yield_expr | named_expression) ')'")); Token * _literal; Token * _literal_1; void *a; @@ -9078,17 +11095,22 @@ group_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ group[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' (yield_expr | named_expression) ')'")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s group[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' (yield_expr | named_expression) ')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9096,13 +11118,16 @@ group_rule(Parser *p) static expr_ty genexp_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9111,8 +11136,10 @@ genexp_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '(' expression for_if_clauses ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> genexp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' expression for_if_clauses ')'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -9127,8 +11154,10 @@ genexp_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ genexp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' expression for_if_clauses ')'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9138,28 +11167,37 @@ genexp_rule(Parser *p) _res = _Py_GeneratorExp ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s genexp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' expression for_if_clauses ')'")); } { // invalid_comprehension if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> genexp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_comprehension")); void *invalid_comprehension_var; if ( (invalid_comprehension_var = invalid_comprehension_rule(p)) // invalid_comprehension ) { + D(fprintf(stderr, "%*c+ genexp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_comprehension")); _res = invalid_comprehension_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s genexp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_comprehension")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9167,13 +11205,16 @@ genexp_rule(Parser *p) static expr_ty set_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9182,8 +11223,10 @@ set_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '{' expressions_list '}' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> set[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' expressions_list '}'")); Token * _literal; Token * _literal_1; asdl_seq* a; @@ -9195,8 +11238,10 @@ set_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 26)) // token='}' ) { + D(fprintf(stderr, "%*c+ set[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' expressions_list '}'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9206,14 +11251,18 @@ set_rule(Parser *p) _res = _Py_Set ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s set[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' expressions_list '}'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9221,13 +11270,16 @@ set_rule(Parser *p) static expr_ty setcomp_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9236,8 +11288,10 @@ setcomp_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '{' expression for_if_clauses '}' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> setcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' expression for_if_clauses '}'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -9252,8 +11306,10 @@ setcomp_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 26)) // token='}' ) { + D(fprintf(stderr, "%*c+ setcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' expression for_if_clauses '}'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9263,28 +11319,37 @@ setcomp_rule(Parser *p) _res = _Py_SetComp ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s setcomp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' expression for_if_clauses '}'")); } { // invalid_comprehension if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> setcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_comprehension")); void *invalid_comprehension_var; if ( (invalid_comprehension_var = invalid_comprehension_rule(p)) // invalid_comprehension ) { + D(fprintf(stderr, "%*c+ setcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_comprehension")); _res = invalid_comprehension_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s setcomp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_comprehension")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9292,13 +11357,16 @@ setcomp_rule(Parser *p) static expr_ty dict_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9307,8 +11375,10 @@ dict_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '{' double_starred_kvpairs? '}' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> dict[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' double_starred_kvpairs? '}'")); Token * _literal; Token * _literal_1; void *a; @@ -9320,8 +11390,10 @@ dict_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 26)) // token='}' ) { + D(fprintf(stderr, "%*c+ dict[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' double_starred_kvpairs? '}'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9331,14 +11403,18 @@ dict_rule(Parser *p) _res = _Py_Dict ( CHECK ( _PyPegen_get_keys ( p , a ) ) , CHECK ( _PyPegen_get_values ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s dict[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' double_starred_kvpairs? '}'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9346,13 +11422,16 @@ dict_rule(Parser *p) static expr_ty dictcomp_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9361,8 +11440,10 @@ dictcomp_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '{' kvpair for_if_clauses '}' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> dictcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' kvpair for_if_clauses '}'")); Token * _literal; Token * _literal_1; KeyValuePair* a; @@ -9377,8 +11458,10 @@ dictcomp_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 26)) // token='}' ) { + D(fprintf(stderr, "%*c+ dictcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' kvpair for_if_clauses '}'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9388,28 +11471,37 @@ dictcomp_rule(Parser *p) _res = _Py_DictComp ( a -> key , a -> value , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s dictcomp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' kvpair for_if_clauses '}'")); } { // invalid_dict_comprehension if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> dictcomp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_dict_comprehension")); void *invalid_dict_comprehension_var; if ( (invalid_dict_comprehension_var = invalid_dict_comprehension_rule(p)) // invalid_dict_comprehension ) { + D(fprintf(stderr, "%*c+ dictcomp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_dict_comprehension")); _res = invalid_dict_comprehension_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s dictcomp[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_dict_comprehension")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9417,15 +11509,19 @@ dictcomp_rule(Parser *p) static asdl_seq* double_starred_kvpairs_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.double_starred_kvpair+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> double_starred_kvpairs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.double_starred_kvpair+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -9435,17 +11531,22 @@ double_starred_kvpairs_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ double_starred_kvpairs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.double_starred_kvpair+ ','?")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s double_starred_kvpairs[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.double_starred_kvpair+ ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9453,15 +11554,19 @@ double_starred_kvpairs_rule(Parser *p) static KeyValuePair* double_starred_kvpair_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } KeyValuePair* _res = NULL; int _mark = p->mark; { // '**' bitwise_or if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> double_starred_kvpair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' bitwise_or")); Token * _literal; expr_ty a; if ( @@ -9470,31 +11575,41 @@ double_starred_kvpair_rule(Parser *p) (a = bitwise_or_rule(p)) // bitwise_or ) { + D(fprintf(stderr, "%*c+ double_starred_kvpair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' bitwise_or")); _res = _PyPegen_key_value_pair ( p , NULL , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s double_starred_kvpair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' bitwise_or")); } { // kvpair if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> double_starred_kvpair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kvpair")); KeyValuePair* kvpair_var; if ( (kvpair_var = kvpair_rule(p)) // kvpair ) { + D(fprintf(stderr, "%*c+ double_starred_kvpair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kvpair")); _res = kvpair_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s double_starred_kvpair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kvpair")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9502,15 +11617,19 @@ double_starred_kvpair_rule(Parser *p) static KeyValuePair* kvpair_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } KeyValuePair* _res = NULL; int _mark = p->mark; { // expression ':' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kvpair[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ':' expression")); Token * _literal; expr_ty a; expr_ty b; @@ -9522,17 +11641,22 @@ kvpair_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ kvpair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':' expression")); _res = _PyPegen_key_value_pair ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kvpair[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ':' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9540,27 +11664,35 @@ kvpair_rule(Parser *p) static asdl_seq* for_if_clauses_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // for_if_clause+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> for_if_clauses[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "for_if_clause+")); asdl_seq * _loop1_104_var; if ( (_loop1_104_var = _loop1_104_rule(p)) // for_if_clause+ ) { + D(fprintf(stderr, "%*c+ for_if_clauses[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "for_if_clause+")); _res = _loop1_104_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s for_if_clauses[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "for_if_clause+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9570,15 +11702,19 @@ for_if_clauses_rule(Parser *p) static comprehension_ty for_if_clause_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } comprehension_ty _res = NULL; int _mark = p->mark; { // ASYNC 'for' star_targets 'in' disjunction (('if' disjunction))* if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> for_if_clause[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' disjunction (('if' disjunction))*")); Token * _keyword; Token * _keyword_1; expr_ty a; @@ -9599,19 +11735,25 @@ for_if_clause_rule(Parser *p) (c = _loop0_105_rule(p)) // (('if' disjunction))* ) { + D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' disjunction (('if' disjunction))*")); _res = CHECK_VERSION ( 6 , "Async comprehensions are" , _Py_comprehension ( a , b , c , 1 , p -> arena ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s for_if_clause[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC 'for' star_targets 'in' disjunction (('if' disjunction))*")); } { // 'for' star_targets 'in' disjunction (('if' disjunction))* if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> for_if_clause[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' disjunction (('if' disjunction))*")); Token * _keyword; Token * _keyword_1; expr_ty a; @@ -9629,17 +11771,22 @@ for_if_clause_rule(Parser *p) (c = _loop0_106_rule(p)) // (('if' disjunction))* ) { + D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' disjunction (('if' disjunction))*")); _res = _Py_comprehension ( a , b , c , 0 , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s for_if_clause[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'for' star_targets 'in' disjunction (('if' disjunction))*")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9647,13 +11794,16 @@ for_if_clause_rule(Parser *p) static expr_ty yield_expr_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9662,8 +11812,10 @@ yield_expr_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // 'yield' 'from' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> yield_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'yield' 'from' expression")); Token * _keyword; Token * _keyword_1; expr_ty a; @@ -9675,8 +11827,10 @@ yield_expr_rule(Parser *p) (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ yield_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'yield' 'from' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9686,16 +11840,21 @@ yield_expr_rule(Parser *p) _res = _Py_YieldFrom ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s yield_expr[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'yield' 'from' expression")); } { // 'yield' star_expressions? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> yield_expr[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'yield' star_expressions?")); Token * _keyword; void *a; if ( @@ -9704,8 +11863,10 @@ yield_expr_rule(Parser *p) (a = star_expressions_rule(p), 1) // star_expressions? ) { + D(fprintf(stderr, "%*c+ yield_expr[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'yield' star_expressions?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9715,14 +11876,18 @@ yield_expr_rule(Parser *p) _res = _Py_Yield ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s yield_expr[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'yield' star_expressions?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9730,17 +11895,23 @@ yield_expr_rule(Parser *p) static expr_ty arguments_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, arguments_type, &_res)) + if (_PyPegen_is_memoized(p, arguments_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; { // args ','? &')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ','? &')'")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty a; @@ -9752,32 +11923,42 @@ arguments_rule(Parser *p) _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) // token=')' ) { + D(fprintf(stderr, "%*c+ arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ','? &')'")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s arguments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ','? &')'")); } { // incorrect_arguments if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "incorrect_arguments")); void *incorrect_arguments_var; if ( (incorrect_arguments_var = incorrect_arguments_rule(p)) // incorrect_arguments ) { + D(fprintf(stderr, "%*c+ arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "incorrect_arguments")); _res = incorrect_arguments_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s arguments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "incorrect_arguments")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, arguments_type, _res); + D(p->level--); return _res; } @@ -9785,13 +11966,16 @@ arguments_rule(Parser *p) static expr_ty args_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9800,8 +11984,10 @@ args_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // starred_expression [',' args] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression [',' args]")); expr_ty a; void *b; if ( @@ -9810,8 +11996,10 @@ args_rule(Parser *p) (b = _tmp_107_rule(p), 1) // [',' args] ) { + D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression [',' args]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9821,23 +12009,30 @@ args_rule(Parser *p) _res = _Py_Call ( _PyPegen_dummy_name ( p ) , ( b ) ? CHECK ( _PyPegen_seq_insert_in_front ( p , a , ( ( expr_ty ) b ) -> v . Call . args ) ) : CHECK ( _PyPegen_singleton_seq ( p , a ) ) , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s args[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression [',' args]")); } { // kwargs if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwargs")); asdl_seq* a; if ( (a = kwargs_rule(p)) // kwargs ) { + D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwargs")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9847,16 +12042,21 @@ args_rule(Parser *p) _res = _Py_Call ( _PyPegen_dummy_name ( p ) , CHECK_NULL_ALLOWED ( _PyPegen_seq_extract_starred_exprs ( p , a ) ) , CHECK_NULL_ALLOWED ( _PyPegen_seq_delete_starred_exprs ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s args[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwargs")); } { // named_expression [',' args] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "named_expression [',' args]")); expr_ty a; void *b; if ( @@ -9865,8 +12065,10 @@ args_rule(Parser *p) (b = _tmp_108_rule(p), 1) // [',' args] ) { + D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "named_expression [',' args]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9876,14 +12078,18 @@ args_rule(Parser *p) _res = _Py_Call ( _PyPegen_dummy_name ( p ) , ( b ) ? CHECK ( _PyPegen_seq_insert_in_front ( p , a , ( ( expr_ty ) b ) -> v . Call . args ) ) : CHECK ( _PyPegen_singleton_seq ( p , a ) ) , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s args[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "named_expression [',' args]")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9894,15 +12100,19 @@ args_rule(Parser *p) static asdl_seq* kwargs_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwargs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+")); Token * _literal; asdl_seq * a; asdl_seq * b; @@ -9914,45 +12124,60 @@ kwargs_rule(Parser *p) (b = _gather_111_rule(p)) // ','.kwarg_or_double_starred+ ) { + D(fprintf(stderr, "%*c+ kwargs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+")); _res = _PyPegen_join_sequences ( p , a , b ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwargs[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+")); } { // ','.kwarg_or_starred+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwargs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+")); asdl_seq * _gather_113_var; if ( (_gather_113_var = _gather_113_rule(p)) // ','.kwarg_or_starred+ ) { + D(fprintf(stderr, "%*c+ kwargs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_starred+")); _res = _gather_113_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwargs[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.kwarg_or_starred+")); } { // ','.kwarg_or_double_starred+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwargs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_double_starred+")); asdl_seq * _gather_115_var; if ( (_gather_115_var = _gather_115_rule(p)) // ','.kwarg_or_double_starred+ ) { + D(fprintf(stderr, "%*c+ kwargs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.kwarg_or_double_starred+")); _res = _gather_115_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwargs[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.kwarg_or_double_starred+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -9960,13 +12185,16 @@ kwargs_rule(Parser *p) static expr_ty starred_expression_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -9975,8 +12203,10 @@ starred_expression_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '*' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> starred_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' expression")); Token * _literal; expr_ty a; if ( @@ -9985,8 +12215,10 @@ starred_expression_rule(Parser *p) (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ starred_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -9996,14 +12228,18 @@ starred_expression_rule(Parser *p) _res = _Py_Starred ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s starred_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10011,13 +12247,16 @@ starred_expression_rule(Parser *p) static KeywordOrStarred* kwarg_or_starred_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } KeywordOrStarred* _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10026,8 +12265,10 @@ kwarg_or_starred_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME '=' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwarg_or_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '=' expression")); Token * _literal; expr_ty a; expr_ty b; @@ -10039,8 +12280,10 @@ kwarg_or_starred_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ kwarg_or_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '=' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10050,46 +12293,61 @@ kwarg_or_starred_rule(Parser *p) _res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwarg_or_starred[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME '=' expression")); } { // starred_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwarg_or_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression")); expr_ty a; if ( (a = starred_expression_rule(p)) // starred_expression ) { + D(fprintf(stderr, "%*c+ kwarg_or_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression")); _res = _PyPegen_keyword_or_starred ( p , a , 0 ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwarg_or_starred[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression")); } { // invalid_kwarg if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwarg_or_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_kwarg")); void *invalid_kwarg_var; if ( (invalid_kwarg_var = invalid_kwarg_rule(p)) // invalid_kwarg ) { + D(fprintf(stderr, "%*c+ kwarg_or_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_kwarg")); _res = invalid_kwarg_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwarg_or_starred[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_kwarg")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10097,13 +12355,16 @@ kwarg_or_starred_rule(Parser *p) static KeywordOrStarred* kwarg_or_double_starred_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } KeywordOrStarred* _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10112,8 +12373,10 @@ kwarg_or_double_starred_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME '=' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwarg_or_double_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '=' expression")); Token * _literal; expr_ty a; expr_ty b; @@ -10125,8 +12388,10 @@ kwarg_or_double_starred_rule(Parser *p) (b = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ kwarg_or_double_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '=' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10136,16 +12401,21 @@ kwarg_or_double_starred_rule(Parser *p) _res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwarg_or_double_starred[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME '=' expression")); } { // '**' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwarg_or_double_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**' expression")); Token * _literal; expr_ty a; if ( @@ -10154,8 +12424,10 @@ kwarg_or_double_starred_rule(Parser *p) (a = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ kwarg_or_double_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' expression")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10165,28 +12437,37 @@ kwarg_or_double_starred_rule(Parser *p) _res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( NULL , a , EXTRA ) ) , 1 ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwarg_or_double_starred[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**' expression")); } { // invalid_kwarg if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> kwarg_or_double_starred[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_kwarg")); void *invalid_kwarg_var; if ( (invalid_kwarg_var = invalid_kwarg_rule(p)) // invalid_kwarg ) { + D(fprintf(stderr, "%*c+ kwarg_or_double_starred[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_kwarg")); _res = invalid_kwarg_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s kwarg_or_double_starred[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_kwarg")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10194,13 +12475,16 @@ kwarg_or_double_starred_rule(Parser *p) static expr_ty star_targets_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10209,8 +12493,10 @@ star_targets_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // star_target !',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target !','")); expr_ty a; if ( (a = star_target_rule(p)) // star_target @@ -10218,19 +12504,25 @@ star_targets_rule(Parser *p) _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12) // token=',' ) { + D(fprintf(stderr, "%*c+ star_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target !','")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target !','")); } { // star_target ((',' star_target))* ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target ((',' star_target))* ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty a; @@ -10243,8 +12535,10 @@ star_targets_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ star_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target ((',' star_target))* ','?")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10254,14 +12548,18 @@ star_targets_rule(Parser *p) _res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target ((',' star_target))* ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10269,15 +12567,19 @@ star_targets_rule(Parser *p) static asdl_seq* star_targets_seq_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.star_target+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_targets_seq[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.star_target+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -10287,17 +12589,22 @@ star_targets_seq_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ star_targets_seq[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.star_target+ ','?")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_targets_seq[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.star_target+ ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10309,15 +12616,20 @@ star_targets_seq_rule(Parser *p) static expr_ty star_target_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, star_target_type, &_res)) + if (_PyPegen_is_memoized(p, star_target_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10326,8 +12638,10 @@ star_target_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // '*' (!'*' star_target) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (!'*' star_target)")); Token * _literal; void *a; if ( @@ -10336,8 +12650,10 @@ star_target_rule(Parser *p) (a = _tmp_120_rule(p)) // !'*' star_target ) { + D(fprintf(stderr, "%*c+ star_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (!'*' star_target)")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10347,16 +12663,21 @@ star_target_rule(Parser *p) _res = _Py_Starred ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' (!'*' star_target)")); } { // t_primary '.' NAME !t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead")); Token * _literal; expr_ty a; expr_ty b; @@ -10370,8 +12691,10 @@ star_target_rule(Parser *p) _PyPegen_lookahead(0, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ star_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10381,16 +12704,21 @@ star_target_rule(Parser *p) _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME !t_lookahead")); } { // t_primary '[' slices ']' !t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); Token * _literal; Token * _literal_1; expr_ty a; @@ -10407,8 +12735,10 @@ star_target_rule(Parser *p) _PyPegen_lookahead(0, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ star_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10418,29 +12748,38 @@ star_target_rule(Parser *p) _res = _Py_Subscript ( a , b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); } { // star_atom if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_atom")); expr_ty star_atom_var; if ( (star_atom_var = star_atom_rule(p)) // star_atom ) { + D(fprintf(stderr, "%*c+ star_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_atom")); _res = star_atom_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_atom")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, star_target_type, _res); + D(p->level--); return _res; } @@ -10452,13 +12791,16 @@ star_target_rule(Parser *p) static expr_ty star_atom_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10467,26 +12809,34 @@ star_atom_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME")); expr_ty a; if ( (a = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME")); _res = _PyPegen_set_expr_context ( p , a , Store ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME")); } { // '(' star_target ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' star_target ')'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -10498,19 +12848,25 @@ star_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' star_target ')'")); _res = _PyPegen_set_expr_context ( p , a , Store ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' star_target ')'")); } { // '(' star_targets_seq? ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' star_targets_seq? ')'")); Token * _literal; Token * _literal_1; void *a; @@ -10522,8 +12878,10 @@ star_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' star_targets_seq? ')'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10533,16 +12891,21 @@ star_atom_rule(Parser *p) _res = _Py_Tuple ( a , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' star_targets_seq? ')'")); } { // '[' star_targets_seq? ']' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> star_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' star_targets_seq? ']'")); Token * _literal; Token * _literal_1; void *a; @@ -10554,8 +12917,10 @@ star_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 10)) // token=']' ) { + D(fprintf(stderr, "%*c+ star_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' star_targets_seq? ']'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10565,14 +12930,18 @@ star_atom_rule(Parser *p) _res = _Py_List ( a , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s star_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' star_targets_seq? ']'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10580,47 +12949,62 @@ star_atom_rule(Parser *p) static expr_ty single_target_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; { // single_subscript_attribute_target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> single_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target")); expr_ty single_subscript_attribute_target_var; if ( (single_subscript_attribute_target_var = single_subscript_attribute_target_rule(p)) // single_subscript_attribute_target ) { + D(fprintf(stderr, "%*c+ single_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target")); _res = single_subscript_attribute_target_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s single_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "single_subscript_attribute_target")); } { // NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> single_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME")); expr_ty a; if ( (a = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ single_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME")); _res = _PyPegen_set_expr_context ( p , a , Store ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s single_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME")); } { // '(' single_target ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> single_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -10632,17 +13016,22 @@ single_target_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ single_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s single_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' single_target ')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10652,13 +13041,16 @@ single_target_rule(Parser *p) static expr_ty single_subscript_attribute_target_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10667,8 +13059,10 @@ single_subscript_attribute_target_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // t_primary '.' NAME !t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> single_subscript_attribute_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead")); Token * _literal; expr_ty a; expr_ty b; @@ -10682,8 +13076,10 @@ single_subscript_attribute_target_rule(Parser *p) _PyPegen_lookahead(0, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ single_subscript_attribute_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10693,16 +13089,21 @@ single_subscript_attribute_target_rule(Parser *p) _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s single_subscript_attribute_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME !t_lookahead")); } { // t_primary '[' slices ']' !t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> single_subscript_attribute_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); Token * _literal; Token * _literal_1; expr_ty a; @@ -10719,8 +13120,10 @@ single_subscript_attribute_target_rule(Parser *p) _PyPegen_lookahead(0, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ single_subscript_attribute_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10730,14 +13133,18 @@ single_subscript_attribute_target_rule(Parser *p) _res = _Py_Subscript ( a , b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s single_subscript_attribute_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10745,15 +13152,19 @@ single_subscript_attribute_target_rule(Parser *p) static asdl_seq* del_targets_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.del_target+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.del_target+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -10763,17 +13174,22 @@ del_targets_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ del_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.del_target+ ','?")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.del_target+ ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -10784,15 +13200,20 @@ del_targets_rule(Parser *p) static expr_ty del_target_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, del_target_type, &_res)) + if (_PyPegen_is_memoized(p, del_target_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10801,8 +13222,10 @@ del_target_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // t_primary '.' NAME &del_target_end if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME &del_target_end")); Token * _literal; expr_ty a; expr_ty b; @@ -10816,8 +13239,10 @@ del_target_rule(Parser *p) _PyPegen_lookahead(1, del_target_end_rule, p) ) { + D(fprintf(stderr, "%*c+ del_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME &del_target_end")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10827,16 +13252,21 @@ del_target_rule(Parser *p) _res = _Py_Attribute ( a , b -> v . Name . id , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME &del_target_end")); } { // t_primary '[' slices ']' &del_target_end if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' &del_target_end")); Token * _literal; Token * _literal_1; expr_ty a; @@ -10853,8 +13283,10 @@ del_target_rule(Parser *p) _PyPegen_lookahead(1, del_target_end_rule, p) ) { + D(fprintf(stderr, "%*c+ del_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' &del_target_end")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10864,29 +13296,38 @@ del_target_rule(Parser *p) _res = _Py_Subscript ( a , b , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' &del_target_end")); } { // del_t_atom if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "del_t_atom")); expr_ty del_t_atom_var; if ( (del_t_atom_var = del_t_atom_rule(p)) // del_t_atom ) { + D(fprintf(stderr, "%*c+ del_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "del_t_atom")); _res = del_t_atom_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "del_t_atom")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, del_target_type, _res); + D(p->level--); return _res; } @@ -10899,13 +13340,16 @@ del_target_rule(Parser *p) static expr_ty del_t_atom_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -10914,8 +13358,10 @@ del_t_atom_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME &del_target_end if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME &del_target_end")); expr_ty a; if ( (a = _PyPegen_name_token(p)) // NAME @@ -10923,19 +13369,25 @@ del_t_atom_rule(Parser *p) _PyPegen_lookahead(1, del_target_end_rule, p) ) { + D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME &del_target_end")); _res = _PyPegen_set_expr_context ( p , a , Del ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME &del_target_end")); } { // '(' del_target ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' del_target ')'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -10947,19 +13399,25 @@ del_t_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' del_target ')'")); _res = _PyPegen_set_expr_context ( p , a , Del ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' del_target ')'")); } { // '(' del_targets? ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' del_targets? ')'")); Token * _literal; Token * _literal_1; void *a; @@ -10971,8 +13429,10 @@ del_t_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' del_targets? ')'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -10982,16 +13442,21 @@ del_t_atom_rule(Parser *p) _res = _Py_Tuple ( a , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' del_targets? ')'")); } { // '[' del_targets? ']' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' del_targets? ']'")); Token * _literal; Token * _literal_1; void *a; @@ -11003,8 +13468,10 @@ del_t_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 10)) // token=']' ) { + D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' del_targets? ']'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11014,28 +13481,37 @@ del_t_atom_rule(Parser *p) _res = _Py_List ( a , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' del_targets? ']'")); } { // invalid_del_target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_del_target")); void *invalid_del_target_var; if ( (invalid_del_target_var = invalid_del_target_rule(p)) // invalid_del_target ) { + D(fprintf(stderr, "%*c+ del_t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_del_target")); _res = invalid_del_target_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_del_target")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11043,83 +13519,111 @@ del_t_atom_rule(Parser *p) static void * del_target_end_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target_end[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ del_target_end[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target_end[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'")); } { // ']' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target_end[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "']'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 10)) // token=']' ) { + D(fprintf(stderr, "%*c+ del_target_end[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "']'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target_end[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "']'")); } { // ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target_end[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ del_target_end[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target_end[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','")); } { // ';' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target_end[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 13)) // token=';' ) { + D(fprintf(stderr, "%*c+ del_target_end[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "';'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target_end[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';'")); } { // NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> del_target_end[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE")); Token * newline_var; if ( (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) { + D(fprintf(stderr, "%*c+ del_target_end[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE")); _res = newline_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s del_target_end[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11127,15 +13631,19 @@ del_target_end_rule(Parser *p) static asdl_seq* targets_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq* _res = NULL; int _mark = p->mark; { // ','.target+ ','? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.target+ ','?")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings asdl_seq * a; @@ -11145,17 +13653,22 @@ targets_rule(Parser *p) (_opt_var = _PyPegen_expect_token(p, 12), 1) // ','? ) { + D(fprintf(stderr, "%*c+ targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.target+ ','?")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.target+ ','?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11166,15 +13679,20 @@ targets_rule(Parser *p) static expr_ty target_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, target_type, &_res)) + if (_PyPegen_is_memoized(p, target_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -11183,8 +13701,10 @@ target_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // t_primary '.' NAME !t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead")); Token * _literal; expr_ty a; expr_ty b; @@ -11198,8 +13718,10 @@ target_rule(Parser *p) _PyPegen_lookahead(0, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME !t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11209,16 +13731,21 @@ target_rule(Parser *p) _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME !t_lookahead")); } { // t_primary '[' slices ']' !t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); Token * _literal; Token * _literal_1; expr_ty a; @@ -11235,8 +13762,10 @@ target_rule(Parser *p) _PyPegen_lookahead(0, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11246,29 +13775,38 @@ target_rule(Parser *p) _res = _Py_Subscript ( a , b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' !t_lookahead")); } { // t_atom if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_atom")); expr_ty t_atom_var; if ( (t_atom_var = t_atom_rule(p)) // t_atom ) { + D(fprintf(stderr, "%*c+ target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_atom")); _res = t_atom_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_atom")); } _res = NULL; done: _PyPegen_insert_memo(p, _mark, target_type, _res); + D(p->level--); return _res; } @@ -11283,14 +13821,18 @@ static expr_ty t_primary_raw(Parser *); static expr_ty t_primary_rule(Parser *p) { + D(p->level++); expr_ty _res = NULL; - if (_PyPegen_is_memoized(p, t_primary_type, &_res)) + if (_PyPegen_is_memoized(p, t_primary_type, &_res)) { + D(p->level--); return _res; + } int _mark = p->mark; int _resmark = p->mark; while (1) { int tmpvar_8 = _PyPegen_update_memo(p, _mark, t_primary_type, _res); if (tmpvar_8) { + D(p->level--); return _res; } p->mark = _mark; @@ -11301,18 +13843,22 @@ t_primary_rule(Parser *p) _res = _raw; } p->mark = _resmark; + D(p->level--); return _res; } static expr_ty t_primary_raw(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -11321,8 +13867,10 @@ t_primary_raw(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // t_primary '.' NAME &t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME &t_lookahead")); Token * _literal; expr_ty a; expr_ty b; @@ -11336,8 +13884,10 @@ t_primary_raw(Parser *p) _PyPegen_lookahead(1, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '.' NAME &t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11347,16 +13897,21 @@ t_primary_raw(Parser *p) _res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '.' NAME &t_lookahead")); } { // t_primary '[' slices ']' &t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' &t_lookahead")); Token * _literal; Token * _literal_1; expr_ty a; @@ -11373,8 +13928,10 @@ t_primary_raw(Parser *p) _PyPegen_lookahead(1, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '[' slices ']' &t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11384,16 +13941,21 @@ t_primary_raw(Parser *p) _res = _Py_Subscript ( a , b , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '[' slices ']' &t_lookahead")); } { // t_primary genexp &t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary genexp &t_lookahead")); expr_ty a; expr_ty b; if ( @@ -11404,8 +13966,10 @@ t_primary_raw(Parser *p) _PyPegen_lookahead(1, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary genexp &t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11415,16 +13979,21 @@ t_primary_raw(Parser *p) _res = _Py_Call ( a , CHECK ( _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary genexp &t_lookahead")); } { // t_primary '(' arguments? ')' &t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "t_primary '(' arguments? ')' &t_lookahead")); Token * _literal; Token * _literal_1; expr_ty a; @@ -11441,8 +14010,10 @@ t_primary_raw(Parser *p) _PyPegen_lookahead(1, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "t_primary '(' arguments? ')' &t_lookahead")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11452,16 +14023,21 @@ t_primary_raw(Parser *p) _res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "t_primary '(' arguments? ')' &t_lookahead")); } { // atom &t_lookahead if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_primary[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "atom &t_lookahead")); expr_ty a; if ( (a = atom_rule(p)) // atom @@ -11469,17 +14045,22 @@ t_primary_raw(Parser *p) _PyPegen_lookahead(1, t_lookahead_rule, p) ) { + D(fprintf(stderr, "%*c+ t_primary[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "atom &t_lookahead")); _res = a; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_primary[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "atom &t_lookahead")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11487,55 +14068,73 @@ t_primary_raw(Parser *p) static void * t_lookahead_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '(' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_lookahead[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 7)) // token='(' ) { + D(fprintf(stderr, "%*c+ t_lookahead[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_lookahead[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'('")); } { // '[' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_lookahead[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 9)) // token='[' ) { + D(fprintf(stderr, "%*c+ t_lookahead[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_lookahead[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['")); } { // '.' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_lookahead[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 23)) // token='.' ) { + D(fprintf(stderr, "%*c+ t_lookahead[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_lookahead[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11543,13 +14142,16 @@ t_lookahead_rule(Parser *p) static expr_ty t_atom_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } expr_ty _res = NULL; int _mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; + D(p->level--); return NULL; } int _start_lineno = p->tokens[_mark]->lineno; @@ -11558,26 +14160,34 @@ t_atom_rule(Parser *p) UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME")); expr_ty a; if ( (a = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME")); _res = _PyPegen_set_expr_context ( p , a , Store ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME")); } { // '(' target ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' target ')'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -11589,19 +14199,25 @@ t_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' target ')'")); _res = _PyPegen_set_expr_context ( p , a , Store ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' target ')'")); } { // '(' targets? ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' targets? ')'")); Token * _literal; Token * _literal_1; void *b; @@ -11613,8 +14229,10 @@ t_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' targets? ')'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11624,16 +14242,21 @@ t_atom_rule(Parser *p) _res = _Py_Tuple ( b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' targets? ')'")); } { // '[' targets? ']' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> t_atom[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'[' targets? ']'")); Token * _literal; Token * _literal_1; void *b; @@ -11645,8 +14268,10 @@ t_atom_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 10)) // token=']' ) { + D(fprintf(stderr, "%*c+ t_atom[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'[' targets? ']'")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { + D(p->level--); return NULL; } int _end_lineno = _token->end_lineno; @@ -11656,14 +14281,18 @@ t_atom_rule(Parser *p) _res = _Py_List ( b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s t_atom[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'[' targets? ']'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11676,15 +14305,19 @@ t_atom_rule(Parser *p) static void * incorrect_arguments_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // args ',' '*' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> incorrect_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ',' '*'")); Token * _literal; Token * _literal_1; expr_ty args_var; @@ -11696,19 +14329,25 @@ incorrect_arguments_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 16)) // token='*' ) { + D(fprintf(stderr, "%*c+ incorrect_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ',' '*'")); _res = RAISE_SYNTAX_ERROR ( "iterable argument unpacking follows keyword argument unpacking" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s incorrect_arguments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ',' '*'")); } { // expression for_if_clauses ',' [args | expression for_if_clauses] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> incorrect_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses ',' [args | expression for_if_clauses]")); Token * _literal; void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings @@ -11724,19 +14363,25 @@ incorrect_arguments_rule(Parser *p) (_opt_var = _tmp_125_rule(p), 1) // [args | expression for_if_clauses] ) { + D(fprintf(stderr, "%*c+ incorrect_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses ',' [args | expression for_if_clauses]")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "Generator expression must be parenthesized" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s incorrect_arguments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression for_if_clauses ',' [args | expression for_if_clauses]")); } { // args for_if_clauses if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> incorrect_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args for_if_clauses")); expr_ty a; asdl_seq* for_if_clauses_var; if ( @@ -11745,19 +14390,25 @@ incorrect_arguments_rule(Parser *p) (for_if_clauses_var = for_if_clauses_rule(p)) // for_if_clauses ) { + D(fprintf(stderr, "%*c+ incorrect_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args for_if_clauses")); _res = _PyPegen_nonparen_genexp_in_call ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s incorrect_arguments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args for_if_clauses")); } { // args ',' expression for_if_clauses if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> incorrect_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ',' expression for_if_clauses")); Token * _literal; expr_ty a; expr_ty args_var; @@ -11772,19 +14423,25 @@ incorrect_arguments_rule(Parser *p) (for_if_clauses_var = for_if_clauses_rule(p)) // for_if_clauses ) { + D(fprintf(stderr, "%*c+ incorrect_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ',' expression for_if_clauses")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "Generator expression must be parenthesized" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s incorrect_arguments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ',' expression for_if_clauses")); } { // args ',' args if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> incorrect_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ',' args")); Token * _literal; expr_ty a; expr_ty args_var; @@ -11796,17 +14453,22 @@ incorrect_arguments_rule(Parser *p) (args_var = args_rule(p)) // args ) { + D(fprintf(stderr, "%*c+ incorrect_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ',' args")); _res = _PyPegen_arguments_parsing_error ( p , a ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s incorrect_arguments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ',' args")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11814,15 +14476,19 @@ incorrect_arguments_rule(Parser *p) static void * invalid_kwarg_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // expression '=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_kwarg[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression '='")); Token * _literal; expr_ty a; if ( @@ -11831,17 +14497,22 @@ invalid_kwarg_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 22)) // token='=' ) { + D(fprintf(stderr, "%*c+ invalid_kwarg[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression '='")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "expression cannot contain assignment, perhaps you meant \"==\"?" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_kwarg[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression '='")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11849,15 +14520,19 @@ invalid_kwarg_rule(Parser *p) static void * invalid_named_expression_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // expression ':=' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ':=' expression")); Token * _literal; expr_ty a; expr_ty expression_var; @@ -11869,17 +14544,22 @@ invalid_named_expression_rule(Parser *p) (expression_var = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ invalid_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':=' expression")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "cannot use assignment expressions with %s" , _PyPegen_get_expr_name ( a ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ':=' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -11893,15 +14573,19 @@ invalid_named_expression_rule(Parser *p) static void * invalid_assignment_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // list ':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "list ':'")); Token * _literal; expr_ty a; if ( @@ -11910,19 +14594,25 @@ invalid_assignment_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { + D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "list ':'")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "only single target (not list) can be annotated" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "list ':'")); } { // tuple ':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "tuple ':'")); Token * _literal; expr_ty a; if ( @@ -11931,19 +14621,25 @@ invalid_assignment_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { + D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "tuple ':'")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "only single target (not tuple) can be annotated" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "tuple ':'")); } { // star_named_expression ',' star_named_expressions* ':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions* ':'")); Token * _literal; Token * _literal_1; asdl_seq * _loop0_126_var; @@ -11958,19 +14654,25 @@ invalid_assignment_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 11)) // token=':' ) { + D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions* ':'")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "only single target (not tuple) can be annotated" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expression ',' star_named_expressions* ':'")); } { // expression ':' expression ['=' annotated_rhs] if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ':' expression ['=' annotated_rhs]")); Token * _literal; void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings @@ -11986,19 +14688,25 @@ invalid_assignment_rule(Parser *p) (_opt_var = _tmp_127_rule(p), 1) // ['=' annotated_rhs] ) { + D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':' expression ['=' annotated_rhs]")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "illegal target for annotation" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ':' expression ['=' annotated_rhs]")); } { // star_expressions '=' (yield_expr | star_expressions) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions '=' (yield_expr | star_expressions)")); Token * _literal; void *_tmp_128_var; expr_ty a; @@ -12010,19 +14718,25 @@ invalid_assignment_rule(Parser *p) (_tmp_128_var = _tmp_128_rule(p)) // yield_expr | star_expressions ) { + D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions '=' (yield_expr | star_expressions)")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( _PyPegen_get_invalid_target ( a ) , "cannot assign to %s" , _PyPegen_get_expr_name ( _PyPegen_get_invalid_target ( a ) ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions '=' (yield_expr | star_expressions)")); } { // star_expressions augassign (yield_expr | star_expressions) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)")); void *_tmp_129_var; expr_ty a; AugOperator* augassign_var; @@ -12034,17 +14748,22 @@ invalid_assignment_rule(Parser *p) (_tmp_129_var = _tmp_129_rule(p)) // yield_expr | star_expressions ) { + D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "'%s' is an illegal expression for augmented assignment" , _PyPegen_get_expr_name ( a ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_assignment[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12052,15 +14771,19 @@ invalid_assignment_rule(Parser *p) static void * invalid_block_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // NEWLINE !INDENT if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_block[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE !INDENT")); Token * newline_var; if ( (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' @@ -12068,17 +14791,22 @@ invalid_block_rule(Parser *p) _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, INDENT) // token=INDENT ) { + D(fprintf(stderr, "%*c+ invalid_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE !INDENT")); _res = RAISE_INDENTATION_ERROR ( "expected an indented block" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_block[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE !INDENT")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12086,15 +14814,19 @@ invalid_block_rule(Parser *p) static void * invalid_comprehension_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ('[' | '(' | '{') starred_expression for_if_clauses if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses")); void *_tmp_130_var; expr_ty a; asdl_seq* for_if_clauses_var; @@ -12106,17 +14838,22 @@ invalid_comprehension_rule(Parser *p) (for_if_clauses_var = for_if_clauses_rule(p)) // for_if_clauses ) { + D(fprintf(stderr, "%*c+ invalid_comprehension[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "iterable unpacking cannot be used in comprehension" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_comprehension[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12124,15 +14861,19 @@ invalid_comprehension_rule(Parser *p) static void * invalid_dict_comprehension_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '{' '**' bitwise_or for_if_clauses '}' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_dict_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{' '**' bitwise_or for_if_clauses '}'")); Token * _literal; Token * _literal_1; Token * a; @@ -12150,17 +14891,22 @@ invalid_dict_comprehension_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 26)) // token='}' ) { + D(fprintf(stderr, "%*c+ invalid_dict_comprehension[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{' '**' bitwise_or for_if_clauses '}'")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "dict unpacking cannot be used in dict comprehension" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_dict_comprehension[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{' '**' bitwise_or for_if_clauses '}'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12169,15 +14915,19 @@ invalid_dict_comprehension_rule(Parser *p) static void * invalid_parameters_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // param_no_default* (slash_with_default | param_with_default+) param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* (slash_with_default | param_with_default+) param_no_default")); asdl_seq * _loop0_131_var; void *_tmp_132_var; arg_ty param_no_default_var; @@ -12189,17 +14939,22 @@ invalid_parameters_rule(Parser *p) (param_no_default_var = param_no_default_rule(p)) // param_no_default ) { + D(fprintf(stderr, "%*c+ invalid_parameters[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default* (slash_with_default | param_with_default+) param_no_default")); _res = RAISE_SYNTAX_ERROR ( "non-default argument follows default argument" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_parameters[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default* (slash_with_default | param_with_default+) param_no_default")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12207,15 +14962,19 @@ invalid_parameters_rule(Parser *p) static void * invalid_star_etc_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '*' (')' | ',' (')' | '**')) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))")); Token * _literal; void *_tmp_133_var; if ( @@ -12224,19 +14983,25 @@ invalid_star_etc_rule(Parser *p) (_tmp_133_var = _tmp_133_rule(p)) // ')' | ',' (')' | '**') ) { + D(fprintf(stderr, "%*c+ invalid_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))")); _res = RAISE_SYNTAX_ERROR ( "named arguments must follow bare *" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' (')' | ',' (')' | '**'))")); } { // '*' ',' TYPE_COMMENT if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' ',' TYPE_COMMENT")); Token * _literal; Token * _literal_1; Token * type_comment_var; @@ -12248,17 +15013,22 @@ invalid_star_etc_rule(Parser *p) (type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT)) // token='TYPE_COMMENT' ) { + D(fprintf(stderr, "%*c+ invalid_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' ',' TYPE_COMMENT")); _res = RAISE_SYNTAX_ERROR ( "bare * has associated type comment" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' ',' TYPE_COMMENT")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12266,15 +15036,19 @@ invalid_star_etc_rule(Parser *p) static void * invalid_lambda_star_etc_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '*' (':' | ',' (':' | '**')) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))")); Token * _literal; void *_tmp_134_var; if ( @@ -12283,17 +15057,22 @@ invalid_lambda_star_etc_rule(Parser *p) (_tmp_134_var = _tmp_134_rule(p)) // ':' | ',' (':' | '**') ) { + D(fprintf(stderr, "%*c+ invalid_lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))")); _res = RAISE_SYNTAX_ERROR ( "named arguments must follow bare *" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_lambda_star_etc[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*' (':' | ',' (':' | '**'))")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12301,15 +15080,19 @@ invalid_lambda_star_etc_rule(Parser *p) static void * invalid_double_type_comments_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_double_type_comments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT")); Token * indent_var; Token * newline_var; Token * newline_var_1; @@ -12327,17 +15110,22 @@ invalid_double_type_comments_rule(Parser *p) (indent_var = _PyPegen_expect_token(p, INDENT)) // token='INDENT' ) { + D(fprintf(stderr, "%*c+ invalid_double_type_comments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT")); _res = RAISE_SYNTAX_ERROR ( "Cannot have two type comments on def" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_double_type_comments[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12345,15 +15133,19 @@ invalid_double_type_comments_rule(Parser *p) static void * invalid_del_target_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // star_expression &del_target_end if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_del_target[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression &del_target_end")); expr_ty a; if ( (a = star_expression_rule(p)) // star_expression @@ -12361,17 +15153,22 @@ invalid_del_target_rule(Parser *p) _PyPegen_lookahead(1, del_target_end_rule, p) ) { + D(fprintf(stderr, "%*c+ invalid_del_target[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression &del_target_end")); _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "cannot delete %s" , _PyPegen_get_expr_name ( a ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_del_target[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression &del_target_end")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12379,15 +15176,19 @@ invalid_del_target_rule(Parser *p) static void * invalid_import_from_targets_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // import_from_as_names ',' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> invalid_import_from_targets[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_names ','")); Token * _literal; asdl_seq* import_from_as_names_var; if ( @@ -12396,17 +15197,22 @@ invalid_import_from_targets_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 12)) // token=',' ) { + D(fprintf(stderr, "%*c+ invalid_import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from_as_names ','")); _res = RAISE_SYNTAX_ERROR ( "trailing comma not allowed without surrounding parentheses" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_import_from_targets[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from_as_names ','")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12414,7 +15220,9 @@ invalid_import_from_targets_rule(Parser *p) static asdl_seq * _loop0_1_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12424,14 +15232,17 @@ _loop0_1_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_1[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE")); Token * newline_var; while ( (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' @@ -12444,6 +15255,7 @@ _loop0_1_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -12452,17 +15264,21 @@ _loop0_1_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_1[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_1_type, _seq); + D(p->level--); return _seq; } @@ -12470,7 +15286,9 @@ _loop0_1_rule(Parser *p) static asdl_seq * _loop0_2_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12480,14 +15298,17 @@ _loop0_2_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_2[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE")); Token * newline_var; while ( (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' @@ -12500,6 +15321,7 @@ _loop0_2_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -12508,17 +15330,21 @@ _loop0_2_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_2[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_2_type, _seq); + D(p->level--); return _seq; } @@ -12526,7 +15352,9 @@ _loop0_2_rule(Parser *p) static asdl_seq * _loop0_4_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12536,14 +15364,17 @@ _loop0_4_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_4[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); Token * _literal; expr_ty elem; while ( @@ -12556,6 +15387,7 @@ _loop0_4_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -12564,6 +15396,7 @@ _loop0_4_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -12572,17 +15405,21 @@ _loop0_4_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_4[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_4_type, _seq); + D(p->level--); return _seq; } @@ -12590,15 +15427,19 @@ _loop0_4_rule(Parser *p) static asdl_seq * _gather_3_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // expression _loop0_4 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_3[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_4")); expr_ty elem; asdl_seq * seq; if ( @@ -12607,13 +15448,17 @@ _gather_3_rule(Parser *p) (seq = _loop0_4_rule(p)) // _loop0_4 ) { + D(fprintf(stderr, "%*c+ _gather_3[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_4")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_3[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_4")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12621,7 +15466,9 @@ _gather_3_rule(Parser *p) static asdl_seq * _loop0_6_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12631,14 +15478,17 @@ _loop0_6_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_6[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); Token * _literal; expr_ty elem; while ( @@ -12651,6 +15501,7 @@ _loop0_6_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -12659,6 +15510,7 @@ _loop0_6_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -12667,17 +15519,21 @@ _loop0_6_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_6[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_6_type, _seq); + D(p->level--); return _seq; } @@ -12685,15 +15541,19 @@ _loop0_6_rule(Parser *p) static asdl_seq * _gather_5_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // expression _loop0_6 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_5[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_6")); expr_ty elem; asdl_seq * seq; if ( @@ -12702,13 +15562,17 @@ _gather_5_rule(Parser *p) (seq = _loop0_6_rule(p)) // _loop0_6 ) { + D(fprintf(stderr, "%*c+ _gather_5[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_6")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_5[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_6")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12716,7 +15580,9 @@ _gather_5_rule(Parser *p) static asdl_seq * _loop0_8_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12726,14 +15592,17 @@ _loop0_8_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_8[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); Token * _literal; expr_ty elem; while ( @@ -12746,6 +15615,7 @@ _loop0_8_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -12754,6 +15624,7 @@ _loop0_8_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -12762,17 +15633,21 @@ _loop0_8_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_8[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_8_type, _seq); + D(p->level--); return _seq; } @@ -12780,15 +15655,19 @@ _loop0_8_rule(Parser *p) static asdl_seq * _gather_7_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // expression _loop0_8 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_7[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_8")); expr_ty elem; asdl_seq * seq; if ( @@ -12797,13 +15676,17 @@ _gather_7_rule(Parser *p) (seq = _loop0_8_rule(p)) // _loop0_8 ) { + D(fprintf(stderr, "%*c+ _gather_7[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_8")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_7[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_8")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12811,7 +15694,9 @@ _gather_7_rule(Parser *p) static asdl_seq * _loop0_10_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12821,14 +15706,17 @@ _loop0_10_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_10[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); Token * _literal; expr_ty elem; while ( @@ -12841,6 +15729,7 @@ _loop0_10_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -12849,6 +15738,7 @@ _loop0_10_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -12857,17 +15747,21 @@ _loop0_10_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_10[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_10_type, _seq); + D(p->level--); return _seq; } @@ -12875,15 +15769,19 @@ _loop0_10_rule(Parser *p) static asdl_seq * _gather_9_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // expression _loop0_10 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_9[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression _loop0_10")); expr_ty elem; asdl_seq * seq; if ( @@ -12892,13 +15790,17 @@ _gather_9_rule(Parser *p) (seq = _loop0_10_rule(p)) // _loop0_10 ) { + D(fprintf(stderr, "%*c+ _gather_9[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression _loop0_10")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_9[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression _loop0_10")); } _res = NULL; done: + D(p->level--); return _res; } @@ -12906,7 +15808,9 @@ _gather_9_rule(Parser *p) static asdl_seq * _loop1_11_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12916,14 +15820,17 @@ _loop1_11_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // statement if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_11[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "statement")); asdl_seq* statement_var; while ( (statement_var = statement_rule(p)) // statement @@ -12936,6 +15843,7 @@ _loop1_11_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -12944,9 +15852,12 @@ _loop1_11_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_11[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "statement")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -12954,11 +15865,13 @@ _loop1_11_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_11_type, _seq); + D(p->level--); return _seq; } @@ -12966,7 +15879,9 @@ _loop1_11_rule(Parser *p) static asdl_seq * _loop0_13_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -12976,14 +15891,17 @@ _loop0_13_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ';' small_stmt if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_13[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "';' small_stmt")); Token * _literal; stmt_ty elem; while ( @@ -12996,6 +15914,7 @@ _loop0_13_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -13004,6 +15923,7 @@ _loop0_13_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -13012,17 +15932,21 @@ _loop0_13_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_13[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "';' small_stmt")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_13_type, _seq); + D(p->level--); return _seq; } @@ -13030,15 +15954,19 @@ _loop0_13_rule(Parser *p) static asdl_seq * _gather_12_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // small_stmt _loop0_13 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_12[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "small_stmt _loop0_13")); stmt_ty elem; asdl_seq * seq; if ( @@ -13047,13 +15975,17 @@ _gather_12_rule(Parser *p) (seq = _loop0_13_rule(p)) // _loop0_13 ) { + D(fprintf(stderr, "%*c+ _gather_12[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "small_stmt _loop0_13")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_12[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "small_stmt _loop0_13")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13061,41 +15993,54 @@ _gather_12_rule(Parser *p) static void * _tmp_14_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'import' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_14[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'import'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 513)) // token='import' ) { + D(fprintf(stderr, "%*c+ _tmp_14[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'import'")); _res = _keyword; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_14[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'import'")); } { // 'from' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_14[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 514)) // token='from' ) { + D(fprintf(stderr, "%*c+ _tmp_14[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from'")); _res = _keyword; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_14[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13103,55 +16048,73 @@ _tmp_14_rule(Parser *p) static void * _tmp_15_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'def' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_15[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'def'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 522)) // token='def' ) { + D(fprintf(stderr, "%*c+ _tmp_15[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'def'")); _res = _keyword; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_15[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'def'")); } { // '@' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_15[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 49)) // token='@' ) { + D(fprintf(stderr, "%*c+ _tmp_15[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_15[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@'")); } { // ASYNC if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_15[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC")); Token * async_var; if ( (async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC' ) { + D(fprintf(stderr, "%*c+ _tmp_15[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC")); _res = async_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_15[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13159,41 +16122,54 @@ _tmp_15_rule(Parser *p) static void * _tmp_16_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'class' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_16[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'class'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 523)) // token='class' ) { + D(fprintf(stderr, "%*c+ _tmp_16[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'class'")); _res = _keyword; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_16[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'class'")); } { // '@' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_16[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 49)) // token='@' ) { + D(fprintf(stderr, "%*c+ _tmp_16[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_16[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13201,41 +16177,54 @@ _tmp_16_rule(Parser *p) static void * _tmp_17_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'with' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_17[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'with'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 519)) // token='with' ) { + D(fprintf(stderr, "%*c+ _tmp_17[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'with'")); _res = _keyword; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_17[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'with'")); } { // ASYNC if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_17[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC")); Token * async_var; if ( (async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC' ) { + D(fprintf(stderr, "%*c+ _tmp_17[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC")); _res = async_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_17[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13243,41 +16232,54 @@ _tmp_17_rule(Parser *p) static void * _tmp_18_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'for' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_18[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'for'")); Token * _keyword; if ( (_keyword = _PyPegen_expect_token(p, 517)) // token='for' ) { + D(fprintf(stderr, "%*c+ _tmp_18[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for'")); _res = _keyword; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_18[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'for'")); } { // ASYNC if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_18[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC")); Token * async_var; if ( (async_var = _PyPegen_expect_token(p, ASYNC)) // token='ASYNC' ) { + D(fprintf(stderr, "%*c+ _tmp_18[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC")); _res = async_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_18[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "ASYNC")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13285,15 +16287,19 @@ _tmp_18_rule(Parser *p) static void * _tmp_19_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '=' annotated_rhs if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_19[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs")); Token * _literal; expr_ty d; if ( @@ -13302,17 +16308,22 @@ _tmp_19_rule(Parser *p) (d = annotated_rhs_rule(p)) // annotated_rhs ) { + D(fprintf(stderr, "%*c+ _tmp_19[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs")); _res = d; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_19[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'=' annotated_rhs")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13320,15 +16331,19 @@ _tmp_19_rule(Parser *p) static void * _tmp_20_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '(' single_target ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_20[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'")); Token * _literal; Token * _literal_1; expr_ty b; @@ -13340,31 +16355,41 @@ _tmp_20_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ _tmp_20[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' single_target ')'")); _res = b; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_20[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' single_target ')'")); } { // single_subscript_attribute_target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_20[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target")); expr_ty single_subscript_attribute_target_var; if ( (single_subscript_attribute_target_var = single_subscript_attribute_target_rule(p)) // single_subscript_attribute_target ) { + D(fprintf(stderr, "%*c+ _tmp_20[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "single_subscript_attribute_target")); _res = single_subscript_attribute_target_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_20[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "single_subscript_attribute_target")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13372,15 +16397,19 @@ _tmp_20_rule(Parser *p) static void * _tmp_21_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '=' annotated_rhs if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_21[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs")); Token * _literal; expr_ty d; if ( @@ -13389,17 +16418,22 @@ _tmp_21_rule(Parser *p) (d = annotated_rhs_rule(p)) // annotated_rhs ) { + D(fprintf(stderr, "%*c+ _tmp_21[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs")); _res = d; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_21[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'=' annotated_rhs")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13407,7 +16441,9 @@ _tmp_21_rule(Parser *p) static asdl_seq * _loop1_22_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -13417,14 +16453,17 @@ _loop1_22_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // (star_targets '=') if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_22[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')")); void *_tmp_135_var; while ( (_tmp_135_var = _tmp_135_rule(p)) // star_targets '=' @@ -13437,6 +16476,7 @@ _loop1_22_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -13445,9 +16485,12 @@ _loop1_22_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_22[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -13455,11 +16498,13 @@ _loop1_22_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_22_type, _seq); + D(p->level--); return _seq; } @@ -13467,41 +16512,54 @@ _loop1_22_rule(Parser *p) static void * _tmp_23_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // yield_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_23[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { + D(fprintf(stderr, "%*c+ _tmp_23[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); _res = yield_expr_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_23[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } { // star_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_23[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { + D(fprintf(stderr, "%*c+ _tmp_23[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); _res = star_expressions_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_23[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13509,41 +16567,54 @@ _tmp_23_rule(Parser *p) static void * _tmp_24_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // yield_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_24[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { + D(fprintf(stderr, "%*c+ _tmp_24[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); _res = yield_expr_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_24[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } { // star_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_24[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { + D(fprintf(stderr, "%*c+ _tmp_24[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); _res = star_expressions_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_24[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13551,7 +16622,9 @@ _tmp_24_rule(Parser *p) static asdl_seq * _loop0_26_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -13561,14 +16634,17 @@ _loop0_26_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_26[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' NAME")); Token * _literal; expr_ty elem; while ( @@ -13581,6 +16657,7 @@ _loop0_26_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -13589,6 +16666,7 @@ _loop0_26_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -13597,17 +16675,21 @@ _loop0_26_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_26[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' NAME")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_26_type, _seq); + D(p->level--); return _seq; } @@ -13615,15 +16697,19 @@ _loop0_26_rule(Parser *p) static asdl_seq * _gather_25_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // NAME _loop0_26 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_25[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME _loop0_26")); expr_ty elem; asdl_seq * seq; if ( @@ -13632,13 +16718,17 @@ _gather_25_rule(Parser *p) (seq = _loop0_26_rule(p)) // _loop0_26 ) { + D(fprintf(stderr, "%*c+ _gather_25[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME _loop0_26")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_25[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME _loop0_26")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13646,7 +16736,9 @@ _gather_25_rule(Parser *p) static asdl_seq * _loop0_28_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -13656,14 +16748,17 @@ _loop0_28_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_28[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' NAME")); Token * _literal; expr_ty elem; while ( @@ -13676,6 +16771,7 @@ _loop0_28_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -13684,6 +16780,7 @@ _loop0_28_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -13692,17 +16789,21 @@ _loop0_28_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_28[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' NAME")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_28_type, _seq); + D(p->level--); return _seq; } @@ -13710,15 +16811,19 @@ _loop0_28_rule(Parser *p) static asdl_seq * _gather_27_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // NAME _loop0_28 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_27[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME _loop0_28")); expr_ty elem; asdl_seq * seq; if ( @@ -13727,13 +16832,17 @@ _gather_27_rule(Parser *p) (seq = _loop0_28_rule(p)) // _loop0_28 ) { + D(fprintf(stderr, "%*c+ _gather_27[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME _loop0_28")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_27[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME _loop0_28")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13741,15 +16850,19 @@ _gather_27_rule(Parser *p) static void * _tmp_29_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ',' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_29[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); Token * _literal; expr_ty z; if ( @@ -13758,17 +16871,22 @@ _tmp_29_rule(Parser *p) (z = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ _tmp_29[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_29[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13776,7 +16894,9 @@ _tmp_29_rule(Parser *p) static asdl_seq * _loop0_30_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -13786,14 +16906,17 @@ _loop0_30_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ('.' | '...') if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_30[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')")); void *_tmp_136_var; while ( (_tmp_136_var = _tmp_136_rule(p)) // '.' | '...' @@ -13806,6 +16929,7 @@ _loop0_30_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -13814,17 +16938,21 @@ _loop0_30_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_30[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('.' | '...')")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_30_type, _seq); + D(p->level--); return _seq; } @@ -13832,7 +16960,9 @@ _loop0_30_rule(Parser *p) static asdl_seq * _loop1_31_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -13842,14 +16972,17 @@ _loop1_31_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ('.' | '...') if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_31[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')")); void *_tmp_137_var; while ( (_tmp_137_var = _tmp_137_rule(p)) // '.' | '...' @@ -13862,6 +16995,7 @@ _loop1_31_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -13870,9 +17004,12 @@ _loop1_31_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_31[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('.' | '...')")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -13880,11 +17017,13 @@ _loop1_31_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_31_type, _seq); + D(p->level--); return _seq; } @@ -13892,7 +17031,9 @@ _loop1_31_rule(Parser *p) static asdl_seq * _loop0_33_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -13902,14 +17043,17 @@ _loop0_33_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' import_from_as_name if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_33[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' import_from_as_name")); Token * _literal; alias_ty elem; while ( @@ -13922,6 +17066,7 @@ _loop0_33_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -13930,6 +17075,7 @@ _loop0_33_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -13938,17 +17084,21 @@ _loop0_33_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_33[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' import_from_as_name")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_33_type, _seq); + D(p->level--); return _seq; } @@ -13956,15 +17106,19 @@ _loop0_33_rule(Parser *p) static asdl_seq * _gather_32_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // import_from_as_name _loop0_33 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_32[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "import_from_as_name _loop0_33")); alias_ty elem; asdl_seq * seq; if ( @@ -13973,13 +17127,17 @@ _gather_32_rule(Parser *p) (seq = _loop0_33_rule(p)) // _loop0_33 ) { + D(fprintf(stderr, "%*c+ _gather_32[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "import_from_as_name _loop0_33")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_32[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "import_from_as_name _loop0_33")); } _res = NULL; done: + D(p->level--); return _res; } @@ -13987,15 +17145,19 @@ _gather_32_rule(Parser *p) static void * _tmp_34_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'as' NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_34[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME")); Token * _keyword; expr_ty z; if ( @@ -14004,17 +17166,22 @@ _tmp_34_rule(Parser *p) (z = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ _tmp_34[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_34[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14022,7 +17189,9 @@ _tmp_34_rule(Parser *p) static asdl_seq * _loop0_36_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14032,14 +17201,17 @@ _loop0_36_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' dotted_as_name if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_36[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' dotted_as_name")); Token * _literal; alias_ty elem; while ( @@ -14052,6 +17224,7 @@ _loop0_36_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -14060,6 +17233,7 @@ _loop0_36_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14068,17 +17242,21 @@ _loop0_36_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_36[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' dotted_as_name")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_36_type, _seq); + D(p->level--); return _seq; } @@ -14086,15 +17264,19 @@ _loop0_36_rule(Parser *p) static asdl_seq * _gather_35_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // dotted_as_name _loop0_36 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_35[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dotted_as_name _loop0_36")); alias_ty elem; asdl_seq * seq; if ( @@ -14103,13 +17285,17 @@ _gather_35_rule(Parser *p) (seq = _loop0_36_rule(p)) // _loop0_36 ) { + D(fprintf(stderr, "%*c+ _gather_35[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dotted_as_name _loop0_36")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_35[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dotted_as_name _loop0_36")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14117,15 +17303,19 @@ _gather_35_rule(Parser *p) static void * _tmp_37_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'as' NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_37[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME")); Token * _keyword; expr_ty z; if ( @@ -14134,17 +17324,22 @@ _tmp_37_rule(Parser *p) (z = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ _tmp_37[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_37[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14152,7 +17347,9 @@ _tmp_37_rule(Parser *p) static asdl_seq * _loop0_39_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14162,14 +17359,17 @@ _loop0_39_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_39[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item")); Token * _literal; withitem_ty elem; while ( @@ -14182,6 +17382,7 @@ _loop0_39_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -14190,6 +17391,7 @@ _loop0_39_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14198,17 +17400,21 @@ _loop0_39_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_39[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_39_type, _seq); + D(p->level--); return _seq; } @@ -14216,15 +17422,19 @@ _loop0_39_rule(Parser *p) static asdl_seq * _gather_38_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // with_item _loop0_39 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_38[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_39")); withitem_ty elem; asdl_seq * seq; if ( @@ -14233,13 +17443,17 @@ _gather_38_rule(Parser *p) (seq = _loop0_39_rule(p)) // _loop0_39 ) { + D(fprintf(stderr, "%*c+ _gather_38[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_39")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_38[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_39")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14247,7 +17461,9 @@ _gather_38_rule(Parser *p) static asdl_seq * _loop0_41_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14257,14 +17473,17 @@ _loop0_41_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_41[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item")); Token * _literal; withitem_ty elem; while ( @@ -14277,6 +17496,7 @@ _loop0_41_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -14285,6 +17505,7 @@ _loop0_41_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14293,17 +17514,21 @@ _loop0_41_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_41[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_41_type, _seq); + D(p->level--); return _seq; } @@ -14311,15 +17536,19 @@ _loop0_41_rule(Parser *p) static asdl_seq * _gather_40_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // with_item _loop0_41 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_40[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_41")); withitem_ty elem; asdl_seq * seq; if ( @@ -14328,13 +17557,17 @@ _gather_40_rule(Parser *p) (seq = _loop0_41_rule(p)) // _loop0_41 ) { + D(fprintf(stderr, "%*c+ _gather_40[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_41")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_40[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_41")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14342,7 +17575,9 @@ _gather_40_rule(Parser *p) static asdl_seq * _loop0_43_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14352,14 +17587,17 @@ _loop0_43_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_43[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item")); Token * _literal; withitem_ty elem; while ( @@ -14372,6 +17610,7 @@ _loop0_43_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -14380,6 +17619,7 @@ _loop0_43_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14388,17 +17628,21 @@ _loop0_43_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_43[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_43_type, _seq); + D(p->level--); return _seq; } @@ -14406,15 +17650,19 @@ _loop0_43_rule(Parser *p) static asdl_seq * _gather_42_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // with_item _loop0_43 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_42[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_43")); withitem_ty elem; asdl_seq * seq; if ( @@ -14423,13 +17671,17 @@ _gather_42_rule(Parser *p) (seq = _loop0_43_rule(p)) // _loop0_43 ) { + D(fprintf(stderr, "%*c+ _gather_42[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_43")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_42[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_43")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14437,7 +17689,9 @@ _gather_42_rule(Parser *p) static asdl_seq * _loop0_45_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14447,14 +17701,17 @@ _loop0_45_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' with_item if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_45[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' with_item")); Token * _literal; withitem_ty elem; while ( @@ -14467,6 +17724,7 @@ _loop0_45_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -14475,6 +17733,7 @@ _loop0_45_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14483,17 +17742,21 @@ _loop0_45_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_45[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' with_item")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_45_type, _seq); + D(p->level--); return _seq; } @@ -14501,15 +17764,19 @@ _loop0_45_rule(Parser *p) static asdl_seq * _gather_44_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // with_item _loop0_45 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_44[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "with_item _loop0_45")); withitem_ty elem; asdl_seq * seq; if ( @@ -14518,13 +17785,17 @@ _gather_44_rule(Parser *p) (seq = _loop0_45_rule(p)) // _loop0_45 ) { + D(fprintf(stderr, "%*c+ _gather_44[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "with_item _loop0_45")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_44[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "with_item _loop0_45")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14532,15 +17803,19 @@ _gather_44_rule(Parser *p) static void * _tmp_46_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'as' target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_46[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' target")); Token * _keyword; expr_ty t; if ( @@ -14549,17 +17824,22 @@ _tmp_46_rule(Parser *p) (t = target_rule(p)) // target ) { + D(fprintf(stderr, "%*c+ _tmp_46[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' target")); _res = t; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_46[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' target")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14567,7 +17847,9 @@ _tmp_46_rule(Parser *p) static asdl_seq * _loop1_47_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14577,14 +17859,17 @@ _loop1_47_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // except_block if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_47[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "except_block")); excepthandler_ty except_block_var; while ( (except_block_var = except_block_rule(p)) // except_block @@ -14597,6 +17882,7 @@ _loop1_47_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14605,9 +17891,12 @@ _loop1_47_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_47[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "except_block")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -14615,11 +17904,13 @@ _loop1_47_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_47_type, _seq); + D(p->level--); return _seq; } @@ -14627,15 +17918,19 @@ _loop1_47_rule(Parser *p) static void * _tmp_48_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'as' NAME if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_48[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME")); Token * _keyword; expr_ty z; if ( @@ -14644,17 +17939,22 @@ _tmp_48_rule(Parser *p) (z = _PyPegen_name_token(p)) // NAME ) { + D(fprintf(stderr, "%*c+ _tmp_48[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_48[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14662,15 +17962,19 @@ _tmp_48_rule(Parser *p) static void * _tmp_49_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'from' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_49[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'from' expression")); Token * _keyword; expr_ty z; if ( @@ -14679,17 +17983,22 @@ _tmp_49_rule(Parser *p) (z = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ _tmp_49[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'from' expression")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_49[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'from' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14697,15 +18006,19 @@ _tmp_49_rule(Parser *p) static void * _tmp_50_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '->' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_50[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'->' expression")); Token * _literal; expr_ty z; if ( @@ -14714,17 +18027,22 @@ _tmp_50_rule(Parser *p) (z = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ _tmp_50[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'->' expression")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_50[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'->' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14732,15 +18050,19 @@ _tmp_50_rule(Parser *p) static void * _tmp_51_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '->' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_51[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'->' expression")); Token * _literal; expr_ty z; if ( @@ -14749,17 +18071,22 @@ _tmp_51_rule(Parser *p) (z = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ _tmp_51[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'->' expression")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_51[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'->' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14767,15 +18094,19 @@ _tmp_51_rule(Parser *p) static void * _tmp_52_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // NEWLINE INDENT if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_52[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT")); Token * indent_var; Token * newline_var; if ( @@ -14784,13 +18115,17 @@ _tmp_52_rule(Parser *p) (indent_var = _PyPegen_expect_token(p, INDENT)) // token='INDENT' ) { + D(fprintf(stderr, "%*c+ _tmp_52[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE INDENT")); _res = _PyPegen_dummy_name(p, newline_var, indent_var); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_52[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE INDENT")); } _res = NULL; done: + D(p->level--); return _res; } @@ -14798,7 +18133,9 @@ _tmp_52_rule(Parser *p) static asdl_seq * _loop0_53_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14808,14 +18145,17 @@ _loop0_53_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_53[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -14828,6 +18168,7 @@ _loop0_53_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14836,17 +18177,21 @@ _loop0_53_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_53[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_53_type, _seq); + D(p->level--); return _seq; } @@ -14854,7 +18199,9 @@ _loop0_53_rule(Parser *p) static asdl_seq * _loop0_54_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14864,14 +18211,17 @@ _loop0_54_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_54[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -14884,6 +18234,7 @@ _loop0_54_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14892,17 +18243,21 @@ _loop0_54_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_54[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_54_type, _seq); + D(p->level--); return _seq; } @@ -14910,7 +18265,9 @@ _loop0_54_rule(Parser *p) static asdl_seq * _loop0_55_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14920,14 +18277,17 @@ _loop0_55_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_55[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -14940,6 +18300,7 @@ _loop0_55_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -14948,17 +18309,21 @@ _loop0_55_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_55[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_55_type, _seq); + D(p->level--); return _seq; } @@ -14966,7 +18331,9 @@ _loop0_55_rule(Parser *p) static asdl_seq * _loop1_56_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -14976,14 +18343,17 @@ _loop1_56_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_56[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -14996,6 +18366,7 @@ _loop1_56_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15004,9 +18375,12 @@ _loop1_56_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_56[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15014,11 +18388,13 @@ _loop1_56_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_56_type, _seq); + D(p->level--); return _seq; } @@ -15026,7 +18402,9 @@ _loop1_56_rule(Parser *p) static asdl_seq * _loop0_57_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15036,14 +18414,17 @@ _loop0_57_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_57[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -15056,6 +18437,7 @@ _loop0_57_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15064,17 +18446,21 @@ _loop0_57_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_57[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_57_type, _seq); + D(p->level--); return _seq; } @@ -15082,7 +18468,9 @@ _loop0_57_rule(Parser *p) static asdl_seq * _loop1_58_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15092,14 +18480,17 @@ _loop1_58_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_58[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -15112,6 +18503,7 @@ _loop1_58_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15120,9 +18512,12 @@ _loop1_58_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_58[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15130,11 +18525,13 @@ _loop1_58_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_58_type, _seq); + D(p->level--); return _seq; } @@ -15142,7 +18539,9 @@ _loop1_58_rule(Parser *p) static asdl_seq * _loop1_59_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15152,14 +18551,17 @@ _loop1_59_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_59[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -15172,6 +18574,7 @@ _loop1_59_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15180,9 +18583,12 @@ _loop1_59_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_59[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15190,11 +18596,13 @@ _loop1_59_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_59_type, _seq); + D(p->level--); return _seq; } @@ -15202,7 +18610,9 @@ _loop1_59_rule(Parser *p) static asdl_seq * _loop1_60_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15212,14 +18622,17 @@ _loop1_60_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_60[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -15232,6 +18645,7 @@ _loop1_60_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15240,9 +18654,12 @@ _loop1_60_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_60[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15250,11 +18667,13 @@ _loop1_60_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_60_type, _seq); + D(p->level--); return _seq; } @@ -15262,7 +18681,9 @@ _loop1_60_rule(Parser *p) static asdl_seq * _loop0_61_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15272,14 +18693,17 @@ _loop0_61_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_61[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -15292,6 +18716,7 @@ _loop0_61_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15300,17 +18725,21 @@ _loop0_61_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_61[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_61_type, _seq); + D(p->level--); return _seq; } @@ -15318,7 +18747,9 @@ _loop0_61_rule(Parser *p) static asdl_seq * _loop1_62_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15328,14 +18759,17 @@ _loop1_62_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_62[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -15348,6 +18782,7 @@ _loop1_62_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15356,9 +18791,12 @@ _loop1_62_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_62[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15366,11 +18804,13 @@ _loop1_62_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_62_type, _seq); + D(p->level--); return _seq; } @@ -15378,7 +18818,9 @@ _loop1_62_rule(Parser *p) static asdl_seq * _loop0_63_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15388,14 +18830,17 @@ _loop0_63_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_63[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -15408,6 +18853,7 @@ _loop0_63_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15416,17 +18862,21 @@ _loop0_63_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_63[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_63_type, _seq); + D(p->level--); return _seq; } @@ -15434,7 +18884,9 @@ _loop0_63_rule(Parser *p) static asdl_seq * _loop1_64_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15444,14 +18896,17 @@ _loop1_64_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_64[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -15464,6 +18919,7 @@ _loop1_64_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15472,9 +18928,12 @@ _loop1_64_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_64[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15482,11 +18941,13 @@ _loop1_64_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_64_type, _seq); + D(p->level--); return _seq; } @@ -15494,7 +18955,9 @@ _loop1_64_rule(Parser *p) static asdl_seq * _loop0_65_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15504,14 +18967,17 @@ _loop0_65_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_maybe_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_65[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default")); NameDefaultPair* param_maybe_default_var; while ( (param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default @@ -15524,6 +18990,7 @@ _loop0_65_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15532,17 +18999,21 @@ _loop0_65_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_65[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_65_type, _seq); + D(p->level--); return _seq; } @@ -15550,7 +19021,9 @@ _loop0_65_rule(Parser *p) static asdl_seq * _loop1_66_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15560,14 +19033,17 @@ _loop1_66_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_maybe_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_66[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default")); NameDefaultPair* param_maybe_default_var; while ( (param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default @@ -15580,6 +19056,7 @@ _loop1_66_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15588,9 +19065,12 @@ _loop1_66_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_66[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15598,11 +19078,13 @@ _loop1_66_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_66_type, _seq); + D(p->level--); return _seq; } @@ -15610,7 +19092,9 @@ _loop1_66_rule(Parser *p) static asdl_seq * _loop1_67_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15620,14 +19104,17 @@ _loop1_67_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ('@' named_expression NEWLINE) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_67[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('@' named_expression NEWLINE)")); void *_tmp_138_var; while ( (_tmp_138_var = _tmp_138_rule(p)) // '@' named_expression NEWLINE @@ -15640,6 +19127,7 @@ _loop1_67_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15648,9 +19136,12 @@ _loop1_67_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_67[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('@' named_expression NEWLINE)")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15658,11 +19149,13 @@ _loop1_67_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_67_type, _seq); + D(p->level--); return _seq; } @@ -15670,15 +19163,19 @@ _loop1_67_rule(Parser *p) static void * _tmp_68_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '(' arguments? ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_68[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'")); Token * _literal; Token * _literal_1; void *z; @@ -15690,17 +19187,22 @@ _tmp_68_rule(Parser *p) (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ _tmp_68[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_68[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' arguments? ')'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -15708,7 +19210,9 @@ _tmp_68_rule(Parser *p) static asdl_seq * _loop0_70_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15718,14 +19222,17 @@ _loop0_70_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' star_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_70[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_expression")); Token * _literal; expr_ty elem; while ( @@ -15738,6 +19245,7 @@ _loop0_70_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -15746,6 +19254,7 @@ _loop0_70_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15754,17 +19263,21 @@ _loop0_70_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_70[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_expression")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_70_type, _seq); + D(p->level--); return _seq; } @@ -15772,15 +19285,19 @@ _loop0_70_rule(Parser *p) static asdl_seq * _gather_69_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // star_expression _loop0_70 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_69[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expression _loop0_70")); expr_ty elem; asdl_seq * seq; if ( @@ -15789,13 +19306,17 @@ _gather_69_rule(Parser *p) (seq = _loop0_70_rule(p)) // _loop0_70 ) { + D(fprintf(stderr, "%*c+ _gather_69[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expression _loop0_70")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_69[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expression _loop0_70")); } _res = NULL; done: + D(p->level--); return _res; } @@ -15803,7 +19324,9 @@ _gather_69_rule(Parser *p) static asdl_seq * _loop1_71_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15813,14 +19336,17 @@ _loop1_71_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // (',' star_expression) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_71[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_expression)")); void *_tmp_139_var; while ( (_tmp_139_var = _tmp_139_rule(p)) // ',' star_expression @@ -15833,6 +19359,7 @@ _loop1_71_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15841,9 +19368,12 @@ _loop1_71_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_71[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' star_expression)")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -15851,11 +19381,13 @@ _loop1_71_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_71_type, _seq); + D(p->level--); return _seq; } @@ -15863,7 +19395,9 @@ _loop1_71_rule(Parser *p) static asdl_seq * _loop0_73_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15873,14 +19407,17 @@ _loop0_73_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' star_named_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_73[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_named_expression")); Token * _literal; expr_ty elem; while ( @@ -15893,6 +19430,7 @@ _loop0_73_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -15901,6 +19439,7 @@ _loop0_73_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15909,17 +19448,21 @@ _loop0_73_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_73[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_named_expression")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_73_type, _seq); + D(p->level--); return _seq; } @@ -15927,15 +19470,19 @@ _loop0_73_rule(Parser *p) static asdl_seq * _gather_72_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // star_named_expression _loop0_73 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_72[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression _loop0_73")); expr_ty elem; asdl_seq * seq; if ( @@ -15944,13 +19491,17 @@ _gather_72_rule(Parser *p) (seq = _loop0_73_rule(p)) // _loop0_73 ) { + D(fprintf(stderr, "%*c+ _gather_72[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_named_expression _loop0_73")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_72[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expression _loop0_73")); } _res = NULL; done: + D(p->level--); return _res; } @@ -15958,7 +19509,9 @@ _gather_72_rule(Parser *p) static asdl_seq * _loop1_74_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -15968,14 +19521,17 @@ _loop1_74_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // (',' expression) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_74[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' expression)")); void *_tmp_140_var; while ( (_tmp_140_var = _tmp_140_rule(p)) // ',' expression @@ -15988,6 +19544,7 @@ _loop1_74_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -15996,9 +19553,12 @@ _loop1_74_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_74[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' expression)")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16006,11 +19566,13 @@ _loop1_74_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_74_type, _seq); + D(p->level--); return _seq; } @@ -16018,7 +19580,9 @@ _loop1_74_rule(Parser *p) static asdl_seq * _loop0_75_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16028,14 +19592,17 @@ _loop0_75_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_75[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); arg_ty lambda_param_no_default_var; while ( (lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default @@ -16048,6 +19615,7 @@ _loop0_75_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16056,17 +19624,21 @@ _loop0_75_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_75[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_75_type, _seq); + D(p->level--); return _seq; } @@ -16074,7 +19646,9 @@ _loop0_75_rule(Parser *p) static asdl_seq * _loop0_76_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16084,14 +19658,17 @@ _loop0_76_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_76[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); NameDefaultPair* lambda_param_with_default_var; while ( (lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default @@ -16104,6 +19681,7 @@ _loop0_76_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16112,17 +19690,21 @@ _loop0_76_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_76[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_76_type, _seq); + D(p->level--); return _seq; } @@ -16130,7 +19712,9 @@ _loop0_76_rule(Parser *p) static asdl_seq * _loop0_77_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16140,14 +19724,17 @@ _loop0_77_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_77[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); NameDefaultPair* lambda_param_with_default_var; while ( (lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default @@ -16160,6 +19747,7 @@ _loop0_77_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16168,17 +19756,21 @@ _loop0_77_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_77[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_77_type, _seq); + D(p->level--); return _seq; } @@ -16186,7 +19778,9 @@ _loop0_77_rule(Parser *p) static asdl_seq * _loop1_78_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16196,14 +19790,17 @@ _loop1_78_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_78[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); arg_ty lambda_param_no_default_var; while ( (lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default @@ -16216,6 +19813,7 @@ _loop1_78_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16224,9 +19822,12 @@ _loop1_78_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_78[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16234,11 +19835,13 @@ _loop1_78_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_78_type, _seq); + D(p->level--); return _seq; } @@ -16246,7 +19849,9 @@ _loop1_78_rule(Parser *p) static asdl_seq * _loop0_79_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16256,14 +19861,17 @@ _loop0_79_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_79[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); NameDefaultPair* lambda_param_with_default_var; while ( (lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default @@ -16276,6 +19884,7 @@ _loop0_79_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16284,17 +19893,21 @@ _loop0_79_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_79[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_79_type, _seq); + D(p->level--); return _seq; } @@ -16302,7 +19915,9 @@ _loop0_79_rule(Parser *p) static asdl_seq * _loop1_80_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16312,14 +19927,17 @@ _loop1_80_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_80[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); NameDefaultPair* lambda_param_with_default_var; while ( (lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default @@ -16332,6 +19950,7 @@ _loop1_80_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16340,9 +19959,12 @@ _loop1_80_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_80[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16350,11 +19972,13 @@ _loop1_80_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_80_type, _seq); + D(p->level--); return _seq; } @@ -16362,7 +19986,9 @@ _loop1_80_rule(Parser *p) static asdl_seq * _loop1_81_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16372,14 +19998,17 @@ _loop1_81_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_81[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); arg_ty lambda_param_no_default_var; while ( (lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default @@ -16392,6 +20021,7 @@ _loop1_81_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16400,9 +20030,12 @@ _loop1_81_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_81[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16410,11 +20043,13 @@ _loop1_81_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_81_type, _seq); + D(p->level--); return _seq; } @@ -16422,7 +20057,9 @@ _loop1_81_rule(Parser *p) static asdl_seq * _loop1_82_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16432,14 +20069,17 @@ _loop1_82_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_82[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); arg_ty lambda_param_no_default_var; while ( (lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default @@ -16452,6 +20092,7 @@ _loop1_82_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16460,9 +20101,12 @@ _loop1_82_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_82[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16470,11 +20114,13 @@ _loop1_82_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_82_type, _seq); + D(p->level--); return _seq; } @@ -16482,7 +20128,9 @@ _loop1_82_rule(Parser *p) static asdl_seq * _loop0_83_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16492,14 +20140,17 @@ _loop0_83_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_83[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); arg_ty lambda_param_no_default_var; while ( (lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default @@ -16512,6 +20163,7 @@ _loop0_83_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16520,17 +20172,21 @@ _loop0_83_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_83[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_83_type, _seq); + D(p->level--); return _seq; } @@ -16538,7 +20194,9 @@ _loop0_83_rule(Parser *p) static asdl_seq * _loop1_84_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16548,14 +20206,17 @@ _loop1_84_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_84[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); NameDefaultPair* lambda_param_with_default_var; while ( (lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default @@ -16568,6 +20229,7 @@ _loop1_84_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16576,9 +20238,12 @@ _loop1_84_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_84[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16586,11 +20251,13 @@ _loop1_84_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_84_type, _seq); + D(p->level--); return _seq; } @@ -16598,7 +20265,9 @@ _loop1_84_rule(Parser *p) static asdl_seq * _loop0_85_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16608,14 +20277,17 @@ _loop0_85_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_85[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); arg_ty lambda_param_no_default_var; while ( (lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default @@ -16628,6 +20300,7 @@ _loop0_85_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16636,17 +20309,21 @@ _loop0_85_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_85[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_85_type, _seq); + D(p->level--); return _seq; } @@ -16654,7 +20331,9 @@ _loop0_85_rule(Parser *p) static asdl_seq * _loop1_86_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16664,14 +20343,17 @@ _loop1_86_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_86[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); NameDefaultPair* lambda_param_with_default_var; while ( (lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default @@ -16684,6 +20366,7 @@ _loop1_86_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16692,9 +20375,12 @@ _loop1_86_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_86[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16702,11 +20388,13 @@ _loop1_86_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_86_type, _seq); + D(p->level--); return _seq; } @@ -16714,7 +20402,9 @@ _loop1_86_rule(Parser *p) static asdl_seq * _loop0_87_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16724,14 +20414,17 @@ _loop0_87_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_maybe_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_87[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default")); NameDefaultPair* lambda_param_maybe_default_var; while ( (lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default @@ -16744,6 +20437,7 @@ _loop0_87_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16752,17 +20446,21 @@ _loop0_87_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_87[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_87_type, _seq); + D(p->level--); return _seq; } @@ -16770,7 +20468,9 @@ _loop0_87_rule(Parser *p) static asdl_seq * _loop1_88_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16780,14 +20480,17 @@ _loop1_88_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // lambda_param_maybe_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_88[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default")); NameDefaultPair* lambda_param_maybe_default_var; while ( (lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default @@ -16800,6 +20503,7 @@ _loop1_88_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16808,9 +20512,12 @@ _loop1_88_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_88[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16818,11 +20525,13 @@ _loop1_88_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_88_type, _seq); + D(p->level--); return _seq; } @@ -16830,7 +20539,9 @@ _loop1_88_rule(Parser *p) static asdl_seq * _loop1_89_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16840,14 +20551,17 @@ _loop1_89_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ('or' conjunction) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_89[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('or' conjunction)")); void *_tmp_141_var; while ( (_tmp_141_var = _tmp_141_rule(p)) // 'or' conjunction @@ -16860,6 +20574,7 @@ _loop1_89_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16868,9 +20583,12 @@ _loop1_89_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_89[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('or' conjunction)")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16878,11 +20596,13 @@ _loop1_89_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_89_type, _seq); + D(p->level--); return _seq; } @@ -16890,7 +20610,9 @@ _loop1_89_rule(Parser *p) static asdl_seq * _loop1_90_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16900,14 +20622,17 @@ _loop1_90_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ('and' inversion) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_90[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('and' inversion)")); void *_tmp_142_var; while ( (_tmp_142_var = _tmp_142_rule(p)) // 'and' inversion @@ -16920,6 +20645,7 @@ _loop1_90_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16928,9 +20654,12 @@ _loop1_90_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_90[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('and' inversion)")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16938,11 +20667,13 @@ _loop1_90_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_90_type, _seq); + D(p->level--); return _seq; } @@ -16950,7 +20681,9 @@ _loop1_90_rule(Parser *p) static asdl_seq * _loop1_91_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -16960,14 +20693,17 @@ _loop1_91_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // compare_op_bitwise_or_pair if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_91[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "compare_op_bitwise_or_pair")); 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 @@ -16980,6 +20716,7 @@ _loop1_91_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -16988,9 +20725,12 @@ _loop1_91_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_91[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "compare_op_bitwise_or_pair")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -16998,11 +20738,13 @@ _loop1_91_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_91_type, _seq); + D(p->level--); return _seq; } @@ -17010,31 +20752,40 @@ _loop1_91_rule(Parser *p) static void * _tmp_92_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '!=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_92[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'!='")); Token * tok; if ( (tok = _PyPegen_expect_token(p, 28)) // token='!=' ) { + D(fprintf(stderr, "%*c+ _tmp_92[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'!='")); _res = _PyPegen_check_barry_as_flufl ( p ) ? NULL : tok; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_92[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'!='")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17042,7 +20793,9 @@ _tmp_92_rule(Parser *p) static asdl_seq * _loop0_94_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17052,14 +20805,17 @@ _loop0_94_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' slice if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_94[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' slice")); Token * _literal; expr_ty elem; while ( @@ -17072,6 +20828,7 @@ _loop0_94_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -17080,6 +20837,7 @@ _loop0_94_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17088,17 +20846,21 @@ _loop0_94_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_94[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' slice")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_94_type, _seq); + D(p->level--); return _seq; } @@ -17106,15 +20868,19 @@ _loop0_94_rule(Parser *p) static asdl_seq * _gather_93_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // slice _loop0_94 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_93[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slice _loop0_94")); expr_ty elem; asdl_seq * seq; if ( @@ -17123,13 +20889,17 @@ _gather_93_rule(Parser *p) (seq = _loop0_94_rule(p)) // _loop0_94 ) { + D(fprintf(stderr, "%*c+ _gather_93[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slice _loop0_94")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_93[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slice _loop0_94")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17137,15 +20907,19 @@ _gather_93_rule(Parser *p) static void * _tmp_95_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ':' expression? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_95[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':' expression?")); Token * _literal; void *d; if ( @@ -17154,17 +20928,22 @@ _tmp_95_rule(Parser *p) (d = expression_rule(p), 1) // expression? ) { + D(fprintf(stderr, "%*c+ _tmp_95[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':' expression?")); _res = d; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_95[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':' expression?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17172,55 +20951,73 @@ _tmp_95_rule(Parser *p) static void * _tmp_96_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // tuple if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_96[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "tuple")); expr_ty tuple_var; if ( (tuple_var = tuple_rule(p)) // tuple ) { + D(fprintf(stderr, "%*c+ _tmp_96[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "tuple")); _res = tuple_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_96[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "tuple")); } { // group if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_96[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "group")); expr_ty group_var; if ( (group_var = group_rule(p)) // group ) { + D(fprintf(stderr, "%*c+ _tmp_96[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "group")); _res = group_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_96[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "group")); } { // genexp if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_96[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "genexp")); expr_ty genexp_var; if ( (genexp_var = genexp_rule(p)) // genexp ) { + D(fprintf(stderr, "%*c+ _tmp_96[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "genexp")); _res = genexp_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_96[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "genexp")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17228,41 +21025,54 @@ _tmp_96_rule(Parser *p) static void * _tmp_97_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // list if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_97[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "list")); expr_ty list_var; if ( (list_var = list_rule(p)) // list ) { + D(fprintf(stderr, "%*c+ _tmp_97[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "list")); _res = list_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_97[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "list")); } { // listcomp if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_97[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "listcomp")); expr_ty listcomp_var; if ( (listcomp_var = listcomp_rule(p)) // listcomp ) { + D(fprintf(stderr, "%*c+ _tmp_97[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "listcomp")); _res = listcomp_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_97[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "listcomp")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17270,69 +21080,92 @@ _tmp_97_rule(Parser *p) static void * _tmp_98_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // dict if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_98[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dict")); expr_ty dict_var; if ( (dict_var = dict_rule(p)) // dict ) { + D(fprintf(stderr, "%*c+ _tmp_98[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dict")); _res = dict_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_98[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dict")); } { // set if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_98[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "set")); expr_ty set_var; if ( (set_var = set_rule(p)) // set ) { + D(fprintf(stderr, "%*c+ _tmp_98[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "set")); _res = set_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_98[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "set")); } { // dictcomp if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_98[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "dictcomp")); expr_ty dictcomp_var; if ( (dictcomp_var = dictcomp_rule(p)) // dictcomp ) { + D(fprintf(stderr, "%*c+ _tmp_98[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dictcomp")); _res = dictcomp_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_98[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "dictcomp")); } { // setcomp if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_98[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "setcomp")); expr_ty setcomp_var; if ( (setcomp_var = setcomp_rule(p)) // setcomp ) { + D(fprintf(stderr, "%*c+ _tmp_98[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "setcomp")); _res = setcomp_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_98[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "setcomp")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17340,7 +21173,9 @@ _tmp_98_rule(Parser *p) static asdl_seq * _loop1_99_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17350,14 +21185,17 @@ _loop1_99_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // STRING if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_99[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "STRING")); expr_ty string_var; while ( (string_var = _PyPegen_string_token(p)) // STRING @@ -17370,6 +21208,7 @@ _loop1_99_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17378,9 +21217,12 @@ _loop1_99_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_99[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "STRING")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -17388,11 +21230,13 @@ _loop1_99_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_99_type, _seq); + D(p->level--); return _seq; } @@ -17400,15 +21244,19 @@ _loop1_99_rule(Parser *p) static void * _tmp_100_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // star_named_expression ',' star_named_expressions? if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_100[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions?")); Token * _literal; expr_ty y; void *z; @@ -17420,17 +21268,22 @@ _tmp_100_rule(Parser *p) (z = star_named_expressions_rule(p), 1) // star_named_expressions? ) { + D(fprintf(stderr, "%*c+ _tmp_100[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions?")); _res = _PyPegen_seq_insert_in_front ( p , y , z ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_100[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expression ',' star_named_expressions?")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17438,41 +21291,54 @@ _tmp_100_rule(Parser *p) static void * _tmp_101_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // yield_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_101[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { + D(fprintf(stderr, "%*c+ _tmp_101[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); _res = yield_expr_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_101[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } { // named_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_101[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "named_expression")); expr_ty named_expression_var; if ( (named_expression_var = named_expression_rule(p)) // named_expression ) { + D(fprintf(stderr, "%*c+ _tmp_101[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "named_expression")); _res = named_expression_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_101[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "named_expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17480,7 +21346,9 @@ _tmp_101_rule(Parser *p) static asdl_seq * _loop0_103_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17490,14 +21358,17 @@ _loop0_103_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' double_starred_kvpair if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_103[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' double_starred_kvpair")); Token * _literal; KeyValuePair* elem; while ( @@ -17510,6 +21381,7 @@ _loop0_103_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -17518,6 +21390,7 @@ _loop0_103_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17526,17 +21399,21 @@ _loop0_103_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_103[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' double_starred_kvpair")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_103_type, _seq); + D(p->level--); return _seq; } @@ -17544,15 +21421,19 @@ _loop0_103_rule(Parser *p) static asdl_seq * _gather_102_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // double_starred_kvpair _loop0_103 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_102[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_103")); KeyValuePair* elem; asdl_seq * seq; if ( @@ -17561,13 +21442,17 @@ _gather_102_rule(Parser *p) (seq = _loop0_103_rule(p)) // _loop0_103 ) { + D(fprintf(stderr, "%*c+ _gather_102[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_103")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_102[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "double_starred_kvpair _loop0_103")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17575,7 +21460,9 @@ _gather_102_rule(Parser *p) static asdl_seq * _loop1_104_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17585,14 +21472,17 @@ _loop1_104_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // for_if_clause if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_104[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "for_if_clause")); comprehension_ty for_if_clause_var; while ( (for_if_clause_var = for_if_clause_rule(p)) // for_if_clause @@ -17605,6 +21495,7 @@ _loop1_104_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17613,9 +21504,12 @@ _loop1_104_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_104[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "for_if_clause")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -17623,11 +21517,13 @@ _loop1_104_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_104_type, _seq); + D(p->level--); return _seq; } @@ -17635,7 +21531,9 @@ _loop1_104_rule(Parser *p) static asdl_seq * _loop0_105_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17645,14 +21543,17 @@ _loop0_105_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ('if' disjunction) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_105[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)")); void *_tmp_143_var; while ( (_tmp_143_var = _tmp_143_rule(p)) // 'if' disjunction @@ -17665,6 +21566,7 @@ _loop0_105_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17673,17 +21575,21 @@ _loop0_105_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_105[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('if' disjunction)")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_105_type, _seq); + D(p->level--); return _seq; } @@ -17691,7 +21597,9 @@ _loop0_105_rule(Parser *p) static asdl_seq * _loop0_106_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17701,14 +21609,17 @@ _loop0_106_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ('if' disjunction) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_106[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)")); void *_tmp_144_var; while ( (_tmp_144_var = _tmp_144_rule(p)) // 'if' disjunction @@ -17721,6 +21632,7 @@ _loop0_106_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17729,17 +21641,21 @@ _loop0_106_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_106[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "('if' disjunction)")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_106_type, _seq); + D(p->level--); return _seq; } @@ -17747,15 +21663,19 @@ _loop0_106_rule(Parser *p) static void * _tmp_107_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ',' args if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_107[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' args")); Token * _literal; expr_ty c; if ( @@ -17764,17 +21684,22 @@ _tmp_107_rule(Parser *p) (c = args_rule(p)) // args ) { + D(fprintf(stderr, "%*c+ _tmp_107[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' args")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_107[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' args")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17782,15 +21707,19 @@ _tmp_107_rule(Parser *p) static void * _tmp_108_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ',' args if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_108[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' args")); Token * _literal; expr_ty c; if ( @@ -17799,17 +21728,22 @@ _tmp_108_rule(Parser *p) (c = args_rule(p)) // args ) { + D(fprintf(stderr, "%*c+ _tmp_108[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' args")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_108[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' args")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17817,7 +21751,9 @@ _tmp_108_rule(Parser *p) static asdl_seq * _loop0_110_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17827,14 +21763,17 @@ _loop0_110_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' kwarg_or_starred if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_110[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_starred")); Token * _literal; KeywordOrStarred* elem; while ( @@ -17847,6 +21786,7 @@ _loop0_110_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -17855,6 +21795,7 @@ _loop0_110_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17863,17 +21804,21 @@ _loop0_110_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_110[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_starred")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_110_type, _seq); + D(p->level--); return _seq; } @@ -17881,15 +21826,19 @@ _loop0_110_rule(Parser *p) static asdl_seq * _gather_109_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // kwarg_or_starred _loop0_110 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_109[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_110")); KeywordOrStarred* elem; asdl_seq * seq; if ( @@ -17898,13 +21847,17 @@ _gather_109_rule(Parser *p) (seq = _loop0_110_rule(p)) // _loop0_110 ) { + D(fprintf(stderr, "%*c+ _gather_109[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_110")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_109[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_starred _loop0_110")); } _res = NULL; done: + D(p->level--); return _res; } @@ -17912,7 +21865,9 @@ _gather_109_rule(Parser *p) static asdl_seq * _loop0_112_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -17922,14 +21877,17 @@ _loop0_112_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' kwarg_or_double_starred if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_112[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_double_starred")); Token * _literal; KeywordOrStarred* elem; while ( @@ -17942,6 +21900,7 @@ _loop0_112_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -17950,6 +21909,7 @@ _loop0_112_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -17958,17 +21918,21 @@ _loop0_112_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_112[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_double_starred")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_112_type, _seq); + D(p->level--); return _seq; } @@ -17976,15 +21940,19 @@ _loop0_112_rule(Parser *p) static asdl_seq * _gather_111_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // kwarg_or_double_starred _loop0_112 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_111[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_112")); KeywordOrStarred* elem; asdl_seq * seq; if ( @@ -17993,13 +21961,17 @@ _gather_111_rule(Parser *p) (seq = _loop0_112_rule(p)) // _loop0_112 ) { + D(fprintf(stderr, "%*c+ _gather_111[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_112")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_111[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_double_starred _loop0_112")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18007,7 +21979,9 @@ _gather_111_rule(Parser *p) static asdl_seq * _loop0_114_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18017,14 +21991,17 @@ _loop0_114_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' kwarg_or_starred if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_114[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_starred")); Token * _literal; KeywordOrStarred* elem; while ( @@ -18037,6 +22014,7 @@ _loop0_114_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -18045,6 +22023,7 @@ _loop0_114_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18053,17 +22032,21 @@ _loop0_114_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_114[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_starred")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_114_type, _seq); + D(p->level--); return _seq; } @@ -18071,15 +22054,19 @@ _loop0_114_rule(Parser *p) static asdl_seq * _gather_113_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // kwarg_or_starred _loop0_114 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_113[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_114")); KeywordOrStarred* elem; asdl_seq * seq; if ( @@ -18088,13 +22075,17 @@ _gather_113_rule(Parser *p) (seq = _loop0_114_rule(p)) // _loop0_114 ) { + D(fprintf(stderr, "%*c+ _gather_113[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_starred _loop0_114")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_113[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_starred _loop0_114")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18102,7 +22093,9 @@ _gather_113_rule(Parser *p) static asdl_seq * _loop0_116_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18112,14 +22105,17 @@ _loop0_116_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' kwarg_or_double_starred if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_116[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' kwarg_or_double_starred")); Token * _literal; KeywordOrStarred* elem; while ( @@ -18132,6 +22128,7 @@ _loop0_116_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -18140,6 +22137,7 @@ _loop0_116_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18148,17 +22146,21 @@ _loop0_116_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_116[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' kwarg_or_double_starred")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_116_type, _seq); + D(p->level--); return _seq; } @@ -18166,15 +22168,19 @@ _loop0_116_rule(Parser *p) static asdl_seq * _gather_115_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // kwarg_or_double_starred _loop0_116 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_115[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_116")); KeywordOrStarred* elem; asdl_seq * seq; if ( @@ -18183,13 +22189,17 @@ _gather_115_rule(Parser *p) (seq = _loop0_116_rule(p)) // _loop0_116 ) { + D(fprintf(stderr, "%*c+ _gather_115[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwarg_or_double_starred _loop0_116")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_115[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwarg_or_double_starred _loop0_116")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18197,7 +22207,9 @@ _gather_115_rule(Parser *p) static asdl_seq * _loop0_117_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18207,14 +22219,17 @@ _loop0_117_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // (',' star_target) if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_117[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_target)")); void *_tmp_145_var; while ( (_tmp_145_var = _tmp_145_rule(p)) // ',' star_target @@ -18227,6 +22242,7 @@ _loop0_117_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18235,17 +22251,21 @@ _loop0_117_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_117[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(',' star_target)")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_117_type, _seq); + D(p->level--); return _seq; } @@ -18253,7 +22273,9 @@ _loop0_117_rule(Parser *p) static asdl_seq * _loop0_119_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18263,14 +22285,17 @@ _loop0_119_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' star_target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_119[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target")); Token * _literal; expr_ty elem; while ( @@ -18283,6 +22308,7 @@ _loop0_119_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -18291,6 +22317,7 @@ _loop0_119_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18299,17 +22326,21 @@ _loop0_119_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_119[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_119_type, _seq); + D(p->level--); return _seq; } @@ -18317,15 +22348,19 @@ _loop0_119_rule(Parser *p) static asdl_seq * _gather_118_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // star_target _loop0_119 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_118[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_target _loop0_119")); expr_ty elem; asdl_seq * seq; if ( @@ -18334,13 +22369,17 @@ _gather_118_rule(Parser *p) (seq = _loop0_119_rule(p)) // _loop0_119 ) { + D(fprintf(stderr, "%*c+ _gather_118[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_target _loop0_119")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_118[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_target _loop0_119")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18348,15 +22387,19 @@ _gather_118_rule(Parser *p) static void * _tmp_120_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // !'*' star_target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_120[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "!'*' star_target")); expr_ty star_target_var; if ( _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 16) // token='*' @@ -18364,13 +22407,17 @@ _tmp_120_rule(Parser *p) (star_target_var = star_target_rule(p)) // star_target ) { + D(fprintf(stderr, "%*c+ _tmp_120[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "!'*' star_target")); _res = star_target_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_120[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "!'*' star_target")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18378,7 +22425,9 @@ _tmp_120_rule(Parser *p) static asdl_seq * _loop0_122_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18388,14 +22437,17 @@ _loop0_122_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' del_target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_122[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' del_target")); Token * _literal; expr_ty elem; while ( @@ -18408,6 +22460,7 @@ _loop0_122_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -18416,6 +22469,7 @@ _loop0_122_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18424,17 +22478,21 @@ _loop0_122_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_122[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' del_target")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_122_type, _seq); + D(p->level--); return _seq; } @@ -18442,15 +22500,19 @@ _loop0_122_rule(Parser *p) static asdl_seq * _gather_121_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // del_target _loop0_122 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_121[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "del_target _loop0_122")); expr_ty elem; asdl_seq * seq; if ( @@ -18459,13 +22521,17 @@ _gather_121_rule(Parser *p) (seq = _loop0_122_rule(p)) // _loop0_122 ) { + D(fprintf(stderr, "%*c+ _gather_121[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "del_target _loop0_122")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_121[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "del_target _loop0_122")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18473,7 +22539,9 @@ _gather_121_rule(Parser *p) static asdl_seq * _loop0_124_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18483,14 +22551,17 @@ _loop0_124_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // ',' target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_124[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' target")); Token * _literal; expr_ty elem; while ( @@ -18503,6 +22574,7 @@ _loop0_124_rule(Parser *p) if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; PyMem_Free(_children); + D(p->level--); return NULL; } if (_n == _children_capacity) { @@ -18511,6 +22583,7 @@ _loop0_124_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18519,17 +22592,21 @@ _loop0_124_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_124[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' target")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_124_type, _seq); + D(p->level--); return _seq; } @@ -18537,15 +22614,19 @@ _loop0_124_rule(Parser *p) static asdl_seq * _gather_123_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } asdl_seq * _res = NULL; int _mark = p->mark; { // target _loop0_124 if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _gather_123[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "target _loop0_124")); expr_ty elem; asdl_seq * seq; if ( @@ -18554,13 +22635,17 @@ _gather_123_rule(Parser *p) (seq = _loop0_124_rule(p)) // _loop0_124 ) { + D(fprintf(stderr, "%*c+ _gather_123[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "target _loop0_124")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _gather_123[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "target _loop0_124")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18568,29 +22653,38 @@ _gather_123_rule(Parser *p) static void * _tmp_125_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // args if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_125[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args")); expr_ty args_var; if ( (args_var = args_rule(p)) // args ) { + D(fprintf(stderr, "%*c+ _tmp_125[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args")); _res = args_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_125[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args")); } { // expression for_if_clauses if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_125[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses")); expr_ty expression_var; asdl_seq* for_if_clauses_var; if ( @@ -18599,13 +22693,17 @@ _tmp_125_rule(Parser *p) (for_if_clauses_var = for_if_clauses_rule(p)) // for_if_clauses ) { + D(fprintf(stderr, "%*c+ _tmp_125[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses")); _res = _PyPegen_dummy_name(p, expression_var, for_if_clauses_var); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_125[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression for_if_clauses")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18613,7 +22711,9 @@ _tmp_125_rule(Parser *p) static asdl_seq * _loop0_126_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18623,14 +22723,17 @@ _loop0_126_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // star_named_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_126[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expressions")); asdl_seq* star_named_expressions_var; while ( (star_named_expressions_var = star_named_expressions_rule(p)) // star_named_expressions @@ -18643,6 +22746,7 @@ _loop0_126_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18651,17 +22755,21 @@ _loop0_126_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_126[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expressions")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_126_type, _seq); + D(p->level--); return _seq; } @@ -18669,15 +22777,19 @@ _loop0_126_rule(Parser *p) static void * _tmp_127_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '=' annotated_rhs if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_127[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs")); Token * _literal; expr_ty annotated_rhs_var; if ( @@ -18686,13 +22798,17 @@ _tmp_127_rule(Parser *p) (annotated_rhs_var = annotated_rhs_rule(p)) // annotated_rhs ) { + D(fprintf(stderr, "%*c+ _tmp_127[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' annotated_rhs")); _res = _PyPegen_dummy_name(p, _literal, annotated_rhs_var); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_127[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'=' annotated_rhs")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18700,41 +22816,54 @@ _tmp_127_rule(Parser *p) static void * _tmp_128_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // yield_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_128[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { + D(fprintf(stderr, "%*c+ _tmp_128[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); _res = yield_expr_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_128[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } { // star_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_128[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { + D(fprintf(stderr, "%*c+ _tmp_128[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); _res = star_expressions_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_128[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18742,41 +22871,54 @@ _tmp_128_rule(Parser *p) static void * _tmp_129_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // yield_expr if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_129[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { + D(fprintf(stderr, "%*c+ _tmp_129[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); _res = yield_expr_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_129[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } { // star_expressions if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_129[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { + D(fprintf(stderr, "%*c+ _tmp_129[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); _res = star_expressions_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_129[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18784,55 +22926,73 @@ _tmp_129_rule(Parser *p) static void * _tmp_130_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '[' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_130[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 9)) // token='[' ) { + D(fprintf(stderr, "%*c+ _tmp_130[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_130[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['")); } { // '(' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_130[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 7)) // token='(' ) { + D(fprintf(stderr, "%*c+ _tmp_130[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_130[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'('")); } { // '{' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_130[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 25)) // token='{' ) { + D(fprintf(stderr, "%*c+ _tmp_130[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_130[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18840,7 +23000,9 @@ _tmp_130_rule(Parser *p) static asdl_seq * _loop0_131_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -18850,14 +23012,17 @@ _loop0_131_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_no_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop0_131[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -18870,6 +23035,7 @@ _loop0_131_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -18878,17 +23044,21 @@ _loop0_131_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_131[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); if (!_seq) { PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop0_131_type, _seq); + D(p->level--); return _seq; } @@ -18896,41 +23066,54 @@ _loop0_131_rule(Parser *p) static void * _tmp_132_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // slash_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_132[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default")); SlashWithDefault* slash_with_default_var; if ( (slash_with_default_var = slash_with_default_rule(p)) // slash_with_default ) { + D(fprintf(stderr, "%*c+ _tmp_132[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default")); _res = slash_with_default_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_132[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_with_default")); } { // param_with_default+ if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_132[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default+")); asdl_seq * _loop1_146_var; if ( (_loop1_146_var = _loop1_146_rule(p)) // param_with_default+ ) { + D(fprintf(stderr, "%*c+ _tmp_132[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_with_default+")); _res = _loop1_146_var; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_132[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default+")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18938,29 +23121,38 @@ _tmp_132_rule(Parser *p) static void * _tmp_133_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_133[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ _tmp_133[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_133[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'")); } { // ',' (')' | '**') if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_133[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')")); Token * _literal; void *_tmp_147_var; if ( @@ -18969,13 +23161,17 @@ _tmp_133_rule(Parser *p) (_tmp_147_var = _tmp_147_rule(p)) // ')' | '**' ) { + D(fprintf(stderr, "%*c+ _tmp_133[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')")); _res = _PyPegen_dummy_name(p, _literal, _tmp_147_var); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_133[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (')' | '**')")); } _res = NULL; done: + D(p->level--); return _res; } @@ -18983,29 +23179,38 @@ _tmp_133_rule(Parser *p) static void * _tmp_134_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_134[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { + D(fprintf(stderr, "%*c+ _tmp_134[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_134[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'")); } { // ',' (':' | '**') if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_134[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')")); Token * _literal; void *_tmp_148_var; if ( @@ -19014,13 +23219,17 @@ _tmp_134_rule(Parser *p) (_tmp_148_var = _tmp_148_rule(p)) // ':' | '**' ) { + D(fprintf(stderr, "%*c+ _tmp_134[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')")); _res = _PyPegen_dummy_name(p, _literal, _tmp_148_var); goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_134[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (':' | '**')")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19028,15 +23237,19 @@ _tmp_134_rule(Parser *p) static void * _tmp_135_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // star_targets '=' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_135[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='")); Token * _literal; expr_ty z; if ( @@ -19045,17 +23258,22 @@ _tmp_135_rule(Parser *p) (_literal = _PyPegen_expect_token(p, 22)) // token='=' ) { + D(fprintf(stderr, "%*c+ _tmp_135[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_135[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19063,41 +23281,54 @@ _tmp_135_rule(Parser *p) static void * _tmp_136_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '.' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_136[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 23)) // token='.' ) { + D(fprintf(stderr, "%*c+ _tmp_136[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_136[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'")); } { // '...' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_136[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 52)) // token='...' ) { + D(fprintf(stderr, "%*c+ _tmp_136[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_136[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19105,41 +23336,54 @@ _tmp_136_rule(Parser *p) static void * _tmp_137_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '.' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_137[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 23)) // token='.' ) { + D(fprintf(stderr, "%*c+ _tmp_137[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_137[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'")); } { // '...' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_137[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 52)) // token='...' ) { + D(fprintf(stderr, "%*c+ _tmp_137[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_137[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19147,15 +23391,19 @@ _tmp_137_rule(Parser *p) static void * _tmp_138_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // '@' named_expression NEWLINE if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_138[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE")); Token * _literal; expr_ty f; Token * newline_var; @@ -19167,17 +23415,22 @@ _tmp_138_rule(Parser *p) (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) { + D(fprintf(stderr, "%*c+ _tmp_138[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE")); _res = f; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_138[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@' named_expression NEWLINE")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19185,15 +23438,19 @@ _tmp_138_rule(Parser *p) static void * _tmp_139_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ',' star_expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_139[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_expression")); Token * _literal; expr_ty c; if ( @@ -19202,17 +23459,22 @@ _tmp_139_rule(Parser *p) (c = star_expression_rule(p)) // star_expression ) { + D(fprintf(stderr, "%*c+ _tmp_139[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_expression")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_139[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19220,15 +23482,19 @@ _tmp_139_rule(Parser *p) static void * _tmp_140_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ',' expression if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_140[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); Token * _literal; expr_ty c; if ( @@ -19237,17 +23503,22 @@ _tmp_140_rule(Parser *p) (c = expression_rule(p)) // expression ) { + D(fprintf(stderr, "%*c+ _tmp_140[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_140[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19255,15 +23526,19 @@ _tmp_140_rule(Parser *p) static void * _tmp_141_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'or' conjunction if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_141[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'or' conjunction")); Token * _keyword; expr_ty c; if ( @@ -19272,17 +23547,22 @@ _tmp_141_rule(Parser *p) (c = conjunction_rule(p)) // conjunction ) { + D(fprintf(stderr, "%*c+ _tmp_141[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'or' conjunction")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_141[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'or' conjunction")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19290,15 +23570,19 @@ _tmp_141_rule(Parser *p) static void * _tmp_142_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'and' inversion if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_142[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'and' inversion")); Token * _keyword; expr_ty c; if ( @@ -19307,17 +23591,22 @@ _tmp_142_rule(Parser *p) (c = inversion_rule(p)) // inversion ) { + D(fprintf(stderr, "%*c+ _tmp_142[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'and' inversion")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_142[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'and' inversion")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19325,15 +23614,19 @@ _tmp_142_rule(Parser *p) static void * _tmp_143_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'if' disjunction if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_143[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); Token * _keyword; expr_ty z; if ( @@ -19342,17 +23635,22 @@ _tmp_143_rule(Parser *p) (z = disjunction_rule(p)) // disjunction ) { + D(fprintf(stderr, "%*c+ _tmp_143[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_143[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19360,15 +23658,19 @@ _tmp_143_rule(Parser *p) static void * _tmp_144_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // 'if' disjunction if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); Token * _keyword; expr_ty z; if ( @@ -19377,17 +23679,22 @@ _tmp_144_rule(Parser *p) (z = disjunction_rule(p)) // disjunction ) { + D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19395,15 +23702,19 @@ _tmp_144_rule(Parser *p) static void * _tmp_145_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ',' star_target if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target")); Token * _literal; expr_ty c; if ( @@ -19412,17 +23723,22 @@ _tmp_145_rule(Parser *p) (c = star_target_rule(p)) // star_target ) { + D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + D(p->level--); return NULL; } goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19430,7 +23746,9 @@ _tmp_145_rule(Parser *p) static asdl_seq * _loop1_146_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void *_res = NULL; @@ -19440,14 +23758,17 @@ _loop1_146_rule(Parser *p) if (!_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } ssize_t _children_capacity = 1; ssize_t _n = 0; { // param_with_default if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _loop1_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -19460,6 +23781,7 @@ _loop1_146_rule(Parser *p) if (!_new_children) { p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } _children = _new_children; @@ -19468,9 +23790,12 @@ _loop1_146_rule(Parser *p) _mark = p->mark; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop1_146[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } if (_n == 0 || p->error_indicator) { PyMem_Free(_children); + D(p->level--); return NULL; } asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena); @@ -19478,11 +23803,13 @@ _loop1_146_rule(Parser *p) PyMem_Free(_children); p->error_indicator = 1; PyErr_NoMemory(); + D(p->level--); return NULL; } for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]); PyMem_Free(_children); _PyPegen_insert_memo(p, _start_mark, _loop1_146_type, _seq); + D(p->level--); return _seq; } @@ -19490,41 +23817,54 @@ _loop1_146_rule(Parser *p) static void * _tmp_147_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ')' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { + D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'")); } { // '**' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 35)) // token='**' ) { + D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'")); } _res = NULL; done: + D(p->level--); return _res; } @@ -19532,41 +23872,54 @@ _tmp_147_rule(Parser *p) static void * _tmp_148_rule(Parser *p) { + D(p->level++); if (p->error_indicator) { + D(p->level--); return NULL; } void * _res = NULL; int _mark = p->mark; { // ':' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { + D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'")); } { // '**' if (p->error_indicator) { + D(p->level--); return NULL; } + D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 35)) // token='**' ) { + D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'")); _res = _literal; goto done; } p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'")); } _res = NULL; done: + D(p->level--); return _res; } diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 9cade2a476d..cd87a9ffd93 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -1027,6 +1027,7 @@ _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int flags, p->flags = flags; p->feature_version = feature_version; p->known_err_token = NULL; + p->level = 0; return p; } diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index 761e90f06db..bd3056e6f2b 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -72,6 +72,7 @@ typedef struct { int feature_version; growable_comment_array type_ignore_comments; Token *known_err_token; + int level; } Parser; typedef struct { diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index 1249d4f683e..ff7e75a9fdf 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -29,6 +29,13 @@ from pegen.parser_generator import ParserGenerator EXTENSION_PREFIX = """\ #include "pegen.h" +#ifdef Py_DEBUG +extern int Py_DebugFlag; +#define D(x) if (Py_DebugFlag) x; +#else +#define D(x) +#endif + """ @@ -300,6 +307,16 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.debug = debug self.skip_actions = skip_actions + def add_level(self) -> None: + self.print("D(p->level++);") + + def remove_level(self) -> None: + self.print("D(p->level--);") + + def add_return(self, ret_val: str) -> None: + self.remove_level() + self.print(f"return {ret_val};") + def unique_varname(self, name: str = "tmpvar") -> str: new_var = name + "_" + str(self._varname_counter) self._varname_counter += 1 @@ -310,8 +327,8 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print(f"int {error_var} = {call_text};") self.print(f"if ({error_var}) {{") with self.indent(): - self.print(f"return {returnval};") - self.print(f"}}") + self.add_return(returnval) + self.print("}") def call_with_errorcheck_goto(self, call_text: str, goto_target: str) -> None: error_var = self.unique_varname() @@ -328,7 +345,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print(cleanup_code) self.print("p->error_indicator = 1;") self.print("PyErr_NoMemory();") - self.print("return NULL;") + self.add_return("NULL") self.print(f"}}") def out_of_memory_goto(self, expr: str, goto_target: str) -> None: @@ -415,7 +432,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print("if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {") with self.indent(): self.print("p->error_indicator = 1;") - self.print("return NULL;") + self.add_return("NULL") self.print("}") self.print("int _start_lineno = p->tokens[_mark]->lineno;") self.print("UNUSED(_start_lineno); // Only used by EXTRA macro") @@ -426,7 +443,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print("Token *_token = _PyPegen_get_last_nonnwhitespace_token(p);") self.print("if (_token == NULL) {") with self.indent(): - self.print("return NULL;") + self.add_return("NULL") self.print("}") self.print("int _end_lineno = _token->end_lineno;") self.print("UNUSED(_end_lineno); // Only used by EXTRA macro") @@ -436,16 +453,18 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): def _check_for_errors(self) -> None: self.print("if (p->error_indicator) {") with self.indent(): - self.print("return NULL;") + self.add_return("NULL") self.print("}") def _set_up_rule_memoization(self, node: Rule, result_type: str) -> None: self.print("{") with self.indent(): + self.add_level() self.print(f"{result_type} _res = NULL;") - self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &_res))") + self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &_res)) {{") with self.indent(): - self.print("return _res;") + self.add_return("_res") + self.print("}") self.print("int _mark = p->mark;") self.print("int _resmark = p->mark;") self.print("while (1) {") @@ -462,7 +481,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print("_res = _raw;") self.print("}") self.print(f"p->mark = _resmark;") - self.print("return _res;") + self.add_return("_res") self.print("}") self.print(f"static {result_type}") self.print(f"{node.name}_raw(Parser *p)") @@ -474,12 +493,14 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): memoize = self._should_memoize(node) with self.indent(): + self.add_level() 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))") + self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &_res)) {{") with self.indent(): - self.print("return _res;") + self.add_return("_res") + self.print("}") self.print("int _mark = p->mark;") if any(alt.action and "EXTRA" in alt.action for alt in rhs.alts): self._set_up_token_start_metadata_extraction() @@ -487,25 +508,27 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): rhs, is_loop=False, is_gather=node.is_gather(), rulename=node.name, ) if self.debug: - self.print(f'fprintf(stderr, "Fail at %d: {node.name}\\n", p->mark);') + self.print(f'D(fprintf(stderr, "Fail at %d: {node.name}\\n", p->mark));') self.print("_res = NULL;") self.print(" done:") with self.indent(): if memoize: self.print(f"_PyPegen_insert_memo(p, _mark, {node.name}_type, _res);") - self.print("return _res;") + self.add_return("_res") def _handle_loop_rule_body(self, node: Rule, rhs: Rhs) -> None: memoize = self._should_memoize(node) is_repeat1 = node.name.startswith("_loop1") with self.indent(): + self.add_level() self._check_for_errors() self.print("void *_res = NULL;") if memoize: - self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &_res))") + self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &_res)) {{") with self.indent(): - self.print("return _res;") + self.add_return("_res") + self.print("}") self.print("int _mark = p->mark;") self.print("int _start_mark = p->mark;") self.print("void **_children = PyMem_Malloc(sizeof(void *));") @@ -521,7 +544,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print("if (_n == 0 || p->error_indicator) {") with self.indent(): self.print("PyMem_Free(_children);") - self.print("return NULL;") + self.add_return("NULL") self.print("}") self.print("asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);") self.out_of_memory_return(f"!_seq", cleanup_code="PyMem_Free(_children);") @@ -529,7 +552,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print("PyMem_Free(_children);") if node.name: self.print(f"_PyPegen_insert_memo(p, _start_mark, {node.name}_type, _seq);") - self.print("return _seq;") + self.add_return("_seq") def visit_Rule(self, node: Rule) -> None: is_loop = node.is_loop() @@ -594,12 +617,12 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print("p->error_indicator = 1;") if cleanup_code: self.print(cleanup_code) - self.print("return NULL;") + self.add_return("NULL") self.print("}") if self.debug: self.print( - f'fprintf(stderr, "Hit with action [%d-%d]: %s\\n", _mark, p->mark, "{node}");' + f'D(fprintf(stderr, "Hit with action [%d-%d]: %s\\n", _mark, p->mark, "{node}"));' ) def emit_default_action(self, is_gather: bool, node: Alt) -> None: @@ -613,7 +636,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): else: if self.debug: self.print( - f'fprintf(stderr, "Hit without action [%d:%d]: %s\\n", _mark, p->mark, "{node}");' + f'D(fprintf(stderr, "Hit without action [%d:%d]: %s\\n", _mark, p->mark, "{node}"));' ) self.print( f"_res = _PyPegen_dummy_name(p, {', '.join(self.local_variable_names)});" @@ -621,18 +644,21 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): else: if self.debug: self.print( - f'fprintf(stderr, "Hit with default action [%d:%d]: %s\\n", _mark, p->mark, "{node}");' + f'D(fprintf(stderr, "Hit with default action [%d:%d]: %s\\n", _mark, p->mark, "{node}"));' ) self.print(f"_res = {self.local_variable_names[0]};") def emit_dummy_action(self) -> None: self.print("_res = _PyPegen_dummy_name(p);") - def handle_alt_normal(self, node: Alt, is_gather: bool) -> None: + def handle_alt_normal(self, node: Alt, is_gather: bool, rulename: Optional[str]) -> None: self.join_conditions(keyword="if", node=node) self.print("{") # We have parsed successfully all the conditions for the option. with self.indent(): + self.print( + f'D(fprintf(stderr, "%*c+ {rulename}[%d-%d]: %s succeeded!\\n", p->level, \' \', _mark, p->mark, "{node}"));' + ) # Prepare to emmit the rule action and do so if node.action and "EXTRA" in node.action: self._set_up_token_end_metadata_extraction() @@ -684,6 +710,9 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): self.print(f"{{ // {node}") with self.indent(): self._check_for_errors() + self.print( + f'D(fprintf(stderr, "%*c> {rulename}[%d-%d]: %s\\n", p->level, \' \', _mark, p->mark, "{node}"));' + ) # 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): @@ -701,11 +730,18 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): if is_loop: self.handle_alt_loop(node, is_gather, rulename) else: - self.handle_alt_normal(node, is_gather) + self.handle_alt_normal(node, is_gather, rulename) self.print("p->mark = _mark;") + self.print( + f"D(fprintf(stderr, \"%*c%s {rulename}[%d-%d]: %s failed!\\n\", p->level, ' ',\n" + f' p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "{node}"));' + ) if "_cut_var" in vars: - self.print("if (_cut_var) return NULL;") + self.print("if (_cut_var) {") + with self.indent(): + self.add_return("NULL") + self.print("}") self.print("}") def collect_vars(self, node: Alt) -> Dict[Optional[str], Optional[str]]: diff --git a/Tools/peg_generator/pegen/testutil.py b/Tools/peg_generator/pegen/testutil.py index 264659e7176..920d24657c5 100644 --- a/Tools/peg_generator/pegen/testutil.py +++ b/Tools/peg_generator/pegen/testutil.py @@ -96,7 +96,7 @@ def generate_parser_c_extension( # context. assert not os.listdir(path) source = path / "parse.c" - with open(source, "w") as file: + with open(source, "w", encoding="utf-8") as file: genr = CParserGenerator( grammar, ALL_TOKENS, EXACT_TOKENS, NON_EXACT_TOKENS, file, debug=debug )