localize Python2 ifelsetmtr, compare_chained: 2.7

This commit is contained in:
rocky
2017-11-26 19:08:20 -05:00
parent 17f5b35b1d
commit d72ee71368
2 changed files with 2 additions and 6 deletions

View File

@@ -138,8 +138,6 @@ class Python2Parser(PythonParser):
ifelsestmtr ::= testexpr return_if_stmts return_stmts
ifelsestmtr ::= testexpr return_if_stmts COME_FROM return_stmts
ifelsestmtl ::= testexpr c_stmts_opt JUMP_BACK else_suitel
@@ -200,9 +198,6 @@ class Python2Parser(PythonParser):
# In Python 3, DUP_TOPX_2 is DUP_TOP_TWO
binary_subscr2 ::= expr expr DUP_TOPX_2 BINARY_SUBSCR
# compare_chained2 is used in a "chained_compare": x <= y <= z
compare_chained2 ::= expr COMPARE_OP RETURN_VALUE
"""
def p_slice2(self, args):

View File

@@ -77,11 +77,12 @@ class Python27Parser(Python2Parser):
or ::= expr JUMP_IF_TRUE_OR_POP expr COME_FROM
and ::= expr JUMP_IF_FALSE_OR_POP expr COME_FROM
# compare_chained1 is used exclusively in chained_compare
# compare_chained{1,2} is used exclusively in chained_compare
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP JUMP_IF_FALSE_OR_POP
compare_chained1 COME_FROM
compare_chained1 ::= expr DUP_TOP ROT_THREE COMPARE_OP JUMP_IF_FALSE_OR_POP
compare_chained2 COME_FROM
compare_chained2 ::= expr COMPARE_OP RETURN_VALUE
"""
def p_stmt27(self, args):