def __init__(self, code, value, start=(0,0), stop=(0,0), line=''):
"""
Args:
code (string|int): Token code. Ints are translated using token.tok_name.
value (string): Token value
start (tuple): Pair of values describing token start line, start position
stop (tuple): Pair of values describing token stop line, stop position
line (string): String containing the line the token was parsed from
"""
try:
self.code = token.tok_name[code]
except:
self.code = code
self.value = value
self.start = start
self.stop = stop
self.line = line
评论列表
文章目录