class SyntaxTree::YARV::GetSpecial
### Summary
‘getspecial` pushes the value of a special local variable onto the stack.
### Usage
~~~ruby 1 if (a == 1) .. (b == 2) ~~~
Constants
- SVAR_BACKREF
- SVAR_FLIPFLOP_START
- SVAR_LASTLINE
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2043 def initialize(key, type) @key = key @type = type end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2060 def ==(other) other.is_a?(GetSpecial) && other.key == key && other.type == type end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2072 def call(vm) case key when SVAR_LASTLINE raise NotImplementedError, "getspecial SVAR_LASTLINE" when SVAR_BACKREF raise NotImplementedError, "getspecial SVAR_BACKREF" when SVAR_FLIPFLOP_START vm.frame_svar.svars[SVAR_FLIPFLOP_START] end end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2056 def deconstruct_keys(_keys) { key: key, type: type } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2048 def disasm(fmt) fmt.instruction("getspecial", [fmt.object(key), fmt.object(type)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2052 def to_a(_iseq) [:getspecial, key, type] end