class Prism::NodeInspector

def list(prefix, nodes)

using the box drawing characters to make the output look nice.
Generates a string that represents a list of nodes. It handles properly
def list(prefix, nodes)
  output = +"(length: #{nodes.length})\n"
  last_index = nodes.length - 1
  nodes.each_with_index do |node, index|
    pointer, preadd = (index == last_index) ? ["└── ", "    "] : ["├── ", "│   "]
    node_prefix = "#{prefix}#{preadd}"
    output << node.inspect(NodeInspector.new(node_prefix)).sub(node_prefix, "#{prefix}#{pointer}")
  end
  output
end