Class: TRuby::IR::ArrayLiteral

Inherits:
Node
  • Object
show all
Defined in:
lib/t_ruby/ir.rb

Overview

Array literal

Instance Attribute Summary collapse

Attributes inherited from Node

#location, #metadata, #type_info

Instance Method Summary collapse

Methods inherited from Node

#accept, #transform

Constructor Details

#initialize(elements: [], element_type: nil, **opts) ⇒ ArrayLiteral

Returns a new instance of ArrayLiteral.



225
226
227
228
229
# File 'lib/t_ruby/ir.rb', line 225

def initialize(elements: [], element_type: nil, **opts)
  super(**opts)
  @elements = elements
  @element_type = element_type
end

Instance Attribute Details

#element_typeObject

Returns the value of attribute element_type.



223
224
225
# File 'lib/t_ruby/ir.rb', line 223

def element_type
  @element_type
end

#elementsObject

Returns the value of attribute elements.



223
224
225
# File 'lib/t_ruby/ir.rb', line 223

def elements
  @elements
end

Instance Method Details

#childrenObject



231
232
233
# File 'lib/t_ruby/ir.rb', line 231

def children
  @elements
end