summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
44afe31)
Also small modification to typechecking of ECHRRuleset to get smaller
scope for a potential type error.
Change-Id: I9edaaa26c5a18c988de3fa89f39290030394972c
case Rule:
in = extractRules(i, endId, in);
break;
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;
}
}
return in.resolve(context);
}
}
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.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 {
import org.simantics.scl.compiler.types.exceptions.MatchException;
public class ECHRRuleset extends Expression {
+ @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);
@Override
public Expression simplify(SimplificationContext context) {
ruleset.simplify(context);