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



241
242
243
244
245
# File 'lib/t_ruby/ir.rb', line 241

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.



239
240
241
# File 'lib/t_ruby/ir.rb', line 239

def element_type
  @element_type
end

#elementsObject

Returns the value of attribute elements.



239
240
241
# File 'lib/t_ruby/ir.rb', line 239

def elements
  @elements
end

Instance Method Details

#childrenObject



247
248
249
# File 'lib/t_ruby/ir.rb', line 247

def children
  @elements
end