Skip to content

Commit

Permalink
New grammar rule often imples expanded reduce rule
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Jun 13, 2020
1 parent de4fbb0 commit 02f502c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion uncompyle6/parsers/reducecheck/ifelsestmt.py
Expand Up @@ -95,6 +95,16 @@
"else_suite",
),
),
(
"ifelsestmt",
(
"testexpr",
"stmts",
"jf_cfs",
"else_suite_opt",
"opt_come_from_except",
),
),
])

def ifelsestmt(self, lhs, n, rule, ast, tokens, first, last):
Expand All @@ -108,7 +118,7 @@ def ifelsestmt(self, lhs, n, rule, ast, tokens, first, last):
return False

# Avoid if/else where the "then" is a "raise_stmt1" for an
# assert statemetn. Parse this as an "assert" instead.
# assert statement. Parse this as an "assert" instead.
stmts = ast[1]
if stmts in ("c_stmts",) and len(stmts) == 1:
raise_stmt1 = stmts[0]
Expand Down

0 comments on commit 02f502c

Please sign in to comment.