2.6.9 elif with multiple COME_FROMs

This commit is contained in:
rocky 2016-07-06 20:53:48 -04:00
parent aa65b098a4
commit 14b4f8e2da
3 changed files with 10 additions and 1 deletions

Binary file not shown.

View File

@ -0,0 +1,8 @@
# 2.6.9 symbols.py
# Bug in 2.6 is having multple COME_FROMs due to the
# "and" in the "if" clause
if __name__:
if __file__ and name:
pass
elif name:
pass

View File

@ -79,7 +79,7 @@ class Python26Parser(Python2Parser):
jb_cont ::= CONTINUE
jb_cf_pop ::= JUMP_BACK come_froms POP_TOP
ja_cf_pop ::= JUMP_ABSOLUTE come_from_pop
ja_cf_pop ::= JUMP_ABSOLUTE come_froms POP_TOP
jf_cf_pop ::= JUMP_FORWARD come_froms POP_TOP
bp_come_from ::= POP_BLOCK COME_FROM
@ -143,6 +143,7 @@ class Python26Parser(Python2Parser):
return_stmt ::= ret_expr RETURN_VALUE come_from_pop
return_if_stmt ::= ret_expr RETURN_END_IF come_from_pop
iflaststmtc ::= testexpr c_stmts_opt JUMP_ABSOLUTE else_suitec COME_FROM
iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK come_from_pop
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE come_from_pop
"""