|
@@ -33,6 +33,7 @@ public final class ModuleSpace {
|
33
|
33
|
private final Map<String, ISymbol> globals = new HashMap<>();
|
34
|
34
|
private final AnnotationDefinition[] annotations;
|
35
|
35
|
private final StorageType[] storageTypes;
|
|
36
|
+ private final Map<String, SemanticModule> modules = new HashMap<>();
|
36
|
37
|
|
37
|
38
|
public ModuleSpace(GlobalTypeRegistry registry, List<AnnotationDefinition> annotations, StorageType[] storageTypes) {
|
38
|
39
|
this.registry = registry;
|
|
@@ -44,6 +45,7 @@ public final class ModuleSpace {
|
44
|
45
|
}
|
45
|
46
|
|
46
|
47
|
public void addModule(String name, SemanticModule dependency) throws CompileException {
|
|
48
|
+ modules.put(name, dependency);
|
47
|
49
|
rootPackage.add(name, dependency.modulePackage);
|
48
|
50
|
dependency.definitions.registerExpansionsTo(expansions);
|
49
|
51
|
|
|
@@ -59,6 +61,10 @@ public final class ModuleSpace {
|
59
|
61
|
globals.put(name, global);
|
60
|
62
|
}
|
61
|
63
|
|
|
64
|
+ public SemanticModule getModule(String name) {
|
|
65
|
+ return modules.get(name);
|
|
66
|
+ }
|
|
67
|
+
|
62
|
68
|
public ZSPackage collectPackages() {
|
63
|
69
|
return rootPackage;
|
64
|
70
|
}
|