remove unused Token and add parent attribute

Adding a parent attribute helped but wasn't working with amalgamated
xonsh -- turns out there's a separate Token definition in tokenize that
is never used but does redefine Token once it's hit -- this was causing
crashes on my end.
This commit is contained in:
Gil Forsyth 2017-02-06 15:43:21 -05:00
parent d728bf7673
commit 6ddfbe7691
2 changed files with 2 additions and 1 deletions

View file

@ -11,6 +11,8 @@ class _TokenType(tuple):
This class was forked from the mainline prompt-toolkit repo.
Copyright (c) 2014, Jonathan Slenders, All rights reserved.
"""
parent = None
def __getattr__(self, val):
if not val or not val[0].isupper():
return tuple.__getattribute__(self, val)

View file

@ -249,7 +249,6 @@ Special = group(r'\r?\n', r'\.\.\.', r'[:;.,@]')
Funny = group(Operator, Bracket, Special)
PlainToken = group(IORedirect, Number, Funny, String, Name_RE, SearchPath)
Token = Ignore + PlainToken
# First (or only) line of ' or " string.
ContStr = group(StringPrefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*" +