3.x ifelsestmtc reduction rule fix

This commit is contained in:
rocky
2020-02-13 04:59:08 -05:00
parent dca2224520
commit 874d196e5c
13 changed files with 36 additions and 34 deletions

View File

@@ -33,13 +33,23 @@ IFELSE_STMT_RULES = frozenset(
"else_suitec",
),
),
(
"ifelsestmtc",
(
"testexpr",
"c_stmts_opt",
"jump_forward_else",
"else_suitec",
"\\e__come_froms",
),
),
(
"ifelsestmtc",
(
"testexpr",
"c_stmts_opt",
"jump_absolute_else",
"else_suitec"
"else_suitec",
),
),
(
@@ -94,6 +104,7 @@ def ifelsestmt(self, lhs, n, rule, ast, tokens, first, last):
return True
if rule not in IFELSE_STMT_RULES:
# print("XXX", rule)
return False
# Avoid if/else where the "then" is a "raise_stmt1" for an