Class: Rubasteme::AST::BodyNode

Inherits:
HoldingSequenceBaseNode show all
Defined in:
lib/rubasteme/ast/branch_node.rb

Instance Method Summary collapse

Methods inherited from HoldingSequenceBaseNode

#sequence, #sequence=

Methods inherited from ListNode

#elements, #empty?, #first, #rest

Methods inherited from BranchNode

#<<, #[], #[]=, #each, #size, #to_a

Methods inherited from Node

#to_a, #to_s, #type

Constructor Details

#initialize(_ = nil) ⇒ BodyNode

Returns a new instance of BodyNode.



159
160
161
162
# File 'lib/rubasteme/ast/branch_node.rb', line 159

def initialize(_ = nil)
  # @nodes = [<definitions>, <sequence>]
  super(2, 1, _)
end

Instance Method Details

#definitionsObject



164
165
166
# File 'lib/rubasteme/ast/branch_node.rb', line 164

def definitions
  @nodes[0]
end

#definitions=(node) ⇒ Object



168
169
170
# File 'lib/rubasteme/ast/branch_node.rb', line 168

def definitions=(node)
  @nodes[0] = node
end