1
0
forked from VimPlug/jedi

Use used_names not in pgen2, but only in our parser.

This commit is contained in:
Dave Halter
2014-10-22 15:50:02 +02:00
parent e2a07752fd
commit e9f4c60e49
3 changed files with 7 additions and 7 deletions

View File

@@ -97,7 +97,6 @@ class Parser(object):
stackentry = (self.grammar.dfas[start], 0, newnode)
self.stack = [stackentry]
self.rootnode = None
self.used_names = set() # Aliased to self.rootnode.used_names in pop()
def addtoken(self, type, value, context):
"""Add a token; return True iff this is the end of the program."""
@@ -149,8 +148,6 @@ class Parser(object):
def classify(self, type, value, context):
"""Turn a token into a label. (Internal)"""
if type == token.NAME:
# Keep a listing of all used names
self.used_names.add(value)
# Check for reserved words
ilabel = self.grammar.keywords.get(value)
if ilabel is not None:
@@ -186,7 +183,6 @@ class Parser(object):
node[-1].append(newnode)
else:
self.rootnode = newnode
self.rootnode.used_names = self.used_names
def error_recovery(self, type, value, context):
"""