instance method
Prism::InspectVisitor#visit_multi_write_node
visit_multi_write_node(node)
lib/prism/inspect_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/inspect_visitor.rb, line 1706
def visit_multi_write_node(node)
commands << [inspect_node("MultiWriteNode", node), indent]
flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
commands << ["├── flags: #{flags.empty? ? "∅" : flags.join(", ")}\n", indent]
commands << ["├── lefts: (length: #{(lefts = node.lefts).length})\n", indent]
if lefts.any?
lefts[0...-1].each do |child|
commands << [Replace.new("#{indent}│ ├── "), indent]
commands << [child, "#{indent}│ │ "]
end
commands << [Replace.new("#{indent}│ └── "), indent]
commands << [lefts[-1], "#{indent}│ "]
end
if (rest = node.rest).nil?
commands << ["├── rest: ∅\n", indent]
else
commands << ["├── rest:\n", indent]
commands << [rest, "#{indent}│ "]
end
commands << ["├── rights: (length: #{(rights = node.rights).length})\n", indent]
if rights.any?
rights[0...-1].each do |child|
commands << [Replace.new("#{indent}│ ├── "), indent]
commands << [child, "#{indent}│ │ "]
end
commands << [Replace.new("#{indent}│ └── "), indent]
commands << [rights[-1], "#{indent}│ "]
end
commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
commands << ["├── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
commands << ["└── value:\n", indent]
commands << [node.value, "#{indent} "]
end
Inspect a MultiWriteNode node.