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%2Felaboration%2Fexpressions%2FELambda.java;h=b01b771894a831b16d193d208317b746eede221e;hp=bc3e925b05f6887914db8a4fcf086df5cc3597b7;hb=4bb82aede02d798846196cc4f51e09d9f9161fef;hpb=6dfe20b0f514b91337fcac4de0267ffd8268be07 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambda.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambda.java index bc3e925b0..b01b77189 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambda.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambda.java @@ -12,9 +12,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.TIntHashSet; - public class ELambda extends SimplifiableExpression { public Case[] cases; Type effect = Types.NO_EFFECTS; @@ -32,17 +29,16 @@ public class ELambda extends SimplifiableExpression { this.cases = cases; } + public ELambda(long loc, Type effect, Case ... cases) { + super(loc); + this.cases = cases; + this.effect = effect; + } + public ELambda(long loc, Expression pat, Expression exp) { this(loc, new Case(new Expression[] {pat}, exp)); } - @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { - for(Case case_ : cases) - case_.collectVars(allVars, vars); - } - public Expression decomposeMatching() { Expression[] patterns = cases[0].patterns; int arity = patterns.length;