class SyntaxTree::Parser

def on_xstring_literal(xstring)

on_xstring_literal: (XString xstring) -> Heredoc | XStringLiteral
:call-seq:
def on_xstring_literal(xstring)
  heredoc = @heredocs[-1]
  if heredoc && heredoc.beginning.value.include?("`")
    Heredoc.new(
      beginning: heredoc.beginning,
      ending: heredoc.ending,
      dedent: heredoc.dedent,
      parts: xstring.parts,
      location: heredoc.location
    )
  else
    ending = consume_tstring_end(xstring.location)
    XStringLiteral.new(
      parts: xstring.parts,
      location: xstring.location.to(ending.location)
    )
  end
end