instance method
Prism::InspectVisitor#visit_range_node
visit_range_node(node)
lib/prism/inspect_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/inspect_visitor.rb, line 1963
def visit_range_node(node)
commands << [inspect_node("RangeNode", node), indent]
flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("exclude_end" if node.exclude_end?)].compact
commands << ["├── flags: #{flags.empty? ? "∅" : flags.join(", ")}\n", indent]
if (left = node.left).nil?
commands << ["├── left: ∅\n", indent]
else
commands << ["├── left:\n", indent]
commands << [left, "#{indent}│ "]
end
if (right = node.right).nil?
commands << ["├── right: ∅\n", indent]
else
commands << ["├── right:\n", indent]
commands << [right, "#{indent}│ "]
end
commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end
Inspect a RangeNode node.
See also
#visit_program_node
#visit_rational_node
#visit_pre_execution_node
#visit_redo_node
also in
3.4