Fix some lints
This commit is contained in:
parent
a96c88a39e
commit
3218367c65
1 changed files with 3 additions and 3 deletions
|
|
@ -133,13 +133,13 @@ class GenerateLR0(object):
|
||||||
# rule, and in the set of states and table and whatever the first
|
# rule, and in the set of states and table and whatever the first
|
||||||
# element is always the starting state/position.
|
# element is always the starting state/position.
|
||||||
self.grammar = [('__start', [start])] + grammar
|
self.grammar = [('__start', [start])] + grammar
|
||||||
self.nonterminals = set(rule[0] for rule in grammar)
|
self.nonterminals = {rule[0] for rule in grammar}
|
||||||
self.terminals = set(
|
self.terminals = {
|
||||||
sym
|
sym
|
||||||
for name, symbols in grammar
|
for name, symbols in grammar
|
||||||
for sym in symbols
|
for sym in symbols
|
||||||
if sym not in self.nonterminals
|
if sym not in self.nonterminals
|
||||||
)
|
}
|
||||||
self.alphabet = self.terminals | self.nonterminals
|
self.alphabet = self.terminals | self.nonterminals
|
||||||
|
|
||||||
# Check to make sure they didn't use anything that will give us
|
# Check to make sure they didn't use anything that will give us
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue