mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Allow the parser to avoid nested processing of invalid rules (GH-31252)
This commit is contained in:
parent
2cea8c29cf
commit
390459de6d
6 changed files with 1998 additions and 1997 deletions
|
@ -381,6 +381,7 @@ _PyPegen_expect_token(Parser *p, int type)
|
|||
}
|
||||
Token *t = p->tokens[p->mark];
|
||||
if (t->type != type) {
|
||||
if (Py_DebugFlag) fprintf(stderr, "Token = %s\n", PyBytes_AsString(t->bytes));
|
||||
return NULL;
|
||||
}
|
||||
p->mark += 1;
|
||||
|
@ -785,7 +786,6 @@ _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int flags,
|
|||
p->known_err_token = NULL;
|
||||
p->level = 0;
|
||||
p->call_invalid_rules = 0;
|
||||
p->in_raw_rule = 0;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue