You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Add Python 3.0.1 list_comp rule
This commit is contained in:
@@ -254,7 +254,7 @@ class Python26Parser(Python2Parser):
|
||||
POP_TOP jb_pb_come_from
|
||||
|
||||
generator_exp ::= LOAD_GENEXPR MAKE_FUNCTION_0 expr GET_ITER CALL_FUNCTION_1 COME_FROM
|
||||
list_if ::= list_if ::= expr jmp_false_then list_iter
|
||||
list_if ::= expr jmp_false_then list_iter
|
||||
'''
|
||||
|
||||
def p_ret26(self, args):
|
||||
|
@@ -75,6 +75,9 @@ class Python30Parser(Python31Parser):
|
||||
list_comp ::= list_comp_header
|
||||
LOAD_FAST FOR_ITER store comp_iter
|
||||
JUMP_BACK
|
||||
list_comp ::= list_comp_header
|
||||
LOAD_FAST FOR_ITER store comp_iter
|
||||
JUMP_BACK _come_froms POP_TOP JUMP_BACK
|
||||
|
||||
set_comp_header ::= BUILD_SET_0 DUP_TOP STORE_FAST
|
||||
set_comp ::= set_comp_header
|
||||
@@ -86,6 +89,16 @@ class Python30Parser(Python31Parser):
|
||||
LOAD_FAST FOR_ITER store dict_comp_iter
|
||||
JUMP_BACK
|
||||
|
||||
# From Python 2.6
|
||||
|
||||
|
||||
list_iter ::= list_if JUMP_BACK
|
||||
list_iter ::= list_if JUMP_BACK _come_froms POP_TOP
|
||||
lc_body ::= LOAD_NAME expr LIST_APPEND
|
||||
lc_body ::= LOAD_FAST expr LIST_APPEND
|
||||
list_if ::= expr jmp_false_then list_iter
|
||||
#############
|
||||
|
||||
dict_comp_iter ::= expr expr ROT_TWO expr STORE_SUBSCR
|
||||
|
||||
# JUMP_IF_TRUE POP_TOP as a replacement
|
||||
|
Reference in New Issue
Block a user