class SyntaxTree::StringContent


“string”
StringContent represents the contents of a string-like value.

def ===(other)

def ===(other)
  other.is_a?(StringContent) && ArrayMatch.call(parts, other.parts)
end

def accept(visitor)

def accept(visitor)
  visitor.visit_string_content(self)
end

def child_nodes

def child_nodes
  parts
end

def copy(parts: nil, location: nil)

def copy(parts: nil, location: nil)
  StringContent.new(
    parts: parts || self.parts,
    location: location || self.location
  )
end

def deconstruct_keys(_keys)

def deconstruct_keys(_keys)
  { parts: parts, location: location }
end

def format(q)

def format(q)
  q.text(q.quote)
  q.group do
    parts.each do |part|
      if part.is_a?(TStringContent)
        value = Quotes.normalize(part.value, q.quote)
        first = true
        value.each_line(chomp: true) do |line|
          if first
            first = false
          else
            q.breakable_return
          end
          q.text(line)
        end
        q.breakable_return if value.end_with?("\n")
      else
        q.format(part)
      end
    end
  end
  q.text(q.quote)
end

def initialize(parts:, location:)

def initialize(parts:, location:)
  @parts = parts
  @location = location
  @comments = []
end