X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fconstants%2FStringInterpolation.java;h=ab4bafbc4af7d9eaaeecc14d1b608c9f269994e2;hb=dce0962e9a3220b7cc5e4e7d782dd565ab817104;hp=55bba560472aaced6f5b74925dd953d436c8cb29;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/StringInterpolation.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/StringInterpolation.java index 55bba5604..ab4bafbc4 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/StringInterpolation.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/StringInterpolation.java @@ -1,64 +1,169 @@ -package org.simantics.scl.compiler.constants; - -import org.cojen.classfile.TypeDesc; -import org.simantics.scl.compiler.internal.codegen.references.Val; -import org.simantics.scl.compiler.internal.codegen.utils.Constants; -import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder; -import org.simantics.scl.compiler.types.TVar; -import org.simantics.scl.compiler.types.Type; -import org.simantics.scl.compiler.types.Types; - -public class StringInterpolation extends FunctionValue { - - public static final TypeDesc STRING_BUILDER = TypeDesc.forClass(StringBuilder.class); - - private final String[] textParts; - - public StringInterpolation(Type[] parameterTypes, String[] textParts) { - super(TVar.EMPTY_ARRAY, Types.NO_EFFECTS, Types.STRING, parameterTypes); - this.textParts = textParts; - } - - public StringInterpolation(String[] textParts) { - this(stringTypeArray(textParts.length-1), textParts); - } - - private static Type[] stringTypeArray(int length) { - Type[] result = new Type[length]; - for(int i=0;i