2.6 conditional in list comprehension bug

This commit is contained in:
rocky
2016-06-30 19:51:13 -04:00
parent bd5b2be8fa
commit d87b5fe34c
2 changed files with 7 additions and 2 deletions

View File

@@ -9,7 +9,12 @@
# list_iter ::= lc_body
# lc_body ::= expr LIST_APPEND
[b for b in (0,1,2,3)] if __name__ == '__main__' else 5
# Use line breaks so we can see what's going on in assembly
[b
for b in
(0,1,2,3)
] if (__name__ == '__main__'
) else 5
# Python2:
# list_compr ::= BUILD_LIST_0 list_iter

View File

@@ -165,7 +165,7 @@ class Python26Parser(Python2Parser):
def p_misc(self, args):
'''
conditional ::= expr jmp_false expr jf_cf_pop expr
conditional ::= expr jmp_false expr jf_cf_pop expr come_from_opt
'''
class Python26ParserSingle(Python2Parser, PythonParserSingle):