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