class SyntaxTree::Begin
end
value
begin
Begin represents a begin..end chain.
def ===(other)
def ===(other) other.is_a?(Begin) && bodystmt === other.bodystmt end
def accept(visitor)
def accept(visitor) visitor.visit_begin(self) end
def child_nodes
def child_nodes [bodystmt] end
def copy(bodystmt: nil, location: nil)
def copy(bodystmt: nil, location: nil) node = Begin.new( bodystmt: bodystmt || self.bodystmt, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { bodystmt: bodystmt, location: location, comments: comments } end
def format(q)
def format(q) q.text("begin") unless bodystmt.empty? q.indent do q.breakable_force unless bodystmt.statements.empty? q.format(bodystmt) end end q.breakable_force q.text("end") end
def initialize(bodystmt:, location:)
def initialize(bodystmt:, location:) @bodystmt = bodystmt @location = location @comments = [] end