Show token number in parser error listing...

But only if -g is given
This commit is contained in:
rocky
2020-03-31 10:12:52 -04:00
parent 2b2e7d3242
commit 5fde4f2e05
8 changed files with 48 additions and 42 deletions

View File

@@ -5,7 +5,7 @@ from uncompyle6.scanners.tok import Token
def test_token():
# Test token formatting of: LOAD_CONST None
t = Token("LOAD_CONST", offset=0, attr=None, pattr=None, has_arg=True)
expect = " 0 LOAD_CONST None"
expect = " 0 LOAD_CONST None"
# print(t.format())
assert t
assert t.format() == expect
@@ -17,7 +17,7 @@ def test_token():
# Make sure formatting of: LOAD_CONST False. We assume False is the 0th index
# of co_consts.
t = Token("LOAD_CONST", offset=1, attr=False, pattr=False, has_arg=True)
expect = " 1 LOAD_CONST False"
expect = " 1 LOAD_CONST False"
assert t.format() == expect