From 379c0397dc83bba4164fa617c7dbe2a22a60b32c Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Sat, 11 Jul 2026 14:58:54 +0100 Subject: [PATCH] gh-153568: Make the parser's per-rule stack check an inline comparison The parser now caches the thread state and stack limit up front and only falls back to the full check when the stack is nearly exhausted. --- ...7-11-14-58-24.gh-issue-153568.stackchk.rst | 2 + Parser/parser.c | 938 +++++++++--------- Parser/pegen.c | 6 + Parser/pegen.h | 25 + Tools/peg_generator/pegen/c_generator.py | 2 +- 5 files changed, 503 insertions(+), 470 deletions(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2026-07-11-14-58-24.gh-issue-153568.stackchk.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-07-11-14-58-24.gh-issue-153568.stackchk.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-07-11-14-58-24.gh-issue-153568.stackchk.rst new file mode 100644 index 000000000000000..c11ec9d4fe590af --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-07-11-14-58-24.gh-issue-153568.stackchk.rst @@ -0,0 +1,2 @@ +Speed up the parser by turning its per-rule C-stack check into a single +inline comparison. diff --git a/Parser/parser.c b/Parser/parser.c index 4f4fd3ed46d1f02..b0057f3798473e7 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -1011,7 +1011,7 @@ static void *_tmp_180_rule(Parser *p); static mod_ty file_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1057,7 +1057,7 @@ file_rule(Parser *p) static mod_ty interactive_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1100,7 +1100,7 @@ interactive_rule(Parser *p) static mod_ty eval_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1149,7 +1149,7 @@ eval_rule(Parser *p) static mod_ty func_type_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1210,7 +1210,7 @@ func_type_rule(Parser *p) static asdl_stmt_seq* statements_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1253,7 +1253,7 @@ statements_rule(Parser *p) static asdl_stmt_seq* statement_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1320,7 +1320,7 @@ statement_rule(Parser *p) static asdl_stmt_seq* single_compound_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1363,7 +1363,7 @@ single_compound_stmt_rule(Parser *p) static asdl_stmt_seq* statement_newline_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1494,7 +1494,7 @@ statement_newline_rule(Parser *p) static asdl_stmt_seq* simple_stmts_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1587,7 +1587,7 @@ simple_stmts_rule(Parser *p) static stmt_ty simple_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -1932,7 +1932,7 @@ simple_stmt_rule(Parser *p) static stmt_ty compound_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -2122,7 +2122,7 @@ compound_stmt_rule(Parser *p) static stmt_ty assignment_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -2340,7 +2340,7 @@ assignment_rule(Parser *p) static expr_ty annotated_rhs_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -2410,7 +2410,7 @@ annotated_rhs_rule(Parser *p) static AugOperator* augassign_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -2741,7 +2741,7 @@ augassign_rule(Parser *p) static stmt_ty return_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -2809,7 +2809,7 @@ return_stmt_rule(Parser *p) static stmt_ty raise_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -2967,7 +2967,7 @@ raise_stmt_rule(Parser *p) static stmt_ty pass_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3028,7 +3028,7 @@ pass_stmt_rule(Parser *p) static stmt_ty break_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3089,7 +3089,7 @@ break_stmt_rule(Parser *p) static stmt_ty continue_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3150,7 +3150,7 @@ continue_stmt_rule(Parser *p) static stmt_ty global_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3214,7 +3214,7 @@ global_stmt_rule(Parser *p) static stmt_ty nonlocal_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3278,7 +3278,7 @@ nonlocal_stmt_rule(Parser *p) static stmt_ty del_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3363,7 +3363,7 @@ del_stmt_rule(Parser *p) static stmt_ty yield_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3424,7 +3424,7 @@ yield_stmt_rule(Parser *p) static stmt_ty assert_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3510,7 +3510,7 @@ assert_stmt_rule(Parser *p) static stmt_ty import_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3591,7 +3591,7 @@ import_stmt_rule(Parser *p) static stmt_ty import_name_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3661,7 +3661,7 @@ import_name_rule(Parser *p) static stmt_ty import_from_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3805,7 +3805,7 @@ import_from_rule(Parser *p) static asdl_alias_seq* import_from_targets_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3940,7 +3940,7 @@ import_from_targets_rule(Parser *p) static asdl_alias_seq* import_from_as_names_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -3983,7 +3983,7 @@ import_from_as_names_rule(Parser *p) static alias_ty import_from_as_name_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4066,7 +4066,7 @@ import_from_as_name_rule(Parser *p) static asdl_alias_seq* dotted_as_names_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4109,7 +4109,7 @@ dotted_as_names_rule(Parser *p) static alias_ty dotted_as_name_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4194,7 +4194,7 @@ static expr_ty dotted_name_raw(Parser *); static expr_ty dotted_name_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -4228,7 +4228,7 @@ dotted_name_rule(Parser *p) static expr_ty dotted_name_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4296,7 +4296,7 @@ dotted_name_raw(Parser *p) static asdl_stmt_seq* block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4391,7 +4391,7 @@ block_rule(Parser *p) static asdl_expr_seq* decorators_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4434,7 +4434,7 @@ decorators_rule(Parser *p) static stmt_ty class_def_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4501,7 +4501,7 @@ class_def_rule(Parser *p) static stmt_ty class_def_raw_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4596,7 +4596,7 @@ class_def_raw_rule(Parser *p) static stmt_ty function_def_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4664,7 +4664,7 @@ function_def_rule(Parser *p) static stmt_ty function_def_raw_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4834,7 +4834,7 @@ function_def_raw_rule(Parser *p) static arguments_ty params_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -4896,7 +4896,7 @@ params_rule(Parser *p) static arguments_ty parameters_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5059,7 +5059,7 @@ parameters_rule(Parser *p) static asdl_arg_seq* slash_no_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5139,7 +5139,7 @@ slash_no_default_rule(Parser *p) static SlashWithDefault* slash_with_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5228,7 +5228,7 @@ slash_with_default_rule(Parser *p) static StarEtc* star_etc_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5389,7 +5389,7 @@ star_etc_rule(Parser *p) static arg_ty kwds_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5454,7 +5454,7 @@ kwds_rule(Parser *p) static arg_ty param_no_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5534,7 +5534,7 @@ param_no_default_rule(Parser *p) static arg_ty param_no_default_star_annotation_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5612,7 +5612,7 @@ param_no_default_star_annotation_rule(Parser *p) static NameDefaultPair* param_with_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5698,7 +5698,7 @@ param_with_default_rule(Parser *p) static NameDefaultPair* param_maybe_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5782,7 +5782,7 @@ param_maybe_default_rule(Parser *p) static arg_ty param_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5846,7 +5846,7 @@ param_rule(Parser *p) static arg_ty param_star_annotation_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5910,7 +5910,7 @@ param_star_annotation_rule(Parser *p) static expr_ty annotation_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -5956,7 +5956,7 @@ annotation_rule(Parser *p) static expr_ty star_annotation_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6002,7 +6002,7 @@ star_annotation_rule(Parser *p) static expr_ty default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6070,7 +6070,7 @@ default_rule(Parser *p) static stmt_ty if_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6210,7 +6210,7 @@ if_stmt_rule(Parser *p) static stmt_ty elif_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6347,7 +6347,7 @@ elif_stmt_rule(Parser *p) static asdl_stmt_seq* else_block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6415,7 +6415,7 @@ else_block_rule(Parser *p) static stmt_ty while_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6511,7 +6511,7 @@ while_stmt_rule(Parser *p) static stmt_ty for_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6708,7 +6708,7 @@ for_stmt_rule(Parser *p) static stmt_ty with_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -6980,7 +6980,7 @@ with_stmt_rule(Parser *p) static withitem_ty with_item_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -7078,7 +7078,7 @@ with_item_rule(Parser *p) static stmt_ty try_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -7269,7 +7269,7 @@ try_stmt_rule(Parser *p) static excepthandler_ty except_block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -7511,7 +7511,7 @@ except_block_rule(Parser *p) static excepthandler_ty except_star_block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -7718,7 +7718,7 @@ except_star_block_rule(Parser *p) static asdl_stmt_seq* finally_block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -7788,7 +7788,7 @@ finally_block_rule(Parser *p) static stmt_ty match_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -7886,7 +7886,7 @@ match_stmt_rule(Parser *p) static expr_ty subject_expr_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -7972,7 +7972,7 @@ subject_expr_rule(Parser *p) static match_case_ty case_block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8046,7 +8046,7 @@ case_block_rule(Parser *p) static expr_ty guard_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8092,7 +8092,7 @@ guard_rule(Parser *p) static pattern_ty patterns_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8172,7 +8172,7 @@ patterns_rule(Parser *p) static pattern_ty pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8229,7 +8229,7 @@ pattern_rule(Parser *p) static pattern_ty as_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8315,7 +8315,7 @@ as_pattern_rule(Parser *p) static pattern_ty or_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8384,7 +8384,7 @@ or_pattern_rule(Parser *p) static pattern_ty closed_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8566,7 +8566,7 @@ closed_pattern_rule(Parser *p) static pattern_ty literal_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8800,7 +8800,7 @@ literal_pattern_rule(Parser *p) static expr_ty literal_expr_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -8990,7 +8990,7 @@ literal_expr_rule(Parser *p) static expr_ty complex_number_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9096,7 +9096,7 @@ complex_number_rule(Parser *p) static expr_ty signed_number_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9206,7 +9206,7 @@ signed_number_rule(Parser *p) static expr_ty signed_real_number_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9316,7 +9316,7 @@ signed_real_number_rule(Parser *p) static expr_ty real_number_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9359,7 +9359,7 @@ real_number_rule(Parser *p) static expr_ty imaginary_number_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9429,7 +9429,7 @@ imaginary_number_rule(Parser *p) static pattern_ty capture_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9490,7 +9490,7 @@ capture_pattern_rule(Parser *p) static expr_ty pattern_capture_target_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9537,7 +9537,7 @@ pattern_capture_target_rule(Parser *p) static pattern_ty wildcard_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9598,7 +9598,7 @@ wildcard_pattern_rule(Parser *p) static pattern_ty value_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9663,7 +9663,7 @@ static expr_ty attr_raw(Parser *); static expr_ty attr_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -9697,7 +9697,7 @@ attr_rule(Parser *p) static expr_ty attr_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9765,7 +9765,7 @@ attr_raw(Parser *p) static expr_ty name_or_attr_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9822,7 +9822,7 @@ name_or_attr_rule(Parser *p) static pattern_ty group_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9871,7 +9871,7 @@ group_pattern_rule(Parser *p) static pattern_ty sequence_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -9977,7 +9977,7 @@ sequence_pattern_rule(Parser *p) static asdl_seq* open_sequence_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10026,7 +10026,7 @@ open_sequence_pattern_rule(Parser *p) static asdl_seq* maybe_sequence_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10073,7 +10073,7 @@ maybe_sequence_pattern_rule(Parser *p) static pattern_ty maybe_star_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10130,7 +10130,7 @@ maybe_star_pattern_rule(Parser *p) static pattern_ty star_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10240,7 +10240,7 @@ star_pattern_rule(Parser *p) static pattern_ty mapping_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10458,7 +10458,7 @@ mapping_pattern_rule(Parser *p) static asdl_seq* items_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10496,7 +10496,7 @@ items_pattern_rule(Parser *p) static KeyPatternPair* key_value_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10545,7 +10545,7 @@ key_value_pattern_rule(Parser *p) static expr_ty double_star_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10596,7 +10596,7 @@ double_star_pattern_rule(Parser *p) static pattern_ty class_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10826,7 +10826,7 @@ class_pattern_rule(Parser *p) static asdl_pattern_seq* positional_patterns_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10869,7 +10869,7 @@ positional_patterns_rule(Parser *p) static asdl_seq* keyword_patterns_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10907,7 +10907,7 @@ keyword_patterns_rule(Parser *p) static KeyPatternPair* keyword_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -10956,7 +10956,7 @@ keyword_pattern_rule(Parser *p) static stmt_ty type_alias_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11029,7 +11029,7 @@ type_alias_rule(Parser *p) static asdl_type_param_seq* type_params_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11097,7 +11097,7 @@ type_params_rule(Parser *p) static asdl_type_param_seq* type_param_seq_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11148,7 +11148,7 @@ type_param_seq_rule(Parser *p) static type_param_ty type_param_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11317,7 +11317,7 @@ type_param_rule(Parser *p) static expr_ty type_param_bound_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11363,7 +11363,7 @@ type_param_bound_rule(Parser *p) static expr_ty type_param_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11409,7 +11409,7 @@ type_param_default_rule(Parser *p) static expr_ty type_param_starred_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11455,7 +11455,7 @@ type_param_starred_default_rule(Parser *p) static expr_ty expressions_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11584,7 +11584,7 @@ expressions_rule(Parser *p) static expr_ty expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11722,7 +11722,7 @@ expression_rule(Parser *p) static expr_ty if_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11795,7 +11795,7 @@ if_expression_rule(Parser *p) static expr_ty yield_expr_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -11901,7 +11901,7 @@ yield_expr_rule(Parser *p) static expr_ty star_expressions_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12024,7 +12024,7 @@ star_expressions_rule(Parser *p) static expr_ty star_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12112,7 +12112,7 @@ star_expression_rule(Parser *p) static asdl_expr_seq* star_named_expressions_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12159,7 +12159,7 @@ star_named_expressions_rule(Parser *p) static asdl_expr_seq* star_named_expressions_sequence_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12206,7 +12206,7 @@ star_named_expressions_sequence_rule(Parser *p) static expr_ty star_named_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12291,7 +12291,7 @@ star_named_expression_rule(Parser *p) static expr_ty star_named_expression_sequence_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12348,7 +12348,7 @@ star_named_expression_sequence_rule(Parser *p) static expr_ty assignment_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12422,7 +12422,7 @@ assignment_expression_rule(Parser *p) static expr_ty named_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12500,7 +12500,7 @@ named_expression_rule(Parser *p) static expr_ty disjunction_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12588,7 +12588,7 @@ disjunction_rule(Parser *p) static expr_ty conjunction_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12676,7 +12676,7 @@ conjunction_rule(Parser *p) static expr_ty inversion_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12764,7 +12764,7 @@ inversion_rule(Parser *p) static expr_ty comparison_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -12857,7 +12857,7 @@ comparison_rule(Parser *p) static CmpopExprPair* compare_op_bitwise_or_pair_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13066,7 +13066,7 @@ compare_op_bitwise_or_pair_rule(Parser *p) static CmpopExprPair* eq_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13112,7 +13112,7 @@ eq_bitwise_or_rule(Parser *p) static CmpopExprPair* noteq_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13158,7 +13158,7 @@ noteq_bitwise_or_rule(Parser *p) static CmpopExprPair* lte_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13204,7 +13204,7 @@ lte_bitwise_or_rule(Parser *p) static CmpopExprPair* lt_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13250,7 +13250,7 @@ lt_bitwise_or_rule(Parser *p) static CmpopExprPair* gte_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13296,7 +13296,7 @@ gte_bitwise_or_rule(Parser *p) static CmpopExprPair* gt_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13342,7 +13342,7 @@ gt_bitwise_or_rule(Parser *p) static CmpopExprPair* notin_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13391,7 +13391,7 @@ notin_bitwise_or_rule(Parser *p) static CmpopExprPair* in_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13437,7 +13437,7 @@ in_bitwise_or_rule(Parser *p) static CmpopExprPair* isnot_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13486,7 +13486,7 @@ isnot_bitwise_or_rule(Parser *p) static CmpopExprPair* is_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13534,7 +13534,7 @@ static expr_ty bitwise_or_raw(Parser *); static expr_ty bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -13568,7 +13568,7 @@ bitwise_or_rule(Parser *p) static expr_ty bitwise_or_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13675,7 +13675,7 @@ static expr_ty bitwise_xor_raw(Parser *); static expr_ty bitwise_xor_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -13709,7 +13709,7 @@ bitwise_xor_rule(Parser *p) static expr_ty bitwise_xor_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13797,7 +13797,7 @@ static expr_ty bitwise_and_raw(Parser *); static expr_ty bitwise_and_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -13831,7 +13831,7 @@ bitwise_and_rule(Parser *p) static expr_ty bitwise_and_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -13938,7 +13938,7 @@ static expr_ty shift_expr_raw(Parser *); static expr_ty shift_expr_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -13972,7 +13972,7 @@ shift_expr_rule(Parser *p) static expr_ty shift_expr_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -14099,7 +14099,7 @@ static expr_ty sum_raw(Parser *); static expr_ty sum_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -14133,7 +14133,7 @@ sum_rule(Parser *p) static expr_ty sum_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -14285,7 +14285,7 @@ static expr_ty term_raw(Parser *); static expr_ty term_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -14319,7 +14319,7 @@ term_rule(Parser *p) static expr_ty term_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -14561,7 +14561,7 @@ term_raw(Parser *p) static expr_ty factor_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -14740,7 +14740,7 @@ factor_rule(Parser *p) static expr_ty power_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -14826,7 +14826,7 @@ power_rule(Parser *p) static expr_ty await_primary_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -14921,7 +14921,7 @@ static expr_ty primary_raw(Parser *); static expr_ty primary_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -14955,7 +14955,7 @@ primary_rule(Parser *p) static expr_ty primary_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -15161,7 +15161,7 @@ primary_raw(Parser *p) static expr_ty slices_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -15252,7 +15252,7 @@ slices_rule(Parser *p) static expr_ty slice_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -15356,7 +15356,7 @@ slice_rule(Parser *p) static expr_ty atom_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -15638,7 +15638,7 @@ atom_rule(Parser *p) static expr_ty group_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -15706,7 +15706,7 @@ group_rule(Parser *p) static expr_ty lambdef_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -15776,7 +15776,7 @@ lambdef_rule(Parser *p) static arguments_ty lambda_params_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -15838,7 +15838,7 @@ lambda_params_rule(Parser *p) static arguments_ty lambda_parameters_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16003,7 +16003,7 @@ lambda_parameters_rule(Parser *p) static asdl_arg_seq* lambda_slash_no_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16083,7 +16083,7 @@ lambda_slash_no_default_rule(Parser *p) static SlashWithDefault* lambda_slash_with_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16171,7 +16171,7 @@ lambda_slash_with_default_rule(Parser *p) static StarEtc* lambda_star_etc_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16299,7 +16299,7 @@ lambda_star_etc_rule(Parser *p) static arg_ty lambda_kwds_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16364,7 +16364,7 @@ lambda_kwds_rule(Parser *p) static arg_ty lambda_param_no_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16436,7 +16436,7 @@ lambda_param_no_default_rule(Parser *p) static NameDefaultPair* lambda_param_with_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16514,7 +16514,7 @@ lambda_param_with_default_rule(Parser *p) static NameDefaultPair* lambda_param_maybe_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16592,7 +16592,7 @@ lambda_param_maybe_default_rule(Parser *p) static arg_ty lambda_param_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16653,7 +16653,7 @@ lambda_param_rule(Parser *p) static expr_ty fstring_middle_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16717,7 +16717,7 @@ fstring_middle_rule(Parser *p) static expr_ty fstring_replacement_field_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16812,7 +16812,7 @@ fstring_replacement_field_rule(Parser *p) static ResultTokenWithMetadata* fstring_conversion_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16858,7 +16858,7 @@ fstring_conversion_rule(Parser *p) static ResultTokenWithMetadata* fstring_full_format_spec_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16922,7 +16922,7 @@ fstring_full_format_spec_rule(Parser *p) static expr_ty fstring_format_spec_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -16984,7 +16984,7 @@ fstring_format_spec_rule(Parser *p) static expr_ty fstring_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17035,7 +17035,7 @@ fstring_rule(Parser *p) static expr_ty tstring_format_spec_replacement_field_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17130,7 +17130,7 @@ tstring_format_spec_replacement_field_rule(Parser *p) static expr_ty tstring_format_spec_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17192,7 +17192,7 @@ tstring_format_spec_rule(Parser *p) static ResultTokenWithMetadata* tstring_full_format_spec_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17258,7 +17258,7 @@ tstring_full_format_spec_rule(Parser *p) static expr_ty tstring_replacement_field_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17353,7 +17353,7 @@ tstring_replacement_field_rule(Parser *p) static expr_ty tstring_middle_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17415,7 +17415,7 @@ tstring_middle_rule(Parser *p) static expr_ty tstring_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17469,7 +17469,7 @@ tstring_rule(Parser *p) static expr_ty string_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17512,7 +17512,7 @@ string_rule(Parser *p) static expr_ty strings_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17630,7 +17630,7 @@ strings_rule(Parser *p) static expr_ty list_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17697,7 +17697,7 @@ list_rule(Parser *p) static expr_ty tuple_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17764,7 +17764,7 @@ tuple_rule(Parser *p) static expr_ty set_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17831,7 +17831,7 @@ set_rule(Parser *p) static expr_ty dict_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17923,7 +17923,7 @@ dict_rule(Parser *p) static asdl_seq* double_starred_kvpairs_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -17970,7 +17970,7 @@ double_starred_kvpairs_rule(Parser *p) static KeyValuePair* double_starred_kvpair_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18035,7 +18035,7 @@ double_starred_kvpair_rule(Parser *p) static KeyValuePair* kvpair_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18084,7 +18084,7 @@ kvpair_rule(Parser *p) static asdl_comprehension_seq* for_if_clauses_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18131,7 +18131,7 @@ for_if_clauses_rule(Parser *p) static comprehension_ty for_if_clause_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18277,7 +18277,7 @@ for_if_clause_rule(Parser *p) static expr_ty listcomp_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18366,7 +18366,7 @@ listcomp_rule(Parser *p) static expr_ty setcomp_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18457,7 +18457,7 @@ setcomp_rule(Parser *p) static expr_ty genexp_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18546,7 +18546,7 @@ genexp_rule(Parser *p) static expr_ty dictcomp_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18661,7 +18661,7 @@ dictcomp_rule(Parser *p) static expr_ty arguments_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18736,7 +18736,7 @@ arguments_rule(Parser *p) static expr_ty args_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18836,7 +18836,7 @@ args_rule(Parser *p) static asdl_seq* kwargs_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -18926,7 +18926,7 @@ kwargs_rule(Parser *p) static expr_ty starred_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19028,7 +19028,7 @@ starred_expression_rule(Parser *p) static KeywordOrStarred* kwarg_or_starred_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19138,7 +19138,7 @@ kwarg_or_starred_rule(Parser *p) static KeywordOrStarred* kwarg_or_double_starred_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19260,7 +19260,7 @@ kwarg_or_double_starred_rule(Parser *p) static expr_ty star_targets_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19354,7 +19354,7 @@ star_targets_rule(Parser *p) static asdl_expr_seq* star_targets_list_seq_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19401,7 +19401,7 @@ star_targets_list_seq_rule(Parser *p) static asdl_expr_seq* star_targets_tuple_seq_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19478,7 +19478,7 @@ star_targets_tuple_seq_rule(Parser *p) static expr_ty star_target_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19569,7 +19569,7 @@ star_target_rule(Parser *p) static expr_ty target_with_star_atom_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19710,7 +19710,7 @@ target_with_star_atom_rule(Parser *p) static expr_ty star_atom_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19870,7 +19870,7 @@ star_atom_rule(Parser *p) static expr_ty single_target_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -19964,7 +19964,7 @@ single_target_rule(Parser *p) static expr_ty single_subscript_attribute_target_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -20084,7 +20084,7 @@ static expr_ty t_primary_raw(Parser *); static expr_ty t_primary_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } expr_ty _res = NULL; @@ -20118,7 +20118,7 @@ t_primary_rule(Parser *p) static expr_ty t_primary_raw(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -20339,7 +20339,7 @@ t_primary_raw(Parser *p) static void * t_lookahead_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -20415,7 +20415,7 @@ t_lookahead_rule(Parser *p) static asdl_expr_seq* del_targets_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -20465,7 +20465,7 @@ del_targets_rule(Parser *p) static expr_ty del_target_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -20602,7 +20602,7 @@ del_target_rule(Parser *p) static expr_ty del_t_atom_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -20769,7 +20769,7 @@ del_t_atom_rule(Parser *p) static asdl_expr_seq* type_expressions_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -21013,7 +21013,7 @@ type_expressions_rule(Parser *p) static Token* func_type_comment_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -21106,7 +21106,7 @@ func_type_comment_rule(Parser *p) static void * invalid_arguments_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -21349,7 +21349,7 @@ invalid_arguments_rule(Parser *p) static void * invalid_kwarg_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -21495,7 +21495,7 @@ expression_without_invalid_rule(Parser *p) { int _prev_call_invalid = p->call_invalid_rules; p->call_invalid_rules = 0; - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -21614,7 +21614,7 @@ expression_without_invalid_rule(Parser *p) static void * invalid_legacy_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -21662,7 +21662,7 @@ invalid_legacy_expression_rule(Parser *p) static void * invalid_type_param_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -21754,7 +21754,7 @@ invalid_type_param_rule(Parser *p) static void * invalid_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22003,7 +22003,7 @@ invalid_expression_rule(Parser *p) static void * invalid_if_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22097,7 +22097,7 @@ invalid_if_expression_rule(Parser *p) static void * invalid_named_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22223,7 +22223,7 @@ invalid_named_expression_rule(Parser *p) static void * invalid_assignment_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22428,7 +22428,7 @@ invalid_assignment_rule(Parser *p) static expr_ty invalid_ann_assign_target_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22515,7 +22515,7 @@ invalid_ann_assign_target_rule(Parser *p) static void * invalid_raise_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22591,7 +22591,7 @@ invalid_raise_stmt_rule(Parser *p) static void * invalid_del_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22641,7 +22641,7 @@ invalid_del_stmt_rule(Parser *p) static void * invalid_assert_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22804,7 +22804,7 @@ invalid_assert_stmt_rule(Parser *p) static void * invalid_block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -22853,7 +22853,7 @@ invalid_block_rule(Parser *p) static void * invalid_comprehension_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23013,7 +23013,7 @@ invalid_comprehension_rule(Parser *p) static void * invalid_parameters_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23230,7 +23230,7 @@ invalid_parameters_rule(Parser *p) static void * invalid_default_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23279,7 +23279,7 @@ invalid_default_rule(Parser *p) static void * invalid_star_etc_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23421,7 +23421,7 @@ invalid_star_etc_rule(Parser *p) static void * invalid_kwds_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23536,7 +23536,7 @@ invalid_kwds_rule(Parser *p) static void * invalid_parameters_helper_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23604,7 +23604,7 @@ invalid_parameters_helper_rule(Parser *p) static void * invalid_lambda_parameters_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23823,7 +23823,7 @@ invalid_lambda_parameters_rule(Parser *p) static void * invalid_lambda_parameters_helper_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -23888,7 +23888,7 @@ invalid_lambda_parameters_helper_rule(Parser *p) static void * invalid_lambda_star_etc_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24003,7 +24003,7 @@ invalid_lambda_star_etc_rule(Parser *p) static void * invalid_lambda_kwds_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24118,7 +24118,7 @@ invalid_lambda_kwds_rule(Parser *p) static void * invalid_double_type_comments_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24173,7 +24173,7 @@ invalid_double_type_comments_rule(Parser *p) static void * invalid_with_item_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24224,7 +24224,7 @@ invalid_with_item_rule(Parser *p) static void * invalid_for_if_clause_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24276,7 +24276,7 @@ invalid_for_if_clause_rule(Parser *p) static void * invalid_for_target_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24326,7 +24326,7 @@ invalid_for_target_rule(Parser *p) static void * invalid_group_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24408,7 +24408,7 @@ invalid_group_rule(Parser *p) static void * invalid_import_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24487,7 +24487,7 @@ invalid_import_rule(Parser *p) static void * invalid_dotted_as_name_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24538,7 +24538,7 @@ invalid_dotted_as_name_rule(Parser *p) static void * invalid_import_from_as_name_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24590,7 +24590,7 @@ invalid_import_from_as_name_rule(Parser *p) static void * invalid_import_from_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24648,7 +24648,7 @@ invalid_import_from_rule(Parser *p) static void * invalid_import_from_targets_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24724,7 +24724,7 @@ invalid_import_from_targets_rule(Parser *p) static void * invalid_with_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24860,7 +24860,7 @@ invalid_with_stmt_rule(Parser *p) static void * invalid_with_stmt_indent_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -24971,7 +24971,7 @@ invalid_with_stmt_indent_rule(Parser *p) static void * invalid_try_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25150,7 +25150,7 @@ invalid_try_stmt_rule(Parser *p) static void * invalid_except_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25315,7 +25315,7 @@ invalid_except_stmt_rule(Parser *p) static void * invalid_except_star_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25488,7 +25488,7 @@ invalid_except_star_stmt_rule(Parser *p) static void * invalid_finally_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25541,7 +25541,7 @@ invalid_finally_stmt_rule(Parser *p) static void * invalid_except_stmt_indent_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25632,7 +25632,7 @@ invalid_except_stmt_indent_rule(Parser *p) static void * invalid_except_star_stmt_indent_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25696,7 +25696,7 @@ invalid_except_star_stmt_indent_rule(Parser *p) static void * invalid_match_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25819,7 +25819,7 @@ invalid_match_stmt_rule(Parser *p) static void * invalid_case_block_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25911,7 +25911,7 @@ invalid_case_block_rule(Parser *p) static void * invalid_as_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -25990,7 +25990,7 @@ invalid_as_pattern_rule(Parser *p) static void * invalid_class_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26040,7 +26040,7 @@ invalid_class_pattern_rule(Parser *p) static void * invalid_mapping_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26104,7 +26104,7 @@ invalid_mapping_pattern_rule(Parser *p) static asdl_pattern_seq* invalid_class_argument_pattern_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26159,7 +26159,7 @@ invalid_class_argument_pattern_rule(Parser *p) static void * invalid_if_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26245,7 +26245,7 @@ invalid_if_stmt_rule(Parser *p) static void * invalid_elif_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26329,7 +26329,7 @@ invalid_elif_stmt_rule(Parser *p) static void * invalid_else_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26415,7 +26415,7 @@ invalid_else_stmt_rule(Parser *p) static void * invalid_while_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26501,7 +26501,7 @@ invalid_while_stmt_rule(Parser *p) static void * invalid_for_stmt_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26607,7 +26607,7 @@ invalid_for_stmt_rule(Parser *p) static void * invalid_def_raw_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26739,7 +26739,7 @@ invalid_def_raw_rule(Parser *p) static void * invalid_class_def_raw_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26842,7 +26842,7 @@ invalid_class_def_raw_rule(Parser *p) static void * invalid_double_starred_kvpairs_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -26943,7 +26943,7 @@ invalid_double_starred_kvpairs_rule(Parser *p) static void * invalid_kvpair_unpacking_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -27125,7 +27125,7 @@ invalid_kvpair_unpacking_rule(Parser *p) static void * invalid_kvpair_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -27265,7 +27265,7 @@ invalid_kvpair_rule(Parser *p) static void * invalid_starred_expression_unpacking_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -27346,7 +27346,7 @@ invalid_starred_expression_unpacking_rule(Parser *p) static void * invalid_starred_expression_unpacking_sequence_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -27411,7 +27411,7 @@ invalid_starred_expression_unpacking_sequence_rule(Parser *p) static void * invalid_starred_expression_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -27465,7 +27465,7 @@ invalid_starred_expression_rule(Parser *p) static void * invalid_fstring_replacement_field_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -27825,7 +27825,7 @@ invalid_fstring_replacement_field_rule(Parser *p) static void * invalid_fstring_conversion_character_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -27907,7 +27907,7 @@ invalid_fstring_conversion_character_rule(Parser *p) static void * invalid_tstring_replacement_field_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28267,7 +28267,7 @@ invalid_tstring_replacement_field_rule(Parser *p) static void * invalid_tstring_conversion_character_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28340,7 +28340,7 @@ invalid_tstring_conversion_character_rule(Parser *p) static void * invalid_string_tstring_concat_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28414,7 +28414,7 @@ invalid_string_tstring_concat_rule(Parser *p) static void * invalid_arithmetic_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28466,7 +28466,7 @@ invalid_arithmetic_rule(Parser *p) static void * invalid_factor_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28515,7 +28515,7 @@ invalid_factor_rule(Parser *p) static void * invalid_type_params_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28562,7 +28562,7 @@ invalid_type_params_rule(Parser *p) static void * invalid_bitwise_and_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28612,7 +28612,7 @@ invalid_bitwise_and_rule(Parser *p) static void * invalid_bitwise_or_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28661,7 +28661,7 @@ invalid_bitwise_or_rule(Parser *p) static asdl_seq * _loop0_1_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28728,7 +28728,7 @@ _loop0_1_rule(Parser *p) static asdl_seq * _loop1_2_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28800,7 +28800,7 @@ _loop1_2_rule(Parser *p) static asdl_seq * _loop0_3_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28876,7 +28876,7 @@ _loop0_3_rule(Parser *p) static asdl_seq * _gather_4_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28917,7 +28917,7 @@ _gather_4_rule(Parser *p) static void * _tmp_5_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -28993,7 +28993,7 @@ _tmp_5_rule(Parser *p) static void * _tmp_6_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29069,7 +29069,7 @@ _tmp_6_rule(Parser *p) static void * _tmp_7_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29126,7 +29126,7 @@ _tmp_7_rule(Parser *p) static void * _tmp_8_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29183,7 +29183,7 @@ _tmp_8_rule(Parser *p) static void * _tmp_9_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29240,7 +29240,7 @@ _tmp_9_rule(Parser *p) static void * _tmp_10_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29286,7 +29286,7 @@ _tmp_10_rule(Parser *p) static void * _tmp_11_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29354,7 +29354,7 @@ _tmp_11_rule(Parser *p) static asdl_seq * _loop1_12_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29426,7 +29426,7 @@ _loop1_12_rule(Parser *p) static asdl_seq * _loop0_13_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29502,7 +29502,7 @@ _loop0_13_rule(Parser *p) static asdl_seq * _gather_14_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29543,7 +29543,7 @@ _gather_14_rule(Parser *p) static void * _tmp_15_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29600,7 +29600,7 @@ _tmp_15_rule(Parser *p) static void * _tmp_16_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29646,7 +29646,7 @@ _tmp_16_rule(Parser *p) static asdl_seq * _loop0_17_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29713,7 +29713,7 @@ _loop0_17_rule(Parser *p) static asdl_seq * _loop1_18_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29785,7 +29785,7 @@ _loop1_18_rule(Parser *p) static asdl_seq * _loop0_19_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29861,7 +29861,7 @@ _loop0_19_rule(Parser *p) static asdl_seq * _gather_20_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29902,7 +29902,7 @@ _gather_20_rule(Parser *p) static void * _tmp_21_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -29948,7 +29948,7 @@ _tmp_21_rule(Parser *p) static asdl_seq * _loop0_22_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30024,7 +30024,7 @@ _loop0_22_rule(Parser *p) static asdl_seq * _gather_23_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30065,7 +30065,7 @@ _gather_23_rule(Parser *p) static asdl_seq * _loop1_24_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30137,7 +30137,7 @@ _loop1_24_rule(Parser *p) static void * _tmp_25_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30186,7 +30186,7 @@ _tmp_25_rule(Parser *p) static void * _tmp_26_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30232,7 +30232,7 @@ _tmp_26_rule(Parser *p) static asdl_seq * _loop0_27_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30299,7 +30299,7 @@ _loop0_27_rule(Parser *p) static asdl_seq * _loop0_28_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30366,7 +30366,7 @@ _loop0_28_rule(Parser *p) static asdl_seq * _loop1_29_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30438,7 +30438,7 @@ _loop1_29_rule(Parser *p) static asdl_seq * _loop1_30_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30510,7 +30510,7 @@ _loop1_30_rule(Parser *p) static asdl_seq * _loop0_31_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30577,7 +30577,7 @@ _loop0_31_rule(Parser *p) static asdl_seq * _loop1_32_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30649,7 +30649,7 @@ _loop1_32_rule(Parser *p) static asdl_seq * _loop0_33_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30725,7 +30725,7 @@ _loop0_33_rule(Parser *p) static asdl_seq * _gather_34_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30766,7 +30766,7 @@ _gather_34_rule(Parser *p) static void * _tmp_35_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30842,7 +30842,7 @@ _tmp_35_rule(Parser *p) static asdl_seq * _loop1_36_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30914,7 +30914,7 @@ _loop1_36_rule(Parser *p) static asdl_seq * _loop1_37_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -30986,7 +30986,7 @@ _loop1_37_rule(Parser *p) static asdl_seq * _loop1_38_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31058,7 +31058,7 @@ _loop1_38_rule(Parser *p) static asdl_seq * _loop0_39_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31134,7 +31134,7 @@ _loop0_39_rule(Parser *p) static asdl_seq * _gather_40_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31175,7 +31175,7 @@ _gather_40_rule(Parser *p) static void * _tmp_41_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31232,7 +31232,7 @@ _tmp_41_rule(Parser *p) static void * _tmp_42_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31308,7 +31308,7 @@ _tmp_42_rule(Parser *p) static void * _tmp_43_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31384,7 +31384,7 @@ _tmp_43_rule(Parser *p) static asdl_seq * _loop0_44_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31460,7 +31460,7 @@ _loop0_44_rule(Parser *p) static asdl_seq * _gather_45_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31501,7 +31501,7 @@ _gather_45_rule(Parser *p) static asdl_seq * _loop0_46_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31577,7 +31577,7 @@ _loop0_46_rule(Parser *p) static asdl_seq * _gather_47_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31618,7 +31618,7 @@ _gather_47_rule(Parser *p) static void * _tmp_48_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31675,7 +31675,7 @@ _tmp_48_rule(Parser *p) static asdl_seq * _loop0_49_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31751,7 +31751,7 @@ _loop0_49_rule(Parser *p) static asdl_seq * _gather_50_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31792,7 +31792,7 @@ _gather_50_rule(Parser *p) static asdl_seq * _loop0_51_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31868,7 +31868,7 @@ _loop0_51_rule(Parser *p) static asdl_seq * _gather_52_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31909,7 +31909,7 @@ _gather_52_rule(Parser *p) static asdl_seq * _loop0_53_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -31985,7 +31985,7 @@ _loop0_53_rule(Parser *p) static asdl_seq * _gather_54_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32026,7 +32026,7 @@ _gather_54_rule(Parser *p) static asdl_seq * _loop1_55_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32098,7 +32098,7 @@ _loop1_55_rule(Parser *p) static asdl_seq * _loop1_56_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32170,7 +32170,7 @@ _loop1_56_rule(Parser *p) static asdl_seq * _loop0_57_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32246,7 +32246,7 @@ _loop0_57_rule(Parser *p) static asdl_seq * _gather_58_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32287,7 +32287,7 @@ _gather_58_rule(Parser *p) static asdl_seq * _loop0_59_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32363,7 +32363,7 @@ _loop0_59_rule(Parser *p) static asdl_seq * _gather_60_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32404,7 +32404,7 @@ _gather_60_rule(Parser *p) static asdl_seq * _loop1_61_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32476,7 +32476,7 @@ _loop1_61_rule(Parser *p) static asdl_seq * _loop1_62_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32548,7 +32548,7 @@ _loop1_62_rule(Parser *p) static asdl_seq * _loop1_63_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32620,7 +32620,7 @@ _loop1_63_rule(Parser *p) static void * _tmp_64_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32663,7 +32663,7 @@ _tmp_64_rule(Parser *p) static asdl_seq * _loop0_65_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32739,7 +32739,7 @@ _loop0_65_rule(Parser *p) static asdl_seq * _gather_66_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32780,7 +32780,7 @@ _gather_66_rule(Parser *p) static void * _tmp_67_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32826,7 +32826,7 @@ _tmp_67_rule(Parser *p) static void * _tmp_68_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32902,7 +32902,7 @@ _tmp_68_rule(Parser *p) static void * _tmp_69_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -32959,7 +32959,7 @@ _tmp_69_rule(Parser *p) static void * _tmp_70_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33054,7 +33054,7 @@ _tmp_70_rule(Parser *p) static void * _tmp_71_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33111,7 +33111,7 @@ _tmp_71_rule(Parser *p) static asdl_seq * _loop0_72_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33178,7 +33178,7 @@ _loop0_72_rule(Parser *p) static asdl_seq * _loop0_73_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33245,7 +33245,7 @@ _loop0_73_rule(Parser *p) static asdl_seq * _loop1_74_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33317,7 +33317,7 @@ _loop1_74_rule(Parser *p) static asdl_seq * _loop1_75_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33389,7 +33389,7 @@ _loop1_75_rule(Parser *p) static asdl_seq * _loop0_76_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33456,7 +33456,7 @@ _loop0_76_rule(Parser *p) static asdl_seq * _loop1_77_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33528,7 +33528,7 @@ _loop1_77_rule(Parser *p) static asdl_seq * _loop0_78_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33595,7 +33595,7 @@ _loop0_78_rule(Parser *p) static asdl_seq * _loop0_79_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33662,7 +33662,7 @@ _loop0_79_rule(Parser *p) static asdl_seq * _loop0_80_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33729,7 +33729,7 @@ _loop0_80_rule(Parser *p) static asdl_seq * _loop0_81_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33796,7 +33796,7 @@ _loop0_81_rule(Parser *p) static asdl_seq * _loop1_82_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33868,7 +33868,7 @@ _loop1_82_rule(Parser *p) static asdl_seq * _loop1_83_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33940,7 +33940,7 @@ _loop1_83_rule(Parser *p) static void * _tmp_84_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -33989,7 +33989,7 @@ _tmp_84_rule(Parser *p) static asdl_seq * _loop0_85_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34065,7 +34065,7 @@ _loop0_85_rule(Parser *p) static asdl_seq * _gather_86_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34106,7 +34106,7 @@ _gather_86_rule(Parser *p) static asdl_seq * _loop1_87_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34178,7 +34178,7 @@ _loop1_87_rule(Parser *p) static asdl_seq * _loop0_88_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34245,7 +34245,7 @@ _loop0_88_rule(Parser *p) static void * _tmp_89_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34323,7 +34323,7 @@ _tmp_89_rule(Parser *p) static asdl_seq * _loop0_90_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34400,7 +34400,7 @@ _loop0_90_rule(Parser *p) static asdl_seq * _gather_91_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34441,7 +34441,7 @@ _gather_91_rule(Parser *p) static void * _tmp_92_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34487,7 +34487,7 @@ _tmp_92_rule(Parser *p) static asdl_seq * _loop0_93_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34563,7 +34563,7 @@ _loop0_93_rule(Parser *p) static asdl_seq * _gather_94_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34604,7 +34604,7 @@ _gather_94_rule(Parser *p) static asdl_seq * _loop0_95_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34680,7 +34680,7 @@ _loop0_95_rule(Parser *p) static asdl_seq * _gather_96_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34721,7 +34721,7 @@ _gather_96_rule(Parser *p) static asdl_seq * _loop0_97_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34788,7 +34788,7 @@ _loop0_97_rule(Parser *p) static asdl_seq * _loop0_98_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34864,7 +34864,7 @@ _loop0_98_rule(Parser *p) static asdl_seq * _gather_99_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34905,7 +34905,7 @@ _gather_99_rule(Parser *p) static asdl_seq * _loop1_100_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -34977,7 +34977,7 @@ _loop1_100_rule(Parser *p) static void * _tmp_101_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35017,7 +35017,7 @@ _tmp_101_rule(Parser *p) static asdl_seq * _loop0_102_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35093,7 +35093,7 @@ _loop0_102_rule(Parser *p) static asdl_seq * _gather_103_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35134,7 +35134,7 @@ _gather_103_rule(Parser *p) static asdl_seq * _loop0_104_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35210,7 +35210,7 @@ _loop0_104_rule(Parser *p) static asdl_seq * _gather_105_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35251,7 +35251,7 @@ _gather_105_rule(Parser *p) static void * _tmp_106_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35294,7 +35294,7 @@ _tmp_106_rule(Parser *p) static void * _tmp_107_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35351,7 +35351,7 @@ _tmp_107_rule(Parser *p) static asdl_seq * _loop0_108_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35427,7 +35427,7 @@ _loop0_108_rule(Parser *p) static asdl_seq * _gather_109_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35468,7 +35468,7 @@ _gather_109_rule(Parser *p) static void * _tmp_110_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35528,7 +35528,7 @@ _tmp_110_rule(Parser *p) static void * _tmp_111_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35569,7 +35569,7 @@ _tmp_111_rule(Parser *p) static void * _tmp_112_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35626,7 +35626,7 @@ _tmp_112_rule(Parser *p) static void * _tmp_113_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35702,7 +35702,7 @@ _tmp_113_rule(Parser *p) static void * _tmp_114_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35743,7 +35743,7 @@ _tmp_114_rule(Parser *p) static asdl_seq * _loop1_115_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35815,7 +35815,7 @@ _loop1_115_rule(Parser *p) static void * _tmp_116_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35875,7 +35875,7 @@ _tmp_116_rule(Parser *p) static void * _tmp_117_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -35932,7 +35932,7 @@ _tmp_117_rule(Parser *p) static void * _tmp_118_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36008,7 +36008,7 @@ _tmp_118_rule(Parser *p) static void * _tmp_119_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36065,7 +36065,7 @@ _tmp_119_rule(Parser *p) static void * _tmp_120_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36198,7 +36198,7 @@ _tmp_120_rule(Parser *p) static asdl_seq * _loop0_121_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36265,7 +36265,7 @@ _loop0_121_rule(Parser *p) static asdl_seq * _loop0_122_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36332,7 +36332,7 @@ _loop0_122_rule(Parser *p) static void * _tmp_123_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36389,7 +36389,7 @@ _tmp_123_rule(Parser *p) static void * _tmp_124_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36446,7 +36446,7 @@ _tmp_124_rule(Parser *p) static void * _tmp_125_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36503,7 +36503,7 @@ _tmp_125_rule(Parser *p) static void * _tmp_126_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36560,7 +36560,7 @@ _tmp_126_rule(Parser *p) static void * _tmp_127_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36620,7 +36620,7 @@ _tmp_127_rule(Parser *p) static void * _tmp_128_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36677,7 +36677,7 @@ _tmp_128_rule(Parser *p) static void * _tmp_129_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36753,7 +36753,7 @@ _tmp_129_rule(Parser *p) static void * _tmp_130_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36810,7 +36810,7 @@ _tmp_130_rule(Parser *p) static asdl_seq * _loop0_131_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36886,7 +36886,7 @@ _loop0_131_rule(Parser *p) static asdl_seq * _gather_132_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36927,7 +36927,7 @@ _gather_132_rule(Parser *p) static void * _tmp_133_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -36984,7 +36984,7 @@ _tmp_133_rule(Parser *p) static void * _tmp_134_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37044,7 +37044,7 @@ _tmp_134_rule(Parser *p) static void * _tmp_135_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37101,7 +37101,7 @@ _tmp_135_rule(Parser *p) static void * _tmp_136_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37146,7 +37146,7 @@ _tmp_136_rule(Parser *p) static asdl_seq * _loop0_137_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37222,7 +37222,7 @@ _loop0_137_rule(Parser *p) static asdl_seq * _gather_138_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37263,7 +37263,7 @@ _gather_138_rule(Parser *p) static void * _tmp_139_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37304,7 +37304,7 @@ _tmp_139_rule(Parser *p) static asdl_seq * _loop0_140_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37380,7 +37380,7 @@ _loop0_140_rule(Parser *p) static asdl_seq * _gather_141_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37421,7 +37421,7 @@ _gather_141_rule(Parser *p) static asdl_seq * _loop0_142_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37497,7 +37497,7 @@ _loop0_142_rule(Parser *p) static asdl_seq * _gather_143_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37538,7 +37538,7 @@ _gather_143_rule(Parser *p) static void * _tmp_144_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37595,7 +37595,7 @@ _tmp_144_rule(Parser *p) static asdl_seq * _loop0_145_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37662,7 +37662,7 @@ _loop0_145_rule(Parser *p) static void * _tmp_146_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37704,7 +37704,7 @@ _tmp_146_rule(Parser *p) static void * _tmp_147_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37761,7 +37761,7 @@ _tmp_147_rule(Parser *p) static void * _tmp_148_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37802,7 +37802,7 @@ _tmp_148_rule(Parser *p) static void * _tmp_149_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37843,7 +37843,7 @@ _tmp_149_rule(Parser *p) static void * _tmp_150_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37900,7 +37900,7 @@ _tmp_150_rule(Parser *p) static void * _tmp_151_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -37957,7 +37957,7 @@ _tmp_151_rule(Parser *p) static void * _tmp_152_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38052,7 +38052,7 @@ _tmp_152_rule(Parser *p) static void * _tmp_153_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38128,7 +38128,7 @@ _tmp_153_rule(Parser *p) static void * _tmp_154_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38169,7 +38169,7 @@ _tmp_154_rule(Parser *p) static void * _tmp_155_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38226,7 +38226,7 @@ _tmp_155_rule(Parser *p) static void * _tmp_156_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38283,7 +38283,7 @@ _tmp_156_rule(Parser *p) static void * _tmp_157_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38435,7 +38435,7 @@ _tmp_157_rule(Parser *p) static void * _tmp_158_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38511,7 +38511,7 @@ _tmp_158_rule(Parser *p) static void * _tmp_159_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38557,7 +38557,7 @@ _tmp_159_rule(Parser *p) static void * _tmp_160_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38614,7 +38614,7 @@ _tmp_160_rule(Parser *p) static void * _tmp_161_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38663,7 +38663,7 @@ _tmp_161_rule(Parser *p) static void * _tmp_162_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38709,7 +38709,7 @@ _tmp_162_rule(Parser *p) static void * _tmp_163_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38755,7 +38755,7 @@ _tmp_163_rule(Parser *p) static void * _tmp_164_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38801,7 +38801,7 @@ _tmp_164_rule(Parser *p) static void * _tmp_165_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38858,7 +38858,7 @@ _tmp_165_rule(Parser *p) static void * _tmp_166_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38904,7 +38904,7 @@ _tmp_166_rule(Parser *p) static void * _tmp_167_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -38963,7 +38963,7 @@ _tmp_167_rule(Parser *p) static void * _tmp_168_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39010,7 +39010,7 @@ _tmp_168_rule(Parser *p) static void * _tmp_169_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39054,7 +39054,7 @@ _tmp_169_rule(Parser *p) static void * _tmp_170_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39094,7 +39094,7 @@ _tmp_170_rule(Parser *p) static void * _tmp_171_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39134,7 +39134,7 @@ _tmp_171_rule(Parser *p) static void * _tmp_172_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39191,7 +39191,7 @@ _tmp_172_rule(Parser *p) static void * _tmp_173_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39248,7 +39248,7 @@ _tmp_173_rule(Parser *p) static asdl_seq * _loop0_174_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39315,7 +39315,7 @@ _loop0_174_rule(Parser *p) static void * _tmp_175_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39410,7 +39410,7 @@ _tmp_175_rule(Parser *p) static void * _tmp_176_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39452,7 +39452,7 @@ _tmp_176_rule(Parser *p) static void * _tmp_177_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39494,7 +39494,7 @@ _tmp_177_rule(Parser *p) static void * _tmp_178_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39553,7 +39553,7 @@ _tmp_178_rule(Parser *p) static void * _tmp_179_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { @@ -39594,7 +39594,7 @@ _tmp_179_rule(Parser *p) static void * _tmp_180_rule(Parser *p) { - if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) { + if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) { _Pypegen_stack_overflow(p); } if (p->error_indicator) { diff --git a/Parser/pegen.c b/Parser/pegen.c index 165dcb9f9950955..ed361beb27cf916 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -844,6 +844,12 @@ _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->tstate = PyThreadState_Get(); + // Force the stack limits to be initialized before caching them. + (void)_Py_ReachedRecursionLimitWithMargin(p->tstate, 1); + p->stack_soft_limit = + ((_PyThreadStateImpl *)p->tstate)->c_stack_soft_limit + + _PyOS_STACK_MARGIN_BYTES; p->level = 0; p->call_invalid_rules = 0; p->last_stmt_location.lineno = 0; diff --git a/Parser/pegen.h b/Parser/pegen.h index cbf44ba474fa395..4986475045bb838 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -4,6 +4,9 @@ #include #include #include +#include // _Py_ReachedRecursionLimitWithMargin() +#include // _Py_get_machine_stack_pointer() +#include // _PyOS_STACK_MARGIN_BYTES #include "lexer/state.h" @@ -91,8 +94,30 @@ typedef struct { int call_invalid_rules; int debug; location last_stmt_location; + PyThreadState *tstate; + // Cached copy of tstate->c_stack_soft_limit plus one margin, so the + // per-rule stack check is a single inline comparison. + uintptr_t stack_soft_limit; } Parser; +// C-stack exhaustion check run on every rule entry. The fast path compares +// the machine stack pointer against the soft limit cached in the Parser; +// only when the stack is nearly exhausted is the full check called. +static inline int +_PyPegen_stack_exhausted(Parser *p) +{ +#if _Py_STACK_GROWS_DOWN + if (_Py_get_machine_stack_pointer() > p->stack_soft_limit) { + return 0; + } +#else + if (_Py_get_machine_stack_pointer() <= p->stack_soft_limit) { + return 0; + } +#endif + return _Py_ReachedRecursionLimitWithMargin(p->tstate, 1); +} + typedef struct { cmpop_ty cmpop; expr_ty expr; diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index d9236dfb22835bd..fb145d57e17f230 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -396,7 +396,7 @@ def __init__( self.cleanup_statements: list[str] = [] def add_level(self) -> None: - self.print("if (p->level++ == MAXSTACK || _Py_ReachedRecursionLimitWithMargin(PyThreadState_Get(), 1)) {") + self.print("if (p->level++ == MAXSTACK || _PyPegen_stack_exhausted(p)) {") with self.indent(): self.print("_Pypegen_stack_overflow(p);") self.print("}")