Closed DylanSp closed 4 years ago
Golang requires braces but allows else-if; the grammar is
IfStmt = "if" [ SimpleStmt ";" ] Expression Block [ "else" ( IfStmt | Block ) ] .
I'd modify the grammar from:
IfStatement -> "if" "(" LogicalExpression ")" Block "else" Block
to
IfStatement -> "if" "(" LogicalExpression ")" Block "else" (Block | IfStatement)
As of v0.1, multiple if statements in a row require nesting:
I'd like to allow the more normal "else if" construction:
Right now, this is prohibited by the requirement that if/else bodies must be surrounded by braces, but it may be possible to change the grammar to avoid this.