diff --git a/source/tlang/compiler/parser.d b/source/tlang/compiler/parser.d index 08ca07a..20a2c7c 100644 --- a/source/tlang/compiler/parser.d +++ b/source/tlang/compiler/parser.d @@ -93,8 +93,15 @@ public final class Parser bool hasIf; bool reachedElse; + ulong i = 0; + while (hasTokens()) { + i++; + import std.stdio; + writeln("Token: "~getCurrentToken().getToken()); + writeln("Current parseIf while: "~to!(string)(i)); + writeln("Bababooey: "~to!(string)(getSymbolType(getCurrentToken()) == SymbolType.ELSE && hasIf)); // /* If else has been reached then exit */ // if(reachedElse) // { @@ -124,6 +131,8 @@ public final class Parser expect(SymbolType.CCURLY, getCurrentToken()); nextToken(); + writeln("American boy: "~getCurrentToken().getToken()); + hasIf = true; } else if (getSymbolType(getCurrentToken()) == SymbolType.ELSE && hasIf) @@ -164,7 +173,7 @@ public final class Parser /* Opening { */ writeln("Bruh"~to!(string)(getCurrentToken())); - nextToken(); + // nextToken(); /* Parse the if' statement's body AND expect a closing curly */ parseBody();