Browse Source

Allow for explicit static storage tag

kindlich 5 years ago
parent
commit
f587fb88d0
No known key found for this signature in database

+ 3
- 4
Parser/src/main/java/org/openzen/zenscript/parser/type/ParsedStorageTag.java View File

@@ -10,9 +10,7 @@ import java.util.List;
10 10
 import org.openzen.zencode.shared.CodePosition;
11 11
 import org.openzen.zenscript.codemodel.context.TypeResolutionContext;
12 12
 import org.openzen.zenscript.codemodel.type.storage.StorageTag;
13
-import org.openzen.zenscript.lexer.ParseException;
14
-import org.openzen.zenscript.lexer.ZSTokenParser;
15
-import org.openzen.zenscript.lexer.ZSTokenType;
13
+import org.openzen.zenscript.lexer.*;
16 14
 
17 15
 /**
18 16
  *
@@ -25,7 +23,8 @@ public class ParsedStorageTag {
25 23
 		if (parser.optional(ZSTokenType.T_BACKTICK) == null)
26 24
 			return NULL;
27 25
 		
28
-		String name = parser.required(ZSTokenType.T_IDENTIFIER, "identifier expected").content;
26
+		ZSToken token = parser.optional(ZSTokenType.K_STATIC);
27
+		String name = token != null ? token.content : parser.required(ZSTokenType.T_IDENTIFIER, "identifier expected").content;
29 28
 		List<String> arguments = new ArrayList<>();
30 29
 		while (parser.optional(ZSTokenType.T_COLON) != null)
31 30
 			arguments.add(parser.next().content);

Loading…
Cancel
Save