Stan Hebben преди 6 години
родител
ревизия
c1b1e8a6da

+ 1
- 1
JavaSourceCompiler/src/main/java/org/openzen/zenscript/javasource/JavaSourceSyntheticHelperGenerator.java Целия файл

@@ -52,7 +52,7 @@ public class JavaSourceSyntheticHelperGenerator {
52 52
 	}
53 53
 	
54 54
 	public JavaMethod createArrayContains(ArrayTypeID type) {
55
-		ArrayKind kind = type.accept(new ArrayKindVisitor());
55
+		ArrayKind kind = type.elementType.type.accept(new ArrayKindVisitor());
56 56
 		if (existingContains.containsKey(kind))
57 57
 			return existingContains.get(kind);
58 58
 		

+ 1
- 0
Shared/src/main/java/org/openzen/zencode/shared/CodePosition.java Целия файл

@@ -5,6 +5,7 @@ public final class CodePosition {
5 5
     public static final CodePosition NATIVE = new CodePosition(new VirtualSourceFile("native"), 0, 0, 0, 0);
6 6
     public static final CodePosition META = new CodePosition(new VirtualSourceFile("meta"), 0, 0, 0, 0);
7 7
 	public static final CodePosition UNKNOWN = new CodePosition(new VirtualSourceFile("unknown"), 0, 0, 0, 0);
8
+
8 9
     public final SourceFile file;
9 10
     public final int fromLine;
10 11
     public final int fromLineOffset;

+ 7
- 1
Shared/src/main/java/org/openzen/zencode/shared/CompileExceptionCode.java Целия файл

@@ -69,5 +69,11 @@ public enum CompileExceptionCode {
69 69
 	VARIANT_OPTION_NOT_AN_EXPRESSION,
70 70
 	DUPLICATE_GLOBAL,
71 71
 	CANNOT_INFER_RETURN_TYPE,
72
-	INVALID_SUFFIX
72
+	INVALID_SUFFIX,
73
+	NO_SUCH_MODULE,
74
+	NO_SUCH_STORAGE_TYPE,
75
+	INVALID_STORAGE_TYPE_ARGUMENTS,
76
+	STORAGE_NOT_SUPPORTED,
77
+	INCOMPATIBLE_STORAGE_TAG,
78
+	INVALID_TYPE_ARGUMENTS
73 79
 }

+ 1
- 1
Shared/src/main/java/org/openzen/zencode/shared/StringExpansion.java Целия файл

@@ -32,7 +32,7 @@ public final class StringExpansion {
32 32
 	public static Result<String, String> unescape(String self) {
33 33
 	    if (!(self.charAt(0) == self.charAt(self.length() - 1)))
34 34
 	        throw new AssertionError("Unbalanced quotes");
35
-	    if (!(self.charAt(0) == '@' && ArrayHelpers.contains(new char[] {'"', '\''}, self.charAt(1)) || ArrayHelpers.contains(new char[] {'"', '\''}, self.charAt(0))))
35
+	    if (!(self.charAt(0) == '@' && ArrayHelpers.containsChar(new char[] {'"', '\''}, self.charAt(1)) || ArrayHelpers.containsChar(new char[] {'"', '\''}, self.charAt(0))))
36 36
 	        throw new AssertionError("String is not quoted");
37 37
 	    if (!(self.length() >= 2))
38 38
 	        throw new AssertionError("String is not quoted");

+ 1
- 8
Shared/src/main/java/zsynthetic/ArrayHelpers.java Целия файл

@@ -1,14 +1,7 @@
1 1
 package zsynthetic;
2 2
 
3 3
 public class ArrayHelpers {
4
-    public static <T> boolean contains(T[] haystack, T needle) {
5
-        for (int i = 0; i < haystack.length; i++)
6
-            if (haystack[i].equals(needle))
7
-                return true;
8
-        return false;
9
-    }
10
-	
11
-	public static boolean contains(char[] haystack, char needle) {
4
+    public static boolean containsChar(char[] haystack, char needle) {
12 5
         for (int i = 0; i < haystack.length; i++)
13 6
             if (haystack[i] == needle)
14 7
                 return true;

Loading…
Отказ
Запис