summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Beazley <dave@dabeaz.com>2017-04-13 06:49:49 -0500
committerGitHub <noreply@github.com>2017-04-13 06:49:49 -0500
commit2da92886817ed637932daa7de09518421b0e5ef1 (patch)
treed39065f7778e125a1bb843094cfb4c46798c9999
parentdb00266e06e9cba45d64096c0477afdeec385bf4 (diff)
parenta813d9d76a4b67b0f6666c9933a59254a163d19b (diff)
downloadply-2da92886817ed637932daa7de09518421b0e5ef1.tar.gz
Merge pull request #116 from alberth/flakes_fixes
Fixes for problems reported by pyflakes3
-rw-r--r--ply/lex.py3
-rw-r--r--ply/yacc.py4
2 files changed, 1 insertions, 6 deletions
diff --git a/ply/lex.py b/ply/lex.py
index 3e240d1..eb003c2 100644
--- a/ply/lex.py
+++ b/ply/lex.py
@@ -531,7 +531,6 @@ def _form_master_re(relist, reflags, ldict, toknames):
# calling this with s = "t_foo_bar_SPAM" might return (('foo','bar'),'SPAM')
# -----------------------------------------------------------------------------
def _statetoken(s, names):
- nonstate = 1
parts = s.split('_')
for i, part in enumerate(parts[1:], 1):
if part not in names and part != 'ANY':
@@ -949,8 +948,6 @@ def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab',
# Add rules defined by functions first
for fname, f in linfo.funcsym[state]:
- line = f.__code__.co_firstlineno
- file = f.__code__.co_filename
regex_list.append('(?P<%s>%s)' % (fname, _get_regex(f)))
if debug:
debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", fname, _get_regex(f), state)
diff --git a/ply/yacc.py b/ply/yacc.py
index 03bd86e..772f195 100644
--- a/ply/yacc.py
+++ b/ply/yacc.py
@@ -64,7 +64,6 @@ import types
import sys
import os.path
import inspect
-import base64
import warnings
__version__ = '3.10'
@@ -1360,7 +1359,7 @@ class Production(object):
p = LRItem(self, n)
# Precompute the list of productions immediately following.
try:
- p.lr_after = Prodnames[p.prod[n+1]]
+ p.lr_after = self.Prodnames[p.prod[n+1]]
except (IndexError, KeyError):
p.lr_after = []
try:
@@ -2301,7 +2300,6 @@ class LRGeneratedTable(LRTable):
# -----------------------------------------------------------------------------
def dr_relation(self, C, trans, nullable):
- dr_set = {}
state, N = trans
terms = []