diff --git a/source/tlang/compiler/parser.d b/source/tlang/compiler/parser.d index 2668f4d..71be27f 100644 --- a/source/tlang/compiler/parser.d +++ b/source/tlang/compiler/parser.d @@ -127,7 +127,7 @@ public final class Parser nextToken(); /* Check if we have an `if` after the `{` (so an "else if" statement) */ - if (getSymbolType(getCurrentToken()) == SymbolType.IF && !reachedElse) + if (getSymbolType(getCurrentToken()) == SymbolType.IF) { /* Pop off the `if` */ nextToken(); diff --git a/source/tlang/testing/basic1.t b/source/tlang/testing/basic1.t index 5f8e30c..e3a01d4 100644 --- a/source/tlang/testing/basic1.t +++ b/source/tlang/testing/basic1.t @@ -26,7 +26,23 @@ class clazz_2_1 { print("Hello"); } - + else if(1) + { + print("Bruh"); + } + else + { + print("Bhjkfd"); + } + + if(1) + { + print("Hello"); + } + else if(1) + { + print("Bruh"); + } else { print("Bhjkfd");