X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FEMatch.java;h=494bcfb5d6bfc9d93aab0b50bfd2de29c233cbb7;hb=refs%2Fchanges%2F34%2F1534%2F3;hp=ba9cee65edc0cc7daa1bfc8cfb652514da64933c;hpb=6dfe20b0f514b91337fcac4de0267ffd8268be07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java index ba9cee65e..494bcfb5d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java @@ -17,9 +17,6 @@ import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.kinds.Kinds; -import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.TIntHashSet; - public class EMatch extends Expression { public Expression[] scrutinee; @@ -40,15 +37,6 @@ public class EMatch extends Expression { this.cases = cases; } - @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { - for(Expression s : scrutinee) - s.collectVars(allVars, vars); - for(Case case_ : cases) - case_.collectVars(allVars, vars); - } - @Override protected void updateType() { setType(cases[0].value.getType()); @@ -66,7 +54,7 @@ public class EMatch extends Expression { CodeWriter joinPoint = w.createBlock(getType()); CodeWriter failurePoint = w.createBlock(); // TODO generate only one failurePoint per function - PatternMatchingCompiler.split(w, context, scrutineeVals, joinPoint.getContinuation(), failurePoint.getContinuation(), rows); + PatternMatchingCompiler.split(location, w, context, scrutineeVals, joinPoint.getContinuation(), failurePoint.getContinuation(), rows); failurePoint.throw_(location, Throw.MatchingException, "Matching failure at: " + toString()); w.continueAs(joinPoint); return w.getParameters()[0];