class Prism::DotVisitor
def visit_unless_node(node)
def visit_unless_node(node) table = Table.new("UnlessNode") id = node_id(node) # keyword_loc table.field("keyword_loc", location_inspect(node.keyword_loc)) # predicate table.field("predicate", port: true) digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};") # then_keyword_loc unless (then_keyword_loc = node.then_keyword_loc).nil? table.field("then_keyword_loc", location_inspect(then_keyword_loc)) end # statements unless (statements = node.statements).nil? table.field("statements", port: true) digraph.edge("#{id}:statements -> #{node_id(statements)};") end # consequent unless (consequent = node.consequent).nil? table.field("consequent", port: true) digraph.edge("#{id}:consequent -> #{node_id(consequent)};") end # end_keyword_loc unless (end_keyword_loc = node.end_keyword_loc).nil? table.field("end_keyword_loc", location_inspect(end_keyword_loc)) end digraph.nodes << <<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOT super end