forked from VimPlug/jedi
Use used_names not in pgen2, but only in our parser.
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user