class Herb::AST::HTMLCommentNode
def initialize(type, location, errors, comment_start, children, comment_end)
def initialize(type, location, errors, comment_start, children, comment_end) super(type, location, errors) @comment_start = comment_start @children = children @comment_end = comment_end end
def inspect
def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end
def to_hash
def to_hash super.merge({ comment_start: comment_start, children: children, comment_end: comment_end, }) end
def tree_inspect(indent = 0)
def tree_inspect(indent = 0) output = +"" output += "@ #{node_name} " output += location.tree_inspect output += "\n" output += inspect_errors(prefix: "│ ") output += "├── comment_start: " output += comment_start ? comment_start.tree_inspect : "∅" output += "\n" output += "├── children: " output += inspect_array(children, prefix: "│ ") output += "└── comment_end: " output += comment_end ? comment_end.tree_inspect : "∅" output += "\n" output += "\n" output.gsub(/^/, " " * indent) end