Class: Riml::Nodes

Inherits:
Struct
  • Object
show all
Includes:
Visitable
Defined in:
lib/riml/nodes.rb

Overview

Collection of nodes each one representing an expression.

Direct Known Subclasses

SublistNode

Constant Summary

Constants included from Visitable

Visitable::EMPTY_CHILDREN

Instance Attribute Summary collapse

Attributes included from Visitable

#compiled_output, #force_newline, #parent_node, #parser_info, #scope

Instance Method Summary collapse

Methods included from Visitable

#accept, #force_newline_if_child_call_node?, #location_info

Methods included from Walkable

#child_after, #child_previous_to, #each, #index_by_children, #index_by_member, #insert_after, #insert_before, #next, #previous, #remove, #replace_with

Instance Attribute Details

#nodesObject

Returns the value of attribute nodes

Returns:

  • (Object)

    the current value of nodes



76
77
78
# File 'lib/riml/nodes.rb', line 76

def nodes
  @nodes
end

Instance Method Details

#<<(node) ⇒ Object



79
80
81
82
# File 'lib/riml/nodes.rb', line 79

def <<(node)
  nodes << node
  self
end

#[](idx) ⇒ Object



84
85
86
# File 'lib/riml/nodes.rb', line 84

def [](idx)
  nodes[idx]
end

#childrenObject



93
94
95
# File 'lib/riml/nodes.rb', line 93

def children
  nodes
end

#concat(list_of_nodes) ⇒ Object



88
89
90
91
# File 'lib/riml/nodes.rb', line 88

def concat(list_of_nodes)
  nodes.concat(list_of_nodes)
  self
end