Class: SyntaxTree::YARV::PutNil
- Inherits:
-
Object
- Object
- SyntaxTree::YARV::PutNil
- Defined in:
- lib/syntax_tree/yarv/instructions.rb
Overview
### Summary
putnil pushes a global nil object onto the stack.
### Usage
~~~ruby nil ~~~
Instance Method Summary collapse
- #==(other) ⇒ Object
- #call(vm) ⇒ Object
- #canonical ⇒ Object
- #deconstruct_keys(_keys) ⇒ Object
- #disasm(fmt) ⇒ Object
- #length ⇒ Object
- #pops ⇒ Object
- #pushes ⇒ Object
- #to_a(_iseq) ⇒ Object
Instance Method Details
#==(other) ⇒ Object
4792 4793 4794 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4792 def ==(other) other.is_a?(PutNil) end |
#call(vm) ⇒ Object
4812 4813 4814 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4812 def call(vm) canonical.call(vm) end |
#canonical ⇒ Object
4808 4809 4810 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4808 def canonical PutObject.new(nil) end |
#deconstruct_keys(_keys) ⇒ Object
4788 4789 4790 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4788 def deconstruct_keys(_keys) {} end |
#disasm(fmt) ⇒ Object
4780 4781 4782 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4780 def disasm(fmt) fmt.instruction("putnil") end |
#length ⇒ Object
4796 4797 4798 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4796 def length 1 end |
#pops ⇒ Object
4800 4801 4802 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4800 def pops 0 end |
#pushes ⇒ Object
4804 4805 4806 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4804 def pushes 1 end |
#to_a(_iseq) ⇒ Object
4784 4785 4786 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 4784 def to_a(_iseq) [:putnil] end |