diff --git a/test/Makefile b/test/Makefile index e36ff3c0..2f8e56ca 100644 --- a/test/Makefile +++ b/test/Makefile @@ -66,7 +66,8 @@ check-bytecode-2: #: Check deparsing bytecode 3.x only check-bytecode-3: - $(PYTHON) test_pythonlib.py --bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \ + $(PYTHON) test_pythonlib.py --bytecode-3.0 \ + --bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \ --bytecode-3.4 --bytecode-3.5 --bytecode-pypy3.2 #: Check deparsing bytecode that works running Python 2 and Python 3 @@ -107,7 +108,7 @@ check-bytecode-2.7: #: Check deparsing Python 3.0 check-bytecode-3.0: - @echo testing not done yet + $(PYTHON) test_pythonlib.py --bytecode-3.0 #: Check deparsing Python 3.1 check-bytecode-3.1: diff --git a/test/bytecode_3.0/00_assign.pyc b/test/bytecode_3.0/00_assign.pyc new file mode 100644 index 00000000..3c63e6d5 Binary files /dev/null and b/test/bytecode_3.0/00_assign.pyc differ diff --git a/test/bytecode_3.0/00_import.pyc b/test/bytecode_3.0/00_import.pyc new file mode 100644 index 00000000..27a0cba1 Binary files /dev/null and b/test/bytecode_3.0/00_import.pyc differ diff --git a/test/bytecode_3.0/00_pass.pyc b/test/bytecode_3.0/00_pass.pyc new file mode 100644 index 00000000..280db724 Binary files /dev/null and b/test/bytecode_3.0/00_pass.pyc differ diff --git a/test/bytecode_3.0/04_multi_assign.pyc b/test/bytecode_3.0/04_multi_assign.pyc new file mode 100644 index 00000000..a39cb2b1 Binary files /dev/null and b/test/bytecode_3.0/04_multi_assign.pyc differ diff --git a/test/bytecode_3.0/04_raise.pyc b/test/bytecode_3.0/04_raise.pyc new file mode 100644 index 00000000..16a75a83 Binary files /dev/null and b/test/bytecode_3.0/04_raise.pyc differ diff --git a/test/bytecode_3.0/04_withas.pyc b/test/bytecode_3.0/04_withas.pyc new file mode 100644 index 00000000..7daa1c3a Binary files /dev/null and b/test/bytecode_3.0/04_withas.pyc differ diff --git a/test/bytecode_3.0/10_for.pyc b/test/bytecode_3.0/10_for.pyc new file mode 100644 index 00000000..a25ba0dd Binary files /dev/null and b/test/bytecode_3.0/10_for.pyc differ diff --git a/test/test_pythonlib.py b/test/test_pythonlib.py index 3e960567..8deb221c 100755 --- a/test/test_pythonlib.py +++ b/test/test_pythonlib.py @@ -80,7 +80,7 @@ for vers in (2.7, 3.4, 3.5, 3.6): for vers in (1.5, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, - 3.1, 3.2, 3.3, + 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 'pypy3.2', 'pypy2.7'): bytecode = "bytecode_%s" % vers key = "bytecode-%s" % vers diff --git a/uncompyle6/parsers/parse30.py b/uncompyle6/parsers/parse30.py index ebc9e2a0..d345ef31 100644 --- a/uncompyle6/parsers/parse30.py +++ b/uncompyle6/parsers/parse30.py @@ -11,7 +11,6 @@ class Python30Parser(Python3Parser): def p_30(self, args): """ - # Store locals is only in Python 3.0 to 3.3 stmt ::= store_locals store_locals ::= LOAD_FAST STORE_LOCALS @@ -21,7 +20,14 @@ class Python30Parser(Python3Parser): # it is 2.7 or 3.1. So we have a number of 2.6ish (and before) rules below _ifstmts_jump ::= c_stmts_opt JUMP_FORWARD come_froms POP_TOP COME_FROM - jmp_true ::= JUMP_IF_TRUE POP_TOP + jmp_true ::= JUMP_IF_TRUE POP_TOP + jmp_false ::= JUMP_IF_FALSE POP_TOP + + withasstmt ::= expr setupwithas designator suite_stmts_opt + POP_BLOCK LOAD_CONST COME_FROM_FINALLY + LOAD_FAST DELETE_FAST WITH_CLEANUP END_FINALLY + setupwithas ::= DUP_TOP LOAD_ATTR STORE_FAST LOAD_ATTR CALL_FUNCTION_0 setup_finally + setup_finally ::= STORE_FAST SETUP_FINALLY LOAD_FAST DELETE_FAST """ class Python30ParserSingle(Python30Parser, PythonParserSingle):