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 generator expression Python 3.0 .. 3.2
This commit is contained in:
@@ -16,7 +16,7 @@ class Python32Parser(Python3Parser):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def p_gen_comp(self, args):
|
def p_gen_comp32(self, args):
|
||||||
"""
|
"""
|
||||||
genexpr_func ::= LOAD_ARG FOR_ITER store comp_iter JUMP_BACK
|
genexpr_func ::= LOAD_ARG FOR_ITER store comp_iter JUMP_BACK
|
||||||
"""
|
"""
|
||||||
|
@@ -19,8 +19,9 @@ class Python33Parser(Python32Parser):
|
|||||||
def customize_grammar_rules(self, tokens, customize):
|
def customize_grammar_rules(self, tokens, customize):
|
||||||
self.remove_rules("""
|
self.remove_rules("""
|
||||||
# 3.3+ adds POP_BLOCKS
|
# 3.3+ adds POP_BLOCKS
|
||||||
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP COME_FROM_LOOP
|
genexpr_func ::= LOAD_ARG FOR_ITER store comp_iter JUMP_BACK
|
||||||
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK NOP COME_FROM_LOOP
|
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK NOP COME_FROM_LOOP
|
||||||
|
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP COME_FROM_LOOP
|
||||||
""")
|
""")
|
||||||
super(Python33Parser, self).customize_grammar_rules(tokens, customize)
|
super(Python33Parser, self).customize_grammar_rules(tokens, customize)
|
||||||
return
|
return
|
||||||
|
@@ -403,7 +403,7 @@ class Python37Parser(Python37BaseParser):
|
|||||||
list_if_not ::= expr jmp_true list_iter
|
list_if_not ::= expr jmp_true list_iter
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def p_gen_comp(self, args):
|
def p_gen_comp37(self, args):
|
||||||
"""
|
"""
|
||||||
comp_iter ::= comp_for
|
comp_iter ::= comp_for
|
||||||
comp_body ::= gen_comp_body
|
comp_body ::= gen_comp_body
|
||||||
|
Reference in New Issue
Block a user