X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fenvironment%2FNamespaceImpl.java;h=6dac77acf029d54aa3dc9f641de6bd5c0fc006af;hp=98666c11a16bab50cf93723f2fdb26f5af413b95;hb=a8758de5bc19e5adb3f618d3038743a164f09912;hpb=12d9af17384d960b75d58c3935d2b7b46d93e87b diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/NamespaceImpl.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/NamespaceImpl.java index 98666c11a..6dac77acf 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/NamespaceImpl.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/NamespaceImpl.java @@ -4,9 +4,8 @@ import java.util.ArrayList; import java.util.function.Consumer; 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.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; @@ -33,13 +32,6 @@ public class NamespaceImpl implements Namespace { this.module = module; this.filter = filter; } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("ModuleImport \"").append(module).append("\"").append(" with filter ").append(filter); - return sb.toString(); - } } public NamespaceImpl(THashMap namespaceMap, @@ -138,14 +130,14 @@ public class NamespaceImpl implements Namespace { } @Override - public TypeConstructor getTypeConstructor(String name) + public TypeDescriptor getTypeDescriptor(String name) throws AmbiguousNameException { - TypeConstructor result = null, temp; + TypeDescriptor result = null, temp; Module resultModule = null; ArrayList conflictingModules = null; for(ModuleImport moduleImport : moduleImports) { Module module = moduleImport.module; - temp = module.getTypeConstructor(name); + temp = module.getTypeDescriptor(name); if(temp != null) { if(result != null) { if(conflictingModules == null) { @@ -220,33 +212,6 @@ public class NamespaceImpl implements Namespace { return result; } - @Override - public TypeAlias getTypeAlias(String name) throws AmbiguousNameException { - TypeAlias result = null, temp; - Module resultModule = null; - ArrayList conflictingModules = null; - for(ModuleImport moduleImport : moduleImports) { - Module module = moduleImport.module; - temp = module.getTypeAlias(name); - if(temp != null) { - if(result != null) { - if(conflictingModules == null) { - conflictingModules = new ArrayList(2); - conflictingModules.add(resultModule.getName()); - } - conflictingModules.add(module.getName()); - } - else { - result = temp; - resultModule = module; - } - } - } - if(conflictingModules != null) - throw new AmbiguousNameException(conflictingModules, name); - return result; - } - @Override public MappingRelation getMappingRelation(String name) throws AmbiguousNameException { MappingRelation result = null, temp;