Match Python 3.4's terms a little names better

This commit is contained in:
rocky
2017-09-10 00:48:54 -04:00
parent 4e1467adc8
commit 5bef5683e4
2 changed files with 4 additions and 5 deletions

View File

@@ -330,7 +330,7 @@ class Scanner3(Scanner):
attr = (pos_args, name_pair_args, annotate_args)
tokens.append(
Token(
type_ = opname,
opname = opname,
attr = attr,
pattr = pattr,
offset = inst.offset,
@@ -408,7 +408,7 @@ class Scanner3(Scanner):
last_op_was_break = opname == 'BREAK_LOOP'
tokens.append(
Token(
type_ = opname,
opname = opname,
attr = argval,
pattr = pattr,
offset = inst.offset,

View File

@@ -16,13 +16,12 @@ class Token():
the contents of one line as output by dis.dis().
"""
# FIXME: match Python 3.4's terms:
# type_ should be opname
# linestart = starts_line
# attr = argval
# pattr = argrepr
def __init__(self, type_, attr=None, pattr=None, offset=-1,
def __init__(self, opname, attr=None, pattr=None, offset=-1,
linestart=None, op=None, has_arg=None, opc=None):
self.type = intern(type_)
self.type = intern(opname)
self.op = op
self.has_arg = has_arg
self.attr = attr