]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRuleset.java
Refactoring CHR handling code
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ECHRRuleset.java
index da37a4a58f228b5cd8c15af94c2fa80b709eb2bb..54a3e6bba3a57a35eb73f46a885d429b295c6725 100644 (file)
@@ -45,7 +45,7 @@ public class ECHRRuleset extends Expression {
         context.pushCHRConstraintFrame();
         ruleset.resolve(context);
         in = in.resolve(context);
-        context.popCHRConstraintFrame(ruleset.constraints);
+        context.popCHRConstraintFrame(ruleset);
         context.popFrame();
         
         context.currentRuleset = null;
@@ -82,8 +82,7 @@ public class ECHRRuleset extends Expression {
     
     @Override
     public Expression simplify(SimplificationContext context) {
-        ruleset.simplify(context);
-        ruleset.compile(context);
+        ruleset.simplifyAndCompileIfNeeded(context);
         in = in.simplify(context);
         return this;
     }