class Herb::Errors::VoidElementClosingTagError

def initialize(type, location, message, tag_name, expected, found)

def initialize(type, location, message, tag_name, expected, found)
  super(type, location, message)
  @tag_name = tag_name
  @expected = expected
  @found = found
end

def inspect

def inspect
  tree_inspect.rstrip.gsub(/\s+$/, "")
end

def to_hash

def to_hash
  super.merge({
    tag_name: tag_name,
    expected: expected,
    found: found,
  })
end

def tree_inspect(indent = 0)

def tree_inspect(indent = 0)
  output = +""
  output += %(@ #{error_name} #{location.tree_inspect}\n)
  output += %(├── message: #{message.inspect}\n)
  output += %(├── tag_name: #{tag_name ? tag_name.tree_inspect : "∅"}\n)
  output += %(├── expected: #{expected.inspect}\n)
  output += %(└── found: #{found.inspect}\n)
  output += %(\n)
  output.gsub(/^/, "    " * indent)
end