mirror of https://github.com/tbklang/tlang.git
Added support for `static` (complete support) within structs
Updated test case to test this
This commit is contained in:
parent
8f86e03f7c
commit
3f9375c6ed
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -38,7 +38,9 @@ class kl
|
|||
|
||||
struct structTest
|
||||
{
|
||||
|
||||
public int k1;
|
||||
static int k2;
|
||||
public static int k3;
|
||||
}
|
||||
|
||||
class Shekshi
|
||||
|
|
4
todo1.md
4
todo1.md
|
@ -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
|
Loading…
Reference in New Issue