Skip to content

Commit 8843686

Browse files
committed
Add generator expression Python 3.0 .. 3.2
1 parent 9d1cf50 commit 8843686

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

uncompyle6/parsers/parse32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def p_30to33(self, args):
1616
"""
1717

1818

19-
def p_gen_comp(self, args):
19+
def p_gen_comp32(self, args):
2020
"""
2121
genexpr_func ::= LOAD_ARG FOR_ITER store comp_iter JUMP_BACK
2222
"""

uncompyle6/parsers/parse33.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ def p_33on(self, args):
1919
def customize_grammar_rules(self, tokens, customize):
2020
self.remove_rules("""
2121
# 3.3+ adds POP_BLOCKS
22-
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP COME_FROM_LOOP
22+
genexpr_func ::= LOAD_ARG FOR_ITER store comp_iter JUMP_BACK
2323
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK NOP COME_FROM_LOOP
24+
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP COME_FROM_LOOP
2425
""")
2526
super(Python33Parser, self).customize_grammar_rules(tokens, customize)
2627
return

uncompyle6/parsers/parse37.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def p_list_comprehension(self, args):
403403
list_if_not ::= expr jmp_true list_iter
404404
"""
405405

406-
def p_gen_comp(self, args):
406+
def p_gen_comp37(self, args):
407407
"""
408408
comp_iter ::= comp_for
409409
comp_body ::= gen_comp_body

0 commit comments

Comments
 (0)