Support for `static` without preceding accessor, has been added

This commit is contained in:
Tristan B. Kildaire 2021-06-06 15:43:01 +02:00
parent 82cffeaccb
commit 1ddd7f102b
3 changed files with 11 additions and 1 deletions

View File

@ -449,6 +449,11 @@ public final class Parser
{
statements ~= parseAccessor();
}
/* If it is a modifier */
else if(isModifier(tok))
{
statements ~= parseInitScope();
}
/* If it is a branch */
else if (symbol == SymbolType.IF)
{

View File

@ -156,6 +156,11 @@ public bool isAccessor(Token token)
getSymbolType(token) == SymbolType.PROTECTED;
}
public bool isModifier(Token token)
{
return getSymbolType(token) == SymbolType.STATIC;
}
public bool isIdentifier_NoDot(Token tokenIn)
{
/* Make sure it isn't any other type of symbol */

View File

@ -106,7 +106,7 @@ public enum AccessorType
public enum InitScope
{
STATIC, UNKNOWN
STATIC, VIRTUAL, UNKNOWN
}
public class Assignment : Statement