flofriday / Moose

🐐 A new fun programming language
MIT License
6 stars 1 forks source link

else parsing error #46

Closed flofriday closed 1 year ago

flofriday commented 1 year ago

The following example crashes the parser:

if true {
    println("abc")
}
else {
    println("xyz")
}

While this is a weird way to write it, it should be fine.

flofriday commented 1 year ago

Fixed, we forgot to skip the newlines after the consequence block and so when looking for the next token we found a newline instead of an else, confusing the parser.