class SyntaxTree::YARV::SetSpecial
### Summary
‘setspecial` pops a value off the top of the stack and sets a special local variable to that value. The special local variable is determined by the key given as its only argument.
### Usage
~~~ruby baz if (foo == 1) .. (bar == 1) ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5528 def initialize(key) @key = key end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5544 def ==(other) other.is_a?(SetSpecial) && other.key == key end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5556 def call(vm) case key when GetSpecial::SVAR_LASTLINE raise NotImplementedError, "setspecial SVAR_LASTLINE" when GetSpecial::SVAR_BACKREF raise NotImplementedError, "setspecial SVAR_BACKREF" when GetSpecial::SVAR_FLIPFLOP_START vm.frame_svar.svars[GetSpecial::SVAR_FLIPFLOP_START] end end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5540 def deconstruct_keys(_keys) { key: key } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5532 def disasm(fmt) fmt.instruction("setspecial", [fmt.object(key)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5536 def to_a(_iseq) [:setspecial, key] end