mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Remove d_initial from the parser as it is unused (GH-12212)
d_initial, the first state of a particular DFA in the parser has always been initialized to 0 in the old pgen as well as the new pgen. As this value is not used and the first state of each DFA is assumed to be the first element in the array representing it, remove d_initial from the parser to reduce complexity.
This commit is contained in:
parent
d70a359adf
commit
1b304f992d
4 changed files with 94 additions and 95 deletions
|
@ -662,7 +662,7 @@ validate_node(node *tree)
|
|||
REQ(tree, nt_dfa->d_type);
|
||||
|
||||
/* Run the DFA for this nonterminal. */
|
||||
dfa_state = &nt_dfa->d_state[nt_dfa->d_initial];
|
||||
dfa_state = nt_dfa->d_state;
|
||||
for (pos = 0; pos < nch; ++pos) {
|
||||
node *ch = CHILD(tree, pos);
|
||||
int ch_type = TYPE(ch);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue