Added Struct parsing support to paarseBody

Added a test to test it (in basic1.t)
entity_declaration_type_checking
Tristan B. Kildaire 2021-05-04 19:10:59 +02:00
parent ef3891530a
commit 688fc34969
2 changed files with 12 additions and 1 deletions

View File

@ -415,6 +415,12 @@ public final class Parser
/* Parse the class and add its statements */ /* Parse the class and add its statements */
statements ~= parseClass(); statements ~= parseClass();
} }
/* If it is a struct definition */
else if(symbol == SymbolType.STRUCT)
{
/* Parse the struct and add it to the statements */
statements ~= parseStruct();
}
/* Error out */ /* Error out */
else else
{ {

View File

@ -32,11 +32,16 @@ class kl
struct structTest struct structTest
{ {
} }
class Shekshi class Shekshi
{ {
struct structTest
{
}
class Shekshi1 class Shekshi1
{ {