class YARP::Node
This represents a node in the tree.
def newline?
def newline? @newline ? true : false end
def pretty_print(q)
def pretty_print(q) q.group do q.text(self.class.name.split("::").last) location.pretty_print(q) q.text("[Li:#{location.start_line}]") if newline? q.text("(") q.nest(2) do deconstructed = deconstruct_keys([]) deconstructed.delete(:location) q.breakable("") q.seplist(deconstructed, lambda { q.comma_breakable }, :each_value) { |value| q.pp(value) } end q.breakable("") q.text(")") end end
def set_newline_flag(newline_marked)
def set_newline_flag(newline_marked) line = location.start_line unless newline_marked[line] newline_marked[line] = true @newline = true end end
def slice
def slice location.slice end