case Rule:
in = extractRules(i, endId, in);
break;
- case CHR:
- in = new ECHRRuleset(extractCHRRules(context, i, endId), in);
+ case CHR: {
+ CHRRuleset ruleset = extractCHRRules(context, i, endId);
+ long location = Locations.combine(ruleset.location, in.location);
+ in = new ECHRRuleset(ruleset, in);
+ in.location = location;
break;
}
+ }
}
}
return in.resolve(context);
import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
import org.simantics.scl.compiler.internal.interpreted.IExpression;
import org.simantics.scl.compiler.top.ExpressionInterpretationContext;
+import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.exceptions.MatchException;
public class ECHRRuleset extends Expression {
return this;
}
+ @Override
+ public Expression checkBasicType(TypingContext context, Type requiredType) {
+ ruleset.checkType(context);
+ in = in.checkType(context, requiredType);
+ return this;
+ }
+
@Override
public Expression simplify(SimplificationContext context) {
ruleset.simplify(context);