instance method
Prism::InspectVisitor#visit_constant_path_target_node
visit_constant_path_target_node(node)
lib/prism/inspect_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/inspect_visitor.rb, line 725
def visit_constant_path_target_node(node)
commands << [inspect_node("ConstantPathTargetNode", node), indent]
flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
commands << ["├── flags: #{flags.empty? ? "∅" : flags.join(", ")}\n", indent]
if (parent = node.parent).nil?
commands << ["├── parent: ∅\n", indent]
else
commands << ["├── parent:\n", indent]
commands << [parent, "#{indent}│ "]
end
if (name = node.name).nil?
commands << ["├── name: ∅\n", indent]
else
commands << ["├── name: #{name.inspect}\n", indent]
end
commands << ["├── delimiter_loc: #{inspect_location(node.delimiter_loc)}\n", indent]
commands << ["└── name_loc: #{inspect_location(node.name_loc)}\n", indent]
end
Inspect a ConstantPathTargetNode node.