]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRuleset.java
(refs #7371) Support for select keyword for CHR constraints
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ECHRRuleset.java
index 9a8aa78b929199b8e6aad3b4db405d4e9e2e2b15..65ce2e2df974ab28587a537eb75bb7657652e4c9 100644 (file)
@@ -58,12 +58,21 @@ public class ECHRRuleset extends Expression {
     }
     @Override
     public Expression resolve(TranslationContext context) {
+        if(context.currentRuleset != null) {
+            context.getErrorLog().log(location, "Current version of SCL compiler does not support nested rulesets.");
+            return this;
+        }
+        context.currentRuleset = ruleset;
+        
         context.pushFrame();
         context.pushCHRConstraintFrame();
         ruleset.resolve(context);
         in = in.resolve(context);
         context.popCHRConstraintFrame(ruleset.constraints);
         context.popFrame();
+        
+        context.currentRuleset = null;
+        
         return this;
     }
     @Override