Class: Internal::ByteDecoder::Expression::ConcatStrings

Inherits:
Internal::ByteDecoder::Expression show all
Defined in:
lib/internal/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) ⇒ ConcatStrings

Returns a new instance of ConcatStrings.



364
365
366
367
# File 'lib/internal/vm/bytedecoder.rb', line 364

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

Instance Method Details

#precedenceObject



385
386
387
# File 'lib/internal/vm/bytedecoder.rb', line 385

def precedence
  return 1
end

#to_sObject



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/internal/vm/bytedecoder.rb', line 369

def to_s
  s = "\""
  @args.each do |arg|
    case arg
    when Literal
      case arg.value
      when String then s << arg.value
      else; s << arg.to_s
      end
    else
      s << "\#{#{arg.to_s}}"
    end
  end
  s << "\""
end