Added support for `static` (complete support) within structs

Updated test case to test this
This commit is contained in:
Tristan B. Kildaire 2021-06-06 15:51:06 +02:00
parent 8f86e03f7c
commit 3f9375c6ed
3 changed files with 10 additions and 3 deletions

View File

@ -348,6 +348,11 @@ public final class Parser
{
structMember = parseAccessor();
}
/* If is is a modifier */
else if(isModifier(getCurrentToken()))
{
structMember = parseInitScope();
}
/* If closing brace then exit */
else if(symbolType == SymbolType.CCURLY)
{

View File

@ -38,7 +38,9 @@ class kl
struct structTest
{
public int k1;
static int k2;
public static int k3;
}
class Shekshi

View File

@ -12,7 +12,7 @@ TODO: Holidays (1-10th May)
- [ ] Allow nested structs
- [ ] Note to self, `parseClass` and `parseStruct` should be way more specific and not just call `parseBody`
- As currently one can then use `static` outside of these contexts
- [ ] `parseStruct`
- [ ] Adding missing support for `static` in it
- [x] `parseStruct`
- [x] Adding missing support for `static` in it
- [ ] `parseClass`
- [ ] Add this