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