instance method
Prism::DotVisitor#visit_in_node
visit_in_node(node)
lib/prism/dot_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/dot_visitor.rb, line 2213
def visit_in_node(node)
table = Table.new("InNode")
id = node_id(node)
# pattern
table.field("pattern", port: true)
digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")
# statements
unless (statements = node.statements).nil?
table.field("statements", port: true)
digraph.edge("#{id}:statements -> #{node_id(statements)};")
end
# in_loc
table.field("in_loc", location_inspect(node.in_loc))
# then_loc
unless (then_loc = node.then_loc).nil?
table.field("then_loc", location_inspect(then_loc))
end
digraph.nodes << <<~DOT
#{id} [
label=<#{table.to_dot.gsub(/\n/, "\n ")}>
];
DOT
super
end
Visit a InNode node.