class SyntaxTree::YARV::ConcatStrings
### Summary
‘concatstrings` pops a number of strings from the stack joins them together into a single string and pushes that string back on the stack.
This does no coercion and so is always used in conjunction with ‘objtostring` and `anytostring` to ensure the stack contents are always strings.
### Usage
~~~ruby “#{5}” ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 723 def initialize(number) @number = number end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 739 def ==(other) other.is_a?(ConcatStrings) && other.number == number end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 755 def call(vm) vm.push(vm.pop(number).join) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 735 def deconstruct_keys(_keys) { number: number } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 727 def disasm(fmt) fmt.instruction("concatstrings", [fmt.object(number)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 731 def to_a(_iseq) [:concatstrings, number] end