From 6193441621a3b7f26d72981d71bb22ad2f628ca0 Mon Sep 17 00:00:00 2001 From: 0x4261756D <38735823+0x4261756D@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:08:16 +0100 Subject: [PATCH] Fix if expecting a 'then' as else starter --- Parser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);