diff --git a/test/bytecode_3.5/03_while-if-break.pyc b/test/bytecode_3.5/03_while-if-break.pyc index f7a2f48d..5f971ce9 100644 Binary files a/test/bytecode_3.5/03_while-if-break.pyc and b/test/bytecode_3.5/03_while-if-break.pyc differ diff --git a/test/simple_source/bug35/03_while-if-break.py b/test/simple_source/bug35/03_while-if-break.py index d520ca7d..21e3ed1b 100644 --- a/test/simple_source/bug35/03_while-if-break.py +++ b/test/simple_source/bug35/03_while-if-break.py @@ -5,3 +5,10 @@ def display_date(loop): if loop.time(): break x = 5 + + # Another loop to test 3.5 ifelsestmtl grammar rule + while loop: + if x: + True + else: + True diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index 5c022056..dc534c57 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -165,7 +165,9 @@ class Python3Parser(PythonParser): ifelsestmtr ::= testexpr return_if_stmts return_stmts ifelsestmtl ::= testexpr c_stmts_opt JUMP_BACK else_suitel - ifelsestmtl ::= testexpr c_stmts_opt COME_FROM JUMP_BACK else_suitel + ifelsestmtl ::= testexpr c_stmts_opt cf_jump_back else_suitel + + cf_jump_back ::= COME_FROM JUMP_BACK # FIXME: this feels like a hack. Is it just 1 or two # COME_FROMs? the parsed tree for this and even with just the