I understand the usual way to write an \"if - else if\" statement is as follow:
if (2==1) {
print(\"1\")
} else if (2==2) {
print(\"2\")
} else {
print
As hrbrmstr has mentioned:
When the initial if is followed by a compound expression (indicated by the {} pair) the parser by default is going to expect the expression followed by else to be compound as well. The only defined use of else is with compound expressions.
In the statement if(cond) cons.expr else alt.expr, the else needs to be put after and in same line with the end `cons.expr' compound.
So if you want to have your code a better look without brackets, apply this way:
if (2==1) print("1") else
if (2==2) print("2") else
print("3")