]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/ConcreteModule.java
Merged changes from feature/scl to master.
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / module / ConcreteModule.java
index 8edd9f7019b3f1d01992a2471414b900d21fcd3f..2f6d52bdba63298ad51c6de3e4f2c8fe3c5b6b89 100644 (file)
@@ -11,10 +11,9 @@ import org.simantics.scl.compiler.common.names.Name;
 import org.simantics.scl.compiler.constants.Constant;
 import org.simantics.scl.compiler.elaboration.modules.Documentation;
 import org.simantics.scl.compiler.elaboration.modules.SCLValue;
-import org.simantics.scl.compiler.elaboration.modules.TypeAlias;
 import org.simantics.scl.compiler.elaboration.modules.TypeClass;
 import org.simantics.scl.compiler.elaboration.modules.TypeClassInstance;
-import org.simantics.scl.compiler.elaboration.modules.TypeConstructor;
+import org.simantics.scl.compiler.elaboration.modules.TypeDescriptor;
 import org.simantics.scl.compiler.elaboration.relations.SCLEntityType;
 import org.simantics.scl.compiler.elaboration.relations.SCLRelation;
 import org.simantics.scl.compiler.elaboration.rules.MappingRelation;
@@ -31,8 +30,7 @@ import gnu.trove.procedure.TObjectProcedure;
 
 public class ConcreteModule implements Module {
     String moduleName;
-    THashMap<String, TypeConstructor> typeConstructors = new THashMap<String, TypeConstructor>();
-    THashMap<String, TypeAlias> typeAliases = new THashMap<String, TypeAlias>();
+    THashMap<String, TypeDescriptor> typeDescriptors = new THashMap<String, TypeDescriptor>();
     THashMap<String, EffectConstructor> effectConstructors = new THashMap<String, EffectConstructor>();
     THashMap<String, TypeClass> typeClasses = new THashMap<String, TypeClass>();
     THashMap<TCon, ArrayList<TypeClassInstance>> typeClassInstances = new THashMap<TCon, ArrayList<TypeClassInstance>>();
@@ -53,12 +51,8 @@ public class ConcreteModule implements Module {
         this.moduleName = moduleName;
     }
 
-    public boolean addTypeConstructor(String name, TypeConstructor typeConstructor) {
-        return typeConstructors.put(name, typeConstructor) != null;
-    }
-
-    public boolean addTypeAlias(String name, TypeAlias alias) {
-        return typeAliases.put(name, alias) != null;
+    public boolean addTypeDescriptor(String name, TypeDescriptor typeConstructor) {
+        return typeDescriptors.put(name, typeConstructor) != null;
     }
 
     public boolean addEffectConstructor(String name, EffectConstructor effectConstructor) {
@@ -169,8 +163,8 @@ public class ConcreteModule implements Module {
     }
 
     @Override
-    public TypeConstructor getTypeConstructor(String name) {
-        return typeConstructors.get(name);
+    public TypeDescriptor getTypeDescriptor(String name) {
+        return typeDescriptors.get(name);
     }
 
     @Override
@@ -199,11 +193,6 @@ public class ConcreteModule implements Module {
         return documentation;
     }
 
-    @Override
-    public TypeAlias getTypeAlias(String name) {
-        return typeAliases.get(name);
-    }
-
     public void setClasses(Map<String, byte[]> classes) {
         this.classes = classes;
     }
@@ -260,16 +249,11 @@ public class ConcreteModule implements Module {
 
     @Override
     public void findTypesForPrefix(String prefix, NamespaceFilter filter, Consumer<TCon> consumer) {
-        typeConstructors.values().forEach(type -> {
+        typeDescriptors.values().forEach(type -> {
             TCon tcon = type.name;
             if (tcon.name.toLowerCase().startsWith(prefix.toLowerCase()) && filter.isValueIncluded(tcon.name))
                 consumer.accept(tcon);
         });
-        typeAliases.values().forEach(type -> {
-            TCon tcon = type.getCon();
-            if (tcon.name.toLowerCase().startsWith(prefix.toLowerCase()) && filter.isValueIncluded(tcon.name))
-                consumer.accept(tcon);
-        });
     }
     
     public void setBranchPoints(THashMap<String, BranchPoint[]> branchPoints) {