]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EMatch.java
index ba9cee65edc0cc7daa1bfc8cfb652514da64933c..494bcfb5d6bfc9d93aab0b50bfd2de29c233cbb7 100644 (file)
@@ -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<Variable> 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];