instance method
Prism::DotVisitor#visit_lambda_node
visit_lambda_node(node)
lib/prism/dot_visitor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/dot_visitor.rb, line 2879
def visit_lambda_node(node)
table = Table.new("LambdaNode")
id = node_id(node)
# locals
table.field("locals", node.locals.inspect)
# operator_loc
table.field("operator_loc", location_inspect(node.operator_loc))
# opening_loc
table.field("opening_loc", location_inspect(node.opening_loc))
# closing_loc
table.field("closing_loc", location_inspect(node.closing_loc))
# parameters
unless (parameters = node.parameters).nil?
table.field("parameters", port: true)
digraph.edge("#{id}:parameters -> #{node_id(parameters)};")
end
# body
unless (body = node.body).nil?
table.field("body", port: true)
digraph.edge("#{id}:body -> #{node_id(body)};")
end
digraph.nodes << <<~DOT
#{id} [
label=<#{table.to_dot.gsub(/\n/, "\n ")}>
];
DOT
super
end
Visit a LambdaNode node.