3.5 ifelsestmtl grammar bug.

Fixes #108
This commit is contained in:
rocky
2017-04-19 05:08:48 -04:00
parent 4a898ff4c1
commit d4be647bce
3 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

@@ -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