Class: SyntaxTree::YARV::PutNil

Inherits:
Object
  • Object
show all
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

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

#canonicalObject



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

#lengthObject



4796
4797
4798
# File 'lib/syntax_tree/yarv/instructions.rb', line 4796

def length
  1
end

#popsObject



4800
4801
4802
# File 'lib/syntax_tree/yarv/instructions.rb', line 4800

def pops
  0
end

#pushesObject



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