X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FESimpleLambda.java;h=833e3e9e345d427e6037179e7f2b3bd1ef6469ec;hb=666ee533a3cfa9f59e79215a269f8342227cdbda;hp=8f59b3b4429c77f22d94a0482fba310a190929ec;hpb=a9f88c57e622d9ecf2732bd0278e0989dc0dfd5a;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java index 8f59b3b44..833e3e9e3 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java @@ -1,6 +1,7 @@ package org.simantics.scl.compiler.elaboration.expressions; import java.util.ArrayList; +import java.util.Set; import org.simantics.scl.compiler.common.exceptions.InternalCompilerError; import org.simantics.scl.compiler.compilation.CompilationContext; @@ -22,10 +23,6 @@ import org.simantics.scl.compiler.types.exceptions.UnificationException; import org.simantics.scl.compiler.types.kinds.Kinds; import org.simantics.scl.compiler.types.util.MultiFunction; -import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; -import gnu.trove.set.hash.TIntHashSet; - public class ESimpleLambda extends Expression { public Variable parameter; public Expression value; @@ -55,32 +52,20 @@ public class ESimpleLambda extends Expression { this.effect = effect; } - @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { - value.collectVars(allVars, vars); - } - public Expression decomposeMatching() { value = value.decomposeMatching(); return this; } - @Override - protected void updateType() throws MatchException { - setType(Types.functionE(Types.canonical(parameter.type), - effect, value.getType())); - } - - @Override - public IVal toVal(CompilationContext context, CodeWriter w) { - return lambdaToVal(context, w); + @Override + protected void updateType() throws MatchException { + setType(Types.functionE(Types.canonical(parameter.type), + effect, value.getType())); } @Override - public void collectFreeVariables(THashSet vars) { - value.collectFreeVariables(vars); - vars.remove(parameter); + public IVal toVal(CompilationContext context, CodeWriter w) { + return lambdaToVal(context, w); } @Override @@ -143,7 +128,7 @@ public class ESimpleLambda extends Expression { // Free variables; ExpressionInterpretationContext innerContext = context.createNewContext(); - THashSet freeVariables = cur.getFreeVariables(); + Set freeVariables = cur.getFreeVariables(); for(Variable parameter : parameters) freeVariables.remove(parameter); int i=0; @@ -198,10 +183,6 @@ public class ESimpleLambda extends Expression { return false; } - @Override - public void collectEffects(THashSet effects) { - } - @Override public void setLocationDeep(long loc) { if(location == Locations.NO_LOCATION) {