Better Python 1.4 support

This commit is contained in:
rocky
2018-06-03 03:21:15 -04:00
parent c06ba45991
commit 1df5aa0ef9
8 changed files with 27 additions and 14 deletions

View File

@@ -270,14 +270,14 @@ check-3.4-ok:
2.6:
#: PyPy 5.0.x with Python 2.7 ...
pypy-2.7 5.0 5.3:
pypy-2.7 5.0 5.3 6.0:
$(PYTHON) test_pythonlib.py --bytecode-pypy2.7 --verify
#: PyPy 2.4.x with Python 3.2 ...
pypy-3.2 2.4:
$(PYTHON) test_pythonlib.py --bytecode-pypy3.2 --verify
clean: clean-py-dis clean-dis clean-unverified
gclean: clean-py-dis clean-dis clean-unverified
clean-dis:
find . -name '*_dis' -exec rm -v '{}' ';'

Binary file not shown.

BIN
test/bytecode_1.4/cmp.pyc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
test/bytecode_1.4/glob.pyc Normal file

Binary file not shown.

View File

@@ -582,6 +582,8 @@ class PythonParser(GenericASTBuilder):
## designLists ::=
## Will need to redo semantic actiion
stmt ::= LOAD_CONST POP_TOP
store ::= STORE_FAST
store ::= STORE_NAME
store ::= STORE_GLOBAL
@@ -620,18 +622,25 @@ def get_python_parser(
# a lazy way of doing the import?
if version < 3.0:
if version == 1.5:
import uncompyle6.parsers.parse15 as parse15
if compile_mode == 'exec':
p = parse15.Python15Parser(debug_parser)
else:
p = parse15.Python15ParserSingle(debug_parser)
elif version == 2.1:
import uncompyle6.parsers.parse21 as parse21
if compile_mode == 'exec':
p = parse21.Python21Parser(debug_parser)
else:
p = parse21.Python21ParserSingle(debug_parser)
if version < 2.2:
if version == 1.4:
import uncompyle6.parsers.parse15 as parse14
if compile_mode == 'exec':
p = parse14.Python15Parser(debug_parser)
else:
p = parse14.Python15ParserSingle(debug_parser)
elif version == 1.5:
import uncompyle6.parsers.parse15 as parse15
if compile_mode == 'exec':
p = parse15.Python15Parser(debug_parser)
else:
p = parse15.Python15ParserSingle(debug_parser)
elif version == 2.1:
import uncompyle6.parsers.parse21 as parse21
if compile_mode == 'exec':
p = parse21.Python21Parser(debug_parser)
else:
p = parse21.Python21ParserSingle(debug_parser)
elif version == 2.2:
import uncompyle6.parsers.parse22 as parse22
if compile_mode == 'exec':

View File

@@ -11,6 +11,10 @@ class Python14Parser(Python15Parser):
# Nothing here yet, but will need to add UNARY_CALL, BINARY_CALL,
# RAISE_EXCEPTION, BUILD_FUNCTION, UNPACK_ARG, UNPACK_VARARG, LOAD_LOCAL,
# SET_FUNC_ARGS, and RESERVE_FAST
# FIXME: should check that this indeed around __doc__
stmt ::= doc_junk
doc_junk ::= LOAD_CONST POP_TOP
"""
def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):