Frank Ebersoll's grammar fix to make "assert isinstance(1, int)" work.

This commit is contained in:
rocky
2015-12-17 21:41:47 -05:00
parent 9d8f1cbf65
commit 97f48f1322
14 changed files with 19 additions and 4 deletions

View File

@@ -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)

1
test/bytecode_2.5/README Normal file
View File

@@ -0,0 +1 @@
These are byte-compiled programs compiled by Python 2.5

BIN
test/bytecode_2.6/if.pyc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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'
]

View File

@@ -0,0 +1,5 @@
# Tests:
# assert ::= assert_expr jmp_true LOAD_ASSERT RAISE_VARARGS_1
# callfunction ::= ...
assert isinstance(1, int)

View File

@@ -0,0 +1,4 @@
# Tests:
# assign ::= expr designator
vario = 556

View File

@@ -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

View File

@@ -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