Changes based on grammar coverage info

This commit is contained in:
rocky
2017-01-29 23:01:12 -05:00
parent 9348411056
commit 19d2569515
5 changed files with 15 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2016 Rocky Bernstein
# Copyright (c) 2016-2017 Rocky Bernstein
"""
spark grammar differences over Python2.6 for Python 2.5.
"""
@@ -20,6 +20,7 @@ class Python25Parser(Python26Parser):
return_if_stmt ::= ret_expr RETURN_END_IF JUMP_BACK
# Python 2.6 uses ROT_TWO instead of the STORE_xxx
# withas is allowed as a "from future" in 2.5
setupwithas ::= DUP_TOP LOAD_ATTR store LOAD_ATTR CALL_FUNCTION_0
setup_finally
@@ -27,6 +28,7 @@ class Python25Parser(Python26Parser):
store ::= STORE_NAME
# Python 2.6 omits ths LOAD_FAST DELETE_FAST below
# withas is allowed as a "from future" in 2.5
withasstmt ::= expr setupwithas designator suite_stmts_opt
POP_BLOCK LOAD_CONST COME_FROM
with_cleanup