Added class parsing to `parse()` and updated test case to test it
parent
5c37112f42
commit
f62c2bbc02
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,17 @@ ubyte y;
|
|||
|
||||
ubyte k = 1;
|
||||
|
||||
class clazzOne
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class clazzTwo
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void main(int hello, byte d)
|
||||
{
|
||||
ubyte thing = "Hello";
|
||||
|
|
Loading…
Reference in New Issue