diff --git a/test/Makefile b/test/Makefile index da2ad2aa..0adb1dca 100644 --- a/test/Makefile +++ b/test/Makefile @@ -37,9 +37,14 @@ check-bytecode: check-native-short: $(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --verify $(COMPILE) +#: Short, quickly-running Python 2.7 programs. Useful in debugging grammar problems check-short-2.7: $(PYTHON) test_pythonlib.py --bytecode-2.7 --verify $(COMPILE) +#: Short, quickly-running Python 2.7 programs. Useful in debugging grammar problems +check-short-3.4: + $(PYTHON) test_pythonlib.py --bytecode-3.4 --verify $(COMPILE) + #: Run longer Python 2.7's lib files known to be okay check-2.7-ok: $(PYTHON) test_pythonlib.py --ok-2.7 --verify $(COMPILE) diff --git a/test/bytecode_2.5/README b/test/bytecode_2.5/README new file mode 100644 index 00000000..d2a6510d --- /dev/null +++ b/test/bytecode_2.5/README @@ -0,0 +1 @@ +These are byte-compiled programs compiled by Python 2.5 diff --git a/test/bytecode_2.6/if.pyc b/test/bytecode_2.6/if.pyc new file mode 100644 index 00000000..9463674b Binary files /dev/null and b/test/bytecode_2.6/if.pyc differ diff --git a/test/bytecode_2.6/ifelse.pyc b/test/bytecode_2.6/ifelse.pyc new file mode 100644 index 00000000..7577df40 Binary files /dev/null and b/test/bytecode_2.6/ifelse.pyc differ diff --git a/test/bytecode_2.7/assert.pyc b/test/bytecode_2.7/assert.pyc new file mode 100644 index 00000000..f2630b11 Binary files /dev/null and b/test/bytecode_2.7/assert.pyc differ diff --git a/test/bytecode_2.7/assign.pyc b/test/bytecode_2.7/assign.pyc new file mode 100644 index 00000000..6c0ebc5c Binary files /dev/null and b/test/bytecode_2.7/assign.pyc differ diff --git a/test/bytecode_3.4/assign.pyc b/test/bytecode_3.4/assign.pyc new file mode 100644 index 00000000..385fb1e9 Binary files /dev/null and b/test/bytecode_3.4/assign.pyc differ diff --git a/test/bytecode_3.4/if.pyc b/test/bytecode_3.4/if.pyc index 896df400..6e346c8e 100644 Binary files a/test/bytecode_3.4/if.pyc and b/test/bytecode_3.4/if.pyc differ diff --git a/test/bytecode_3.4/ifelse.pyc b/test/bytecode_3.4/ifelse.pyc index 593999eb..34195d47 100644 Binary files a/test/bytecode_3.4/ifelse.pyc and b/test/bytecode_3.4/ifelse.pyc differ diff --git a/test/bytecompile-tests b/test/bytecompile-tests index 67c8800a..3d224d3b 100755 --- a/test/bytecompile-tests +++ b/test/bytecompile-tests @@ -55,8 +55,10 @@ tests['2.3'] = tests['2.2'] tests['2.5'] = tests['2.3'] # tests['2.7'] = ['mine'] + tests['2.6'] tests['2.7'] = [ - 'simple-source/branching/ifelse', - 'simple-source/branching/if' + # 'simple-source/branching/ifelse', + # 'simple-source/branching/if' + 'simple-source/misc/assert', + 'simple-source/misc/assign', # 'simple-source/call_arguments/keyword', # 'simple-source/call_arguments/positional' ] diff --git a/test/simple-source/misc/assert.py b/test/simple-source/misc/assert.py new file mode 100644 index 00000000..92527b02 --- /dev/null +++ b/test/simple-source/misc/assert.py @@ -0,0 +1,5 @@ +# Tests: +# assert ::= assert_expr jmp_true LOAD_ASSERT RAISE_VARARGS_1 +# callfunction ::= ... + +assert isinstance(1, int) diff --git a/test/simple-source/misc/assign.py b/test/simple-source/misc/assign.py new file mode 100644 index 00000000..13bd4414 --- /dev/null +++ b/test/simple-source/misc/assign.py @@ -0,0 +1,4 @@ +# Tests: +# assign ::= expr designator + +vario = 556 diff --git a/uncompyle6/parsers/parse2.py b/uncompyle6/parsers/parse2.py index 4fef71f5..8922aa5e 100644 --- a/uncompyle6/parsers/parse2.py +++ b/uncompyle6/parsers/parse2.py @@ -505,7 +505,6 @@ class Python2Parser(PythonParser): expr ::= LOAD_FAST expr ::= LOAD_NAME expr ::= LOAD_CONST - expr ::= LOAD_ASSERT expr ::= LOAD_GLOBAL expr ::= LOAD_DEREF expr ::= LOAD_LOCALS diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index 177e0572..9b26ab21 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -505,7 +505,6 @@ class Python3Parser(PythonParser): expr ::= LOAD_FAST expr ::= LOAD_NAME expr ::= LOAD_CONST - expr ::= LOAD_ASSERT expr ::= LOAD_GLOBAL expr ::= LOAD_DEREF expr ::= LOAD_LOCALS