Some Python 1.4 fixes

This commit is contained in:
rocky
2018-06-04 02:09:48 -04:00
parent 7dfade1195
commit 9d3e4a6660
2 changed files with 11 additions and 3 deletions

View File

@@ -622,11 +622,11 @@ def get_python_parser(
if version < 3.0:
if version < 2.2:
if version == 1.4:
import uncompyle6.parsers.parse15 as parse14
import uncompyle6.parsers.parse14 as parse14
if compile_mode == 'exec':
p = parse14.Python15Parser(debug_parser)
p = parse14.Python14Parser(debug_parser)
else:
p = parse14.Python15ParserSingle(debug_parser)
p = parse14.Python14ParserSingle(debug_parser)
elif version == 1.5:
import uncompyle6.parsers.parse15 as parse15
if compile_mode == 'exec':

View File

@@ -15,6 +15,14 @@ class Python14Parser(Python15Parser):
# FIXME: should check that this indeed around __doc__
stmt ::= doc_junk
doc_junk ::= LOAD_CONST POP_TOP
# Not sure why later Python's omit the COME_FROM
jb_pop14 ::= JUMP_BACK COME_FROM POP_TOP
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt
jb_pop14
POP_BLOCK else_suitel COME_FROM
"""
def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):