1
0
forked from VimPlug/jedi

Trying to remove token from pgen2.

This commit is contained in:
Dave Halter
2014-12-15 17:36:15 +01:00
parent 491b4ad76d
commit 955f125c0d
2 changed files with 17 additions and 17 deletions

View File

@@ -15,7 +15,7 @@ how this parsing engine works.
"""
# Local imports
from . import token
from jedi.parser import tokenize
class ParseError(Exception):
@@ -131,7 +131,7 @@ class PgenParser(object):
ilabel = self.classify(type, value, start_pos)
except ParseError:
# Currently we ignore tokens like `?`.
print('invalid token', token.tok_name[type], value)
print('invalid token', tokenize.tok_name[type], value)
return
# Loop until the token is shifted; may raise exceptions
@@ -180,7 +180,7 @@ class PgenParser(object):
def classify(self, type, value, start_pos):
"""Turn a token into a label. (Internal)"""
if type == token.NAME:
if type == tokenize.NAME:
# Check for reserved words
ilabel = self.grammar.keywords.get(value)
if ilabel is not None: