You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
scanner26.py: make scanner2.py and scanner26.py more alike scanner2.py: check that return stmt is last in list. (May change) main.py: show filename on verify error test/*: add more
19 lines
560 B
Python
19 lines
560 B
Python
# Bug was using continue fouling up 1st elif, by confusing
|
|
# the "pass" for "continue" by not recognizing the if jump
|
|
# around it. We fixed by ignoring what's done in Python 2.7
|
|
# Better is better detection of control structures
|
|
|
|
def _compile_charset(charset, flags, code, fixup=None):
|
|
# compile charset subprogram
|
|
emit = code.append
|
|
if fixup is None:
|
|
fixup = 1
|
|
for op, av in charset:
|
|
if op is flags:
|
|
pass
|
|
elif op is code:
|
|
emit(fixup(av))
|
|
else:
|
|
raise RuntimeError
|
|
emit(5)
|