instance method
Prism::InspectVisitor#visit_interpolated_regular_expression_node
visit_interpolated_regular_expression_node(node)
lib/prism/inspect_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/inspect_visitor.rb, line 1384
def visit_interpolated_regular_expression_node(node)
commands << [inspect_node("InterpolatedRegularExpressionNode", node), indent]
flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("ignore_case" if node.ignore_case?), ("extended" if node.extended?), ("multi_line" if node.multi_line?), ("once" if node.once?), ("euc_jp" if node.euc_jp?), ("ascii_8bit" if node.ascii_8bit?), ("windows_31j" if node.windows_31j?), ("utf_8" if node.utf_8?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("forced_us_ascii_encoding" if node.forced_us_ascii_encoding?)].compact
commands << ["├── flags: #{flags.empty? ? "∅" : flags.join(", ")}\n", indent]
commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
commands << ["├── parts: (length: #{(parts = node.parts).length})\n", indent]
if parts.any?
parts[0...-1].each do |child|
commands << [Replace.new("#{indent}│ ├── "), indent]
commands << [child, "#{indent}│ │ "]
end
commands << [Replace.new("#{indent}│ └── "), indent]
commands << [parts[-1], "#{indent}│ "]
end
commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end
Inspect a InterpolatedRegularExpressionNode node.