|
|
@@ -25,7 +25,7 @@ import org.openzen.zenscript.codemodel.type.TypeID;
|
|
25
|
25
|
* @author Hoofdgebruiker
|
|
26
|
26
|
*/
|
|
27
|
27
|
public interface IParsedType {
|
|
28
|
|
- public static IParsedType parse(ZSTokenParser tokens) throws ParseException {
|
|
|
28
|
+ static IParsedType parse(ZSTokenParser tokens) throws ParseException {
|
|
29
|
29
|
IParsedType result = tryParse(tokens);
|
|
30
|
30
|
if (result == null)
|
|
31
|
31
|
throw new ParseException(tokens.getPosition(), "Type expected (got " + tokens.peek().content + ")");
|
|
|
@@ -33,7 +33,7 @@ public interface IParsedType {
|
|
33
|
33
|
return result;
|
|
34
|
34
|
}
|
|
35
|
35
|
|
|
36
|
|
- public static List<IParsedType> parseTypeArguments(ZSTokenParser tokens) throws ParseException {
|
|
|
36
|
+ static List<IParsedType> parseTypeArguments(ZSTokenParser tokens) throws ParseException {
|
|
37
|
37
|
if (!tokens.isNext(T_LESS))
|
|
38
|
38
|
return null;
|
|
39
|
39
|
|
|
|
@@ -67,7 +67,7 @@ public interface IParsedType {
|
|
67
|
67
|
return genericParameters;
|
|
68
|
68
|
}
|
|
69
|
69
|
|
|
70
|
|
- public static List<IParsedType> parseTypeArgumentsForCall(ZSTokenParser tokens) throws ParseException {
|
|
|
70
|
+ static List<IParsedType> parseTypeArgumentsForCall(ZSTokenParser tokens) throws ParseException {
|
|
71
|
71
|
List<IParsedType> typeArguments = null;
|
|
72
|
72
|
if (tokens.optional(ZSTokenType.T_LESS) != null) {
|
|
73
|
73
|
try {
|
|
|
@@ -85,7 +85,7 @@ public interface IParsedType {
|
|
85
|
85
|
return typeArguments;
|
|
86
|
86
|
}
|
|
87
|
87
|
|
|
88
|
|
- public static IParsedType tryParse(ZSTokenParser tokens) throws ParseException {
|
|
|
88
|
+ static IParsedType tryParse(ZSTokenParser tokens) throws ParseException {
|
|
89
|
89
|
CodePosition position = tokens.getPosition();
|
|
90
|
90
|
|
|
91
|
91
|
IParsedType result;
|
|
|
@@ -211,7 +211,7 @@ public interface IParsedType {
|
|
211
|
211
|
return result;
|
|
212
|
212
|
}
|
|
213
|
213
|
|
|
214
|
|
- public static TypeID[] compileList(List<IParsedType> typeParameters, TypeResolutionContext context) {
|
|
|
214
|
+ static TypeID[] compileList(List<IParsedType> typeParameters, TypeResolutionContext context) {
|
|
215
|
215
|
TypeID[] result = TypeID.NONE;
|
|
216
|
216
|
if (typeParameters != null) {
|
|
217
|
217
|
result = new TypeID[typeParameters.size()];
|
|
|
@@ -222,7 +222,7 @@ public interface IParsedType {
|
|
222
|
222
|
return result;
|
|
223
|
223
|
}
|
|
224
|
224
|
|
|
225
|
|
- public static TypeID[] compileTypes(List<IParsedType> typeParameters, TypeResolutionContext context) {
|
|
|
225
|
+ static TypeID[] compileTypes(List<IParsedType> typeParameters, TypeResolutionContext context) {
|
|
226
|
226
|
TypeID[] result = TypeID.NONE;
|
|
227
|
227
|
if (typeParameters != null && typeParameters.size() > 0) {
|
|
228
|
228
|
result = new TypeID[typeParameters.size()];
|
|
|
@@ -233,13 +233,13 @@ public interface IParsedType {
|
|
233
|
233
|
return result;
|
|
234
|
234
|
}
|
|
235
|
235
|
|
|
236
|
|
- public TypeID compile(TypeResolutionContext context);
|
|
|
236
|
+ TypeID compile(TypeResolutionContext context);
|
|
237
|
237
|
|
|
238
|
|
- public default AnnotationDefinition compileAnnotation(BaseScope scope) {
|
|
|
238
|
+ default AnnotationDefinition compileAnnotation(BaseScope scope) {
|
|
239
|
239
|
return null;
|
|
240
|
240
|
}
|
|
241
|
241
|
|
|
242
|
|
- public default TypeID[] compileTypeArguments(BaseScope scope) {
|
|
|
242
|
+ default TypeID[] compileTypeArguments(BaseScope scope) {
|
|
243
|
243
|
return TypeID.NONE;
|
|
244
|
244
|
}
|
|
245
|
245
|
}
|