Show line numbers in 2.6 "after" asm ..

start to understand some of the Python 2.6 bytecode parse failures.
This commit is contained in:
rocky
2016-11-14 00:30:23 -05:00
parent b6e53205dd
commit 6073c77921
2 changed files with 7 additions and 2 deletions

View File

@@ -877,8 +877,13 @@ class Scanner2(scan.Scanner):
and ((self.code[offset+3] == self.opc.END_FINALLY)
or (self.code[offset+3] == self.opc.POP_TOP
and self.code[offset+4] == self.opc.END_FINALLY))):
# FIXME: rocky: I think we need something like this...
# if offset not in set(self.ignore_if):
# targets[label] = targets.get(label, []) + [offset]
targets[label] = targets.get(label, []) + [offset]
pass
pass
pass
elif op == self.opc.END_FINALLY and offset in self.fixed_jumps and self.version == 2.7:

View File

@@ -279,9 +279,9 @@ class Scanner26(scan.Scanner2):
pass
pass
if show_asm:
if show_asm in ('both', 'after'):
for t in tokens:
print(t)
print(t.format(line_prefix='L.'))
print()
return tokens, customize