Basic struct parsing added (not done and also not being called anywhere yet)
Updated unit test basic1.t to include a struct in itentity_declaration_type_checking
parent
139dcfd07c
commit
8661d2e264
|
@ -314,6 +314,31 @@ public final class Parser
|
|||
nextToken();
|
||||
|
||||
/* TODO: Here we will do a while loop */
|
||||
expect(SymbolType.OCURLY, getCurrentToken());
|
||||
nextToken();
|
||||
|
||||
while(true)
|
||||
{
|
||||
/* Get current token */
|
||||
SymbolType symbolType = getSymbolType(getCurrentToken());
|
||||
|
||||
/* If closing brace then exit */
|
||||
if(symbolType == SymbolType.CCURLY)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* TODO: Only allow variables here */
|
||||
/* TODO: Only allowe VariableDeclarations (maybe assignments idk) */
|
||||
/* TODO: Might, do what d does and allow function */
|
||||
/* TODO: Which is just a codegen trick and implicit thing really */
|
||||
/* TODO: I mean isn't OOP too lmao */
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Expect closing brace (sanity) */
|
||||
expect(SymbolType.CCURLY, getCurrentToken());
|
||||
|
||||
|
||||
gprintln("parseStruct(): Leave", DebugType.WARNING);
|
||||
|
|
|
@ -30,6 +30,11 @@ class kl
|
|||
|
||||
}
|
||||
|
||||
struct structTest
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class Shekshi
|
||||
{
|
||||
class Shekshi1
|
||||
|
|
Loading…
Reference in New Issue