class Ikra::AST::RootNode

Need to wrap block bodies in RootNode, so that the first node can be replaced if necessary (LastStatementReturnsVisitor)

Attributes

single_child[R]

Public Class Methods

new(single_child:) click to toggle source
# File lib/ast/nodes.rb, line 266
def initialize(single_child:)
    @single_child = single_child
    single_child.parent = self
end

Public Instance Methods

accept(visitor) click to toggle source
# File lib/ast/visitor.rb, line 44
def accept(visitor)
    visitor.visit_root_node(self)
end
clone() click to toggle source
# File lib/ast/nodes.rb, line 271
def clone
    return RootNode.new(single_child: @single_child.clone)
end
to_s() click to toggle source
# File lib/ast/printer.rb, line 40
def to_s
    return "[RootNode: #{single_child.to_s}]"
end