instance method
Prism::InspectVisitor#visit_parentheses_node
visit_parentheses_node(node)
lib/prism/inspect_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/inspect_visitor.rb, line 1884
def visit_parentheses_node(node)
commands << [inspect_node("ParenthesesNode", node), indent]
flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("multiple_statements" if node.multiple_statements?)].compact
commands << ["├── flags: #{flags.empty? ? "∅" : flags.join(", ")}\n", indent]
if (body = node.body).nil?
commands << ["├── body: ∅\n", indent]
else
commands << ["├── body:\n", indent]
commands << [body, "#{indent}│ "]
end
commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end
Inspect a ParenthesesNode node.