Servostar / gemstone

Gemstone programming language compiler (GSC)
GNU General Public License v2.0
3 stars 0 forks source link

36 add parser rule for if #51

Closed Servostar closed 2 months ago

Servostar commented 2 months ago

Added rules for branches. A branch (if) is an if <expr> {} followed by a variable amount of else if <expr> and an ended by an optional else. Valid combinations are:

if 5 {
}
if 5 {
} else {}
if 5 {
} else if 7 {}
else if 9 {}
else if 12 {}
else {}