Quellcode durchsuchen

Added char to JavaNativeModule

kindlich vor 4 Jahren
Ursprung
Commit
e9ab512059
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden

+ 16
- 14
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java Datei anzeigen

@@ -78,12 +78,13 @@ public class JavaNativeModule {
78 78
 		typeByClass.put(void.class, BasicTypeID.VOID);
79 79
 		typeByClass.put(boolean.class, BasicTypeID.BOOL);
80 80
 		typeByClass.put(byte.class, BasicTypeID.SBYTE);
81
-		typeByClass.put(short.class, BasicTypeID.SHORT);
82
-		typeByClass.put(int.class, BasicTypeID.INT);
83
-		typeByClass.put(long.class, BasicTypeID.LONG);
84
-		typeByClass.put(float.class, BasicTypeID.FLOAT);
85
-		typeByClass.put(double.class, BasicTypeID.DOUBLE);
86
-		typeByClass.put(String.class, StringTypeID.INSTANCE);
81
+        typeByClass.put(char.class, BasicTypeID.CHAR);
82
+        typeByClass.put(short.class, BasicTypeID.SHORT);
83
+        typeByClass.put(int.class, BasicTypeID.INT);
84
+        typeByClass.put(long.class, BasicTypeID.LONG);
85
+        typeByClass.put(float.class, BasicTypeID.FLOAT);
86
+        typeByClass.put(double.class, BasicTypeID.DOUBLE);
87
+        typeByClass.put(String.class, StringTypeID.INSTANCE);
87 88
 		typeByClass.put(Boolean.class, registry.getOptional(BasicTypeID.BOOL));
88 89
 		typeByClass.put(Byte.class, registry.getOptional(BasicTypeID.BYTE));
89 90
 		typeByClass.put(Short.class, registry.getOptional(BasicTypeID.SHORT));
@@ -93,13 +94,14 @@ public class JavaNativeModule {
93 94
 		typeByClass.put(Double.class, registry.getOptional(BasicTypeID.DOUBLE));
94 95
 
95 96
 		unsignedByClass.put(byte.class, BasicTypeID.BYTE);
96
-		unsignedByClass.put(short.class, BasicTypeID.USHORT);
97
-		unsignedByClass.put(int.class, BasicTypeID.UINT);
98
-		unsignedByClass.put(long.class, BasicTypeID.ULONG);
99
-		unsignedByClass.put(Byte.class, registry.getOptional(BasicTypeID.BYTE));
100
-		unsignedByClass.put(Short.class, registry.getOptional(BasicTypeID.SHORT));
101
-		unsignedByClass.put(Integer.class, registry.getOptional(BasicTypeID.INT));
102
-		unsignedByClass.put(Long.class, registry.getOptional(BasicTypeID.LONG));
97
+        unsignedByClass.put(char.class, BasicTypeID.CHAR);
98
+        unsignedByClass.put(short.class, BasicTypeID.USHORT);
99
+        unsignedByClass.put(int.class, BasicTypeID.UINT);
100
+        unsignedByClass.put(long.class, BasicTypeID.ULONG);
101
+        unsignedByClass.put(Byte.class, registry.getOptional(BasicTypeID.BYTE));
102
+        unsignedByClass.put(Short.class, registry.getOptional(BasicTypeID.SHORT));
103
+        unsignedByClass.put(Integer.class, registry.getOptional(BasicTypeID.INT));
104
+        unsignedByClass.put(Long.class, registry.getOptional(BasicTypeID.LONG));
103 105
 	}
104 106
 
105 107
 	public SemanticModule toSemantic(ModuleSpace space) {
@@ -225,7 +227,7 @@ public class JavaNativeModule {
225 227
 	}
226 228
 	
227 229
 	private boolean isInBasePackage(String className) {
228
-		return className.startsWith(basePackage + ".") || className.startsWith("java.lang.") || className.startsWith("java.util.");
230
+		return className.startsWith(module.name) || className.startsWith(basePackage + ".") || className.startsWith("java.lang.") || className.startsWith("java.util.");
229 231
 	}
230 232
 
231 233
 	private ZSPackage getPackage(String className) {

Laden…
Abbrechen
Speichern