Support optional else-branch for if-then-elif-end (#2598)
This commit is contained in:
1 parent
4dc2a2fb9d
commit
12ce4e3b54
4 files changed
+388
-391
No files matched your search
+377
-387
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -367,9 +367,6 @@ Term "as" Patterns '|' Exp {
|
||||
"if" Exp "then" Exp ElseBody {
|
||||
$$ = gen_cond($2, $4, $5);
|
||||
} |
|
||||
"if" Exp "then" Exp "end" {
|
||||
$$ = gen_cond($2, $4, gen_noop());
|
||||
} |
|
||||
"if" Exp "then" error {
|
||||
FAIL(@$, "Possibly unterminated 'if' statement");
|
||||
$$ = $2;
|
||||
@@ -625,6 +622,9 @@ ElseBody:
|
||||
} |
|
||||
"else" Exp "end" {
|
||||
$$ = $2;
|
||||
} |
|
||||
"end" {
|
||||
$$ = gen_noop();
|
||||
}
|
||||
|
||||
ExpD:
|
||||
|
||||
Reference in new issue
Block a user