]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EBlock.java
(refs #7436) Added location information to ECHRRuleset
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EBlock.java
index b7f943c07f47009c2ed7596dbcbdee9a95c49449..50f29965130ddf38abfc888ef8cd3099cde29421 100644 (file)
@@ -20,7 +20,7 @@ import org.simantics.scl.compiler.errors.Locations;
 
 public class EBlock extends ASTExpression {
 
-    ArrayList<Statement> statements = new ArrayList<Statement>();
+    public ArrayList<Statement> statements = new ArrayList<Statement>();
     boolean monadic;
     
     public EBlock() {
@@ -76,10 +76,14 @@ public class EBlock extends ASTExpression {
                 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);