Class PlainStringLiteral

java.lang.Object
org.ek9lang.compiler.support.PlainStringLiteral

public final class PlainStringLiteral extends Object
THE value of a plain "..." String literal - the only String form EK9 reads at compile time: a constant, a constraint, a text's language, a service parameter's name. Use this wherever one of those is read.

Those were read from the raw source text, so a backtick String reached run time as its own lexeme: a constant held `Welcome to ${APP_NAME}` backticks and all, for `fr ${"de"}` registered the text as 'de', and HEADER `X-Token` bound to a header named with its backticks (front-end audit FE30, FE75). A backtick String is not a compile-time literal, so it has no value here (E07902) - interpolated or not.

  • Method Details

    • isPlain

      public static boolean isPlain(EK9Parser.StringLitContext ctx)
      True if this String literal is a plain double-quoted one.
    • valueOf

      public static Optional<String> valueOf(EK9Parser.StringLitContext ctx)
      The literal's value - quotes removed and escapes decoded, exactly as the String would hold it - or empty for a backtick String.