Fix if return boundary in 3.6+

Fixes #209
This commit is contained in:
rocky
2019-03-10 05:59:15 -04:00
parent bfceeac6c8
commit dcad6cf6ce
10 changed files with 43 additions and 21 deletions

View File

@@ -46,6 +46,10 @@ class Python36Parser(Python35Parser):
# RETURN_VALUE is meant. Specifcally this can happen in
# ifelsestmt -> ...else_suite _. suite_stmts... (last) stmt
return ::= ret_expr RETURN_END_IF
return ::= ret_expr RETURN_VALUE COME_FROM
return_stmt_lambda ::= ret_expr RETURN_VALUE_LAMBDA COME_FROM
return_if_lambda ::= RETURN_END_IF_LAMBDA COME_FROM
# A COME_FROM is dropped off because of JUMP-to-JUMP optimization
and ::= expr jmp_false expr