instance method
Prism::InspectVisitor#visit_match_write_node
visit_match_write_node(node)
lib/prism/inspect_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/inspect_visitor.rb, line 1629
def visit_match_write_node(node)
commands << [inspect_node("MatchWriteNode", node), indent]
flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
commands << ["├── flags: #{flags.empty? ? "∅" : flags.join(", ")}\n", indent]
commands << ["├── call:\n", indent]
commands << [node.call, "#{indent}│ "]
commands << ["└── targets: (length: #{(targets = node.targets).length})\n", indent]
if targets.any?
targets[0...-1].each do |child|
commands << [Replace.new("#{indent} ├── "), indent]
commands << [child, "#{indent} │ "]
end
commands << [Replace.new("#{indent} └── "), indent]
commands << [targets[-1], "#{indent} "]
end
end
Inspect a MatchWriteNode node.