import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.compiler.types.exceptions.MatchException;
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.TIntHashSet;
-
public class GuardedExpressionGroup extends Expression {
public GuardedExpression[] expressions;
this.expressions = expressions;
}
- @Override
- public void collectVars(TObjectIntHashMap<Variable> allVars,
- TIntHashSet vars) {
- for(GuardedExpression expression : expressions) {
- for(Expression guard : expression.guards)
- guard.collectVars(allVars, vars);
- expression.value.collectVars(allVars, vars);
- }
- }
-
@Override
protected void updateType() throws MatchException {
setType(expressions[0].value.getType());
for(Expression guard : expressions[i].guards) {
CodeWriter nextW = w.createBlock();
- w.if_(guard.toVal(context, w), nextW.getContinuation(), failure);
+ w.if_(guard.location, guard.toVal(context, w), nextW.getContinuation(), failure);
w = nextW;
}
- w.jump(success, expressions[i].value.toVal(context, w));
+ w.jump(expressions[i].location, success, expressions[i].value.toVal(context, w));
}
}