diff options
author | tyomitch <tyomitch@gmail.com> | 2019-03-09 15:35:50 (GMT) |
---|---|---|
committer | Pablo Galindo <Pablogsal@gmail.com> | 2019-03-09 15:35:50 (GMT) |
commit | 1b304f992ddfc1cc40758dd633bc6a2595399189 (patch) | |
tree | e396a399606beef20618b596c092714c1626bffb /Modules/parsermodule.c | |
parent | d70a359adfdbe02538559cceaa0b459d055651be (diff) | |
download | cpython-1b304f992ddfc1cc40758dd633bc6a2595399189.zip cpython-1b304f992ddfc1cc40758dd633bc6a2595399189.tar.gz cpython-1b304f992ddfc1cc40758dd633bc6a2595399189.tar.bz2 |
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.
Diffstat (limited to 'Modules/parsermodule.c')
-rw-r--r-- | Modules/parsermodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index d4e2be6..b0a749a 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -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); |