================================================================================
basic/stringMultiline
================================================================================

amends "../snippetTest.pkl"

local str1 = "How"
local str2 = "you"
local str3 = "this"

examples {
  ["interpolation"] {
    """
    How are you today?
    Are \(str2) hungry?\n
    Can you \( new Dynamic { x = "nest \( new Dynamic { y = str3 }.y )" }.x ) for me?
    """
  }

  ["escaping"] {
    """
    \\\"\\(
    """

    """
    \t\r\n
    """

    """
    \u{9}\u{30}\u{100}\u{1000}\u{10000}\u{010000}\u{0010000}\u{00010000}
    """
  }

  ["dollar sign has no special meaning"] {
    """
    123$ $123 $&% $
    """
  }

  ["trimming of leading and trailing newlines"] {
    """
    leading and trailing newline trimmed
    """

    """

    leading newline not trimmed
    """

    """



    leading newlines not trimmed
    """

    """
    trailing newline not trimmed

    """

    """
    trailing newlines not trimmed



    """
  }

  ["trimming of leading whitespace"] {
    """
    leading
    whitespace
    trimmed
    """

    """
      leading
      whitespace
      partially
      trimmed
    """

    """
    leading
      whitespace
        partially
          trimmed
    """
  }

  ["quotes"] {
    """
    "AS IS"
    """

    """
    ""AS IS""
    """

    local body = "AS IS"

    """
    "\(body)"
    """

    """
    ""\(body)""
    """

    """
    trailing newline not trimmed (trailing quotes)
    ""
    """

    local interpolatedString = "interpolated string"

    """
    trailing newline with \(interpolatedString) not trimmed (trailing quotes)
    ""
    """
  }
}

--------------------------------------------------------------------------------

(module
  (moduleHeader
    (extendsOrAmendsClause
      (stringConstant)))
  (classProperty
    (modifier)
    (identifier)
    (slStringLiteral))
  (classProperty
    (modifier)
    (identifier)
    (slStringLiteral))
  (classProperty
    (modifier)
    (identifier)
    (slStringLiteral))
  (classProperty
    (identifier)
    (objectBody
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (mlStringLiteral
              (interpolationExpr
                (variableExpr
                  (identifier)))
              (escapeSequence)
              (interpolationExpr
                (propertyCallExpr
                  (newExpr
                    (type
                      (qualifiedIdentifier
                        (identifier)))
                    (objectBody
                      (objectProperty
                        (identifier)
                        (slStringLiteral
                          (interpolationExpr
                            (propertyCallExpr
                              (newExpr
                                (type
                                  (qualifiedIdentifier
                                    (identifier)))
                                (objectBody
                                  (objectProperty
                                    (identifier)
                                    (variableExpr
                                      (identifier)))))
                              (identifier)))))))
                  (identifier)))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (mlStringLiteral
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)))
          (objectElement
            (mlStringLiteral
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)))
          (objectElement
            (mlStringLiteral
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)
              (escapeSequence)))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (mlStringLiteral))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (mlStringLiteral))
          (objectElement
            (mlStringLiteral))
          (objectElement
            (mlStringLiteral))
          (objectElement
            (mlStringLiteral))
          (objectElement
            (mlStringLiteral))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (mlStringLiteral))
          (objectElement
            (mlStringLiteral))
          (objectElement
            (mlStringLiteral))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (mlStringLiteral))
          (objectElement
            (mlStringLiteral))
          (objectProperty
            (modifier)
            (identifier)
            (slStringLiteral))
          (objectElement
            (mlStringLiteral
              (interpolationExpr
                (variableExpr
                  (identifier)))))
          (objectElement
            (mlStringLiteral
              (interpolationExpr
                (variableExpr
                  (identifier)))))
          (objectElement
            (mlStringLiteral))
          (objectProperty
            (modifier)
            (identifier)
            (slStringLiteral))
          (objectElement
            (mlStringLiteral
              (interpolationExpr
                (variableExpr
                  (identifier))))))))))
