summaryrefslogtreecommitdiffstats
path: root/Parser/pgen
diff options
context:
space:
mode:
authortyomitch <tyomitch@gmail.com>2019-03-09 15:35:50 (GMT)
committerPablo Galindo <Pablogsal@gmail.com>2019-03-09 15:35:50 (GMT)
commit1b304f992ddfc1cc40758dd633bc6a2595399189 (patch)
treee396a399606beef20618b596c092714c1626bffb /Parser/pgen
parentd70a359adfdbe02538559cceaa0b459d055651be (diff)
downloadcpython-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 'Parser/pgen')
-rw-r--r--Parser/pgen/grammar.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/pgen/grammar.py b/Parser/pgen/grammar.py
index 05a37d6..340bf64 100644
--- a/Parser/pgen/grammar.py
+++ b/Parser/pgen/grammar.py
@@ -97,7 +97,7 @@ class Grammar:
' {{{dfa_symbol}, "{symbol_name}", '.format(
dfa_symbol=symbol, symbol_name=self.number2symbol[symbol]
)
- + "0, {n_states}, states_{dfa_index},\n".format(
+ + "{n_states}, states_{dfa_index},\n".format(
n_states=len(dfa), dfa_index=dfaindex
)
+ ' "'