Class: Internal::ByteDecoder::Expression::ConcatArray

Inherits:
Internal::ByteDecoder::Expression show all
Defined in:
lib/decompiler/vm/bytedecoder.rb

Instance Attribute Summary

Attributes inherited from Internal::ByteDecoder::Expression

#pc

Instance Method Summary collapse

Methods inherited from Internal::ByteDecoder::Expression

#<=>, #fmt

Constructor Details

#initialize(array, splat) ⇒ ConcatArray

Returns a new instance of ConcatArray.



274
275
276
277
# File 'lib/decompiler/vm/bytedecoder.rb', line 274

def initialize(array, splat)
  @array = array
  @splat = splat
end

Instance Method Details

#precedenceObject



291
292
293
# File 'lib/decompiler/vm/bytedecoder.rb', line 291

def precedence
  return 1
end

#to_sObject



279
280
281
282
283
284
285
286
287
288
289
# File 'lib/decompiler/vm/bytedecoder.rb', line 279

def to_s
  s = '[ '
  case @array
  when Array then s << @array.args.join(', ')
  when Literal then s << @array.value.join(', ')
  else; raise "Unexpected: #{@array.inspect}"
  end
  s << ', *'
  s << @splat.to_s
  s << ' ]'
end