Fix Python 3.x bugs

* class definitions made via closures
* Add "make check-short" to top-level
* parse3.py: Python 3.3 uses STORE_LOGALS
This commit is contained in:
rocky
2016-05-17 04:00:54 -04:00
parent f69c76c351
commit 9462e33f48
8 changed files with 94 additions and 21 deletions

View File

@@ -398,6 +398,8 @@ class Python3Parser(PythonParser):
for i in range(i+1, len(tokens)):
if tokens[i].type.startswith('MAKE_FUNCTION'):
break
elif tokens[i].type.startswith('MAKE_CLOSURE'):
break
pass
assert i < len(tokens), "build_class needs to find MAKE_FUNCTION"
assert tokens[i+1].type == 'LOAD_CONST', \
@@ -592,7 +594,14 @@ class Python3Parser(PythonParser):
class Python32Parser(Python3Parser):
def p_32(self, args):
"""
# Store locals is only used in Python 3.2
# Store locals is only in Python 3.2 and 3.3
designator ::= STORE_LOCALS
"""
class Python33Parser(Python3Parser):
def p_33(self, args):
"""
# Store locals is only in Python 3.2 and 3.3
designator ::= STORE_LOCALS
"""
@@ -628,6 +637,9 @@ class Python32ParserSingle(Python32Parser, PythonParserSingle):
pass
class Python33ParserSingle(Python33Parser, PythonParserSingle):
pass
class Python34ParserSingle(Python34Parser, PythonParserSingle):
pass