You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
localize Python2 ifelsetmtr, compare_chained: 2.7
This commit is contained in:
@@ -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):
|
||||
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user