instance method
Prism::Translation::Parser::Compiler#string_nodes_from_interpolation
string_nodes_from_interpolation(node, opening)
lib/prism/translation/parser/compiler.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/translation/parser/compiler.rb, line 2138
def string_nodes_from_interpolation(node, opening)
node.parts.flat_map do |part|
if part.type == :string_node && part.content.include?("\n") && part.opening_loc.nil?
string_nodes_from_line_continuations(part.unescaped, part.content, part.content_loc.start_offset, opening)
else
visit(part)
end
end
end
When the content of a string node is split across multiple lines, the parser gem creates individual string nodes for each line the content is part of.