diff --git a/source/tlang/compiler/parser.d b/source/tlang/compiler/parser.d index c1a6af2..7c552a1 100644 --- a/source/tlang/compiler/parser.d +++ b/source/tlang/compiler/parser.d @@ -375,6 +375,7 @@ public final class Parser /* TODO: Ending here, expect closing `}`? */ + nextToken(); } private void parseStatement() @@ -434,9 +435,14 @@ public final class Parser gprintln("parse()::woah: Current token: "~tok.getToken()); } + /* If it is a class */ + else if(symbol == SymbolType.CLASS) + { + parseClass(); + } else { - gprintln("parse(): Geen idee", DebugType.ERROR); + gprintln("parse(): Unknown '"~tok.getToken()~"'", DebugType.ERROR); exit(0); } } diff --git a/source/tlang/compiler/symbols.d b/source/tlang/compiler/symbols.d index b88ba39..c583944 100644 --- a/source/tlang/compiler/symbols.d +++ b/source/tlang/compiler/symbols.d @@ -40,6 +40,7 @@ public enum SymbolType CASE, GOTO, DO, + DELETE, UNKNOWN } @@ -187,6 +188,11 @@ public static SymbolType getSymbolType(Token tokenIn) { return SymbolType.DO; } + /* delete keyword */ + else if(cmp(token, "delete") == 0) + { + return SymbolType.DELETE; + } diff --git a/source/tlang/testing/basic1.t b/source/tlang/testing/basic1.t index b577fc2..89473af 100644 --- a/source/tlang/testing/basic1.t +++ b/source/tlang/testing/basic1.t @@ -3,6 +3,17 @@ ubyte y; ubyte k = 1; +class clazzOne +{ + +} + +class clazzTwo +{ + +} + + void main(int hello, byte d) { ubyte thing = "Hello";