diff --git a/test/Makefile b/test/Makefile index 962781c6..cb73b8c5 100644 --- a/test/Makefile +++ b/test/Makefile @@ -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 '{}' ';' diff --git a/test/bytecode_1.4/bisect.pyc b/test/bytecode_1.4/bisect.pyc new file mode 100644 index 00000000..6ace33df Binary files /dev/null and b/test/bytecode_1.4/bisect.pyc differ diff --git a/test/bytecode_1.4/cmp.pyc b/test/bytecode_1.4/cmp.pyc new file mode 100644 index 00000000..ce8f2b1f Binary files /dev/null and b/test/bytecode_1.4/cmp.pyc differ diff --git a/test/bytecode_1.4/cmpcache.pyc b/test/bytecode_1.4/cmpcache.pyc new file mode 100644 index 00000000..49fea3cc Binary files /dev/null and b/test/bytecode_1.4/cmpcache.pyc differ diff --git a/test/bytecode_1.4/dbhash.pyc b/test/bytecode_1.4/dbhash.pyc new file mode 100644 index 00000000..92d35ef2 Binary files /dev/null and b/test/bytecode_1.4/dbhash.pyc differ diff --git a/test/bytecode_1.4/glob.pyc b/test/bytecode_1.4/glob.pyc new file mode 100644 index 00000000..a5609883 Binary files /dev/null and b/test/bytecode_1.4/glob.pyc differ diff --git a/uncompyle6/parser.py b/uncompyle6/parser.py index 25d244c2..97e9d527 100644 --- a/uncompyle6/parser.py +++ b/uncompyle6/parser.py @@ -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': diff --git a/uncompyle6/parsers/parse14.py b/uncompyle6/parsers/parse14.py index ad64bdc8..702e69cc 100644 --- a/uncompyle6/parsers/parse14.py +++ b/uncompyle6/parsers/parse14.py @@ -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):