Browse Source

Added all registered modules to the compile space

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

+ 2
- 0
JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaCompileSpace.java View File

13
  * @author Hoofdgebruiker
13
  * @author Hoofdgebruiker
14
  */
14
  */
15
 public interface JavaCompileSpace {
15
 public interface JavaCompileSpace {
16
+	void register(JavaCompiledModule module);
17
+
16
 	GlobalTypeRegistry getRegistry();
18
 	GlobalTypeRegistry getRegistry();
17
 	
19
 	
18
 	JavaCompiledModule getCompiled(Module module);
20
 	JavaCompiledModule getCompiled(Module module);

+ 3
- 0
JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaContext.java View File

128
 	
128
 	
129
 	public void addModule(Module module, JavaCompiledModule target) {
129
 	public void addModule(Module module, JavaCompiledModule target) {
130
 		modules.put(module, target);
130
 		modules.put(module, target);
131
+
132
+		//TODO: can we do this here?
133
+		space.register(target);
131
 	}
134
 	}
132
 	
135
 	
133
 	public JavaCompiledModule getJavaModule(Module module) {
136
 	public JavaCompiledModule getJavaModule(Module module) {

+ 2
- 1
JavaShared/src/main/java/org/openzen/zenscript/javashared/SimpleJavaCompileSpace.java View File

21
 	public SimpleJavaCompileSpace(GlobalTypeRegistry registry) {
21
 	public SimpleJavaCompileSpace(GlobalTypeRegistry registry) {
22
 		this.registry = registry;
22
 		this.registry = registry;
23
 	}
23
 	}
24
-	
24
+
25
+	@Override
25
 	public void register(JavaCompiledModule module) {
26
 	public void register(JavaCompiledModule module) {
26
 		modules.put(module.module, module);
27
 		modules.put(module.module, module);
27
 	}
28
 	}

Loading…
Cancel
Save