diff --git a/uncompyle6/parsers/parse26.py b/uncompyle6/parsers/parse26.py index 33012d0d..9b7c35d4 100644 --- a/uncompyle6/parsers/parse26.py +++ b/uncompyle6/parsers/parse26.py @@ -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): diff --git a/uncompyle6/parsers/parse30.py b/uncompyle6/parsers/parse30.py index d36e6dfd..7681bd5e 100644 --- a/uncompyle6/parsers/parse30.py +++ b/uncompyle6/parsers/parse30.py @@ -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