Basic struct parsing added (not done and also not being called anywhere yet)

Updated unit test basic1.t to include a struct in it
entity_declaration_type_checking
Tristan B. Kildaire 2021-05-04 19:07:04 +02:00
parent 139dcfd07c
commit 8661d2e264
2 changed files with 30 additions and 0 deletions

View File

@ -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);

View File

@ -30,6 +30,11 @@ class kl
}
struct structTest
{
}
class Shekshi
{
class Shekshi1