]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
(refs #7436) Added location information for string interpolation 56/856/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Wed, 16 Aug 2017 09:48:01 +0000 (12:48 +0300)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Wed, 16 Aug 2017 09:48:01 +0000 (12:48 +0300)
Change-Id: I8f7ef2b89ca8359c4de1944a36ae4b9688bfca18

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EStringLiteral.java

index 58ec41fd2f74b85dbbaf4ee420601b9638ada5e8..ff830720c487ec68dbbb427c7c8d16464f7c9c91 100644 (file)
@@ -22,7 +22,9 @@ public class EStringLiteral extends ASTExpression {
         SCLValue showForPrinting = context.getEnvironment().getValue(Names.Prelude_showForPrinting);
         for(int i=0;i<expressions.length;++i)
             components[i] = new EApply(new EConstant(showForPrinting), expressions[i]);
-        return new EApply(new ELiteral(new StringInterpolation(strings)), components).resolve(context);
+        EApply result = new EApply(new ELiteral(new StringInterpolation(strings)), components);
+        result.setLocationDeep(location);
+        return result.resolve(context);
     }
 
     @Override
@@ -47,7 +49,9 @@ public class EStringLiteral extends ASTExpression {
             context.getErrorLog().log(location, "String interpolation can be a pattern only if has one hole.");
             return new EError();
         }
-        return new EApply(new ELiteral(new StringInterpolation(strings)), expressions);
+        EApply result = new EApply(new ELiteral(new StringInterpolation(strings)), expressions);
+        result.setLocationDeep(location);
+        return result;
     }
 
     @Override