Get ready for release 3.8.1 ...

and more 3.7 grammar customization
This commit is contained in:
rocky
2018-04-16 12:40:08 -04:00
parent 87b70cfd13
commit 245deb0931
7 changed files with 12 additions and 8 deletions

View File

@@ -41,14 +41,12 @@ def test_grammar():
expect_lhs.add("annotate_arg") expect_lhs.add("annotate_arg")
expect_lhs.add("annotate_tuple") expect_lhs.add("annotate_tuple")
unused_rhs.add("mkfunc_annotate") unused_rhs.add("mkfunc_annotate")
unused_rhs.add('call') if PYTHON_VERSION < 3.7:
unused_rhs.add('call')
unused_rhs.add("dict_comp") unused_rhs.add("dict_comp")
unused_rhs.add("classdefdeco1") unused_rhs.add("classdefdeco1")
if PYTHON_VERSION < 3.6: if PYTHON_VERSION != 3.6:
# 3.6 has at least one non-custom call rule if PYTHON_VERSION in (3.5, 3.7):
# the others don't
unused_rhs.add('call')
if PYTHON_VERSION == 3.5:
expect_right_recursive.add((('l_stmts', expect_right_recursive.add((('l_stmts',
('lastl_stmt', 'come_froms', 'l_stmts')))) ('lastl_stmt', 'come_froms', 'l_stmts'))))
pass pass
@@ -61,7 +59,7 @@ def test_grammar():
pass pass
else: else:
expect_lhs.add('kwarg') expect_lhs.add('kwarg')
unused_rhs.add('call') # unused_rhs.add('call')
assert expect_lhs == set(lhs) assert expect_lhs == set(lhs)
assert unused_rhs == set(rhs) assert unused_rhs == set(rhs)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -595,6 +595,11 @@ class Python3Parser(PythonParser):
return_lambda LAMBDA_MARKER return_lambda LAMBDA_MARKER
""", nop_func) """, nop_func)
if self.version <= 3.6:
call_function1 = 'CALL_FUNCTION_1'
else:
call_function1 = 'CALL_METHOD_1'
has_get_iter_call_function1 = False has_get_iter_call_function1 = False
n = len(tokens) n = len(tokens)
max_branches = 0 max_branches = 0

View File

@@ -37,6 +37,7 @@ class Python37Parser(Python36Parser):
attributes ::= IMPORT_FROM ROT_TWO POP_TOP IMPORT_FROM attributes ::= IMPORT_FROM ROT_TWO POP_TOP IMPORT_FROM
# FIXME: generalize and specialize # FIXME: generalize and specialize
attribute37 ::= LOAD_FAST LOAD_METHOD
attribute37 ::= LOAD_NAME LOAD_METHOD attribute37 ::= LOAD_NAME LOAD_METHOD
expr ::= attribute37 expr ::= attribute37

View File

@@ -12,4 +12,4 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file is suitable for sourcing inside bash as # This file is suitable for sourcing inside bash as
# well as importing into Python # well as importing into Python
VERSION='3.1.2' VERSION='3.1.3'