From 3218367c65c967a54b2a85db4479778958e2ae2e Mon Sep 17 00:00:00 2001 From: John Doty Date: Wed, 21 Mar 2018 20:13:18 -0700 Subject: [PATCH] Fix some lints --- parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parser.py b/parser.py index 24fb258..656ef09 100644 --- a/parser.py +++ b/parser.py @@ -133,13 +133,13 @@ class GenerateLR0(object): # rule, and in the set of states and table and whatever the first # element is always the starting state/position. self.grammar = [('__start', [start])] + grammar - self.nonterminals = set(rule[0] for rule in grammar) - self.terminals = set( + self.nonterminals = {rule[0] for rule in grammar} + self.terminals = { sym for name, symbols in grammar for sym in symbols if sym not in self.nonterminals - ) + } self.alphabet = self.terminals | self.nonterminals # Check to make sure they didn't use anything that will give us