diff --git a/Parser.cs b/Parser.cs index 1550569..9f37b42 100644 --- a/Parser.cs +++ b/Parser.cs @@ -605,7 +605,7 @@ class Parser throw new Exception($"Index {index} out of bounds of {tokens.Length}, expected `end` after else-ifs of if starting at {startRegion}"); } IfNode ret = new(condition: condition, body: body, elseifs: elseifs, startRegion: startRegion, endRegion: tokens[index - 1].region); - if(tokens[index].type == TokenType.Then) + if(tokens[index].type == TokenType.Else) { index += 1; ret.else_ = ParseBlock(tokens);