Class: Internal::ByteDecoder::Expression::Hash

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(pc, args) ⇒ Hash

Returns a new instance of Hash.



231
232
233
234
# File 'lib/decompiler/vm/bytedecoder.rb', line 231

def initialize(pc, args)
  super(pc)
  @args = args
end

Instance Method Details

#precedenceObject



250
251
252
# File 'lib/decompiler/vm/bytedecoder.rb', line 250

def precedence
  return 1
end

#to_sObject



236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/decompiler/vm/bytedecoder.rb', line 236

def to_s
  s = '{ '
  a = []
  i = 0
  while i < @args.length do
    a << "#{@args[i]} => #{@args[i + 1]}"
    i += 2
  end
  s << a.join(', ')
  s << ' ' if a.length != 0
  s << '}'
  return s
end