Support `else if (...)`
ballercat opened this issue · comments
Arthur Buldauskas commented
Overview
The lack of else if is awkward, makes it difficult to write some code.
A quick solution might be to encode the node as a literal else
block containing a single if
.
Sample spec
export function test(x: i32): i32 {
if (x == 0) {
return 2;
} else if (x == 1) {
return 4;
} else {
return -1;
}
}
That should do it.
- Tests
- Tests pass