]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRulesetConstructor.java
Refactoring CHR handling code
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ECHRRulesetConstructor.java
index 431bd850dd4e8225f74d3c13284073a60b9d588a..dbba5a5390d93a99a5a010ea5baad5bc23bcb627 100644 (file)
@@ -35,7 +35,7 @@ public class ECHRRulesetConstructor extends Expression {
         context.pushFrame();
         context.pushCHRConstraintFrame();
         ruleset.resolve(context);
-        context.popCHRConstraintFrame(ruleset.constraints);
+        context.popCHRConstraintFrame(ruleset);
         context.popFrame();
         return this;
     }
@@ -59,8 +59,7 @@ public class ECHRRulesetConstructor extends Expression {
     
     @Override
     public Expression simplify(SimplificationContext context) {
-        ruleset.simplify(context);
-        ruleset.compile(context);
+        ruleset.simplifyAndCompileIfNeeded(context);
         return this;
     }