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

#call(vm) ⇒ Object



4193
4194
4195
# File 'lib/syntax_tree/yarv/instructions.rb', line 4193

def call(vm)
  canonical.call(vm)
end

#canonicalObject



4189
4190
4191
# File 'lib/syntax_tree/yarv/instructions.rb', line 4189

def canonical
  PutObject.new(nil)
end

#disasm(fmt) ⇒ Object



4169
4170
4171
# File 'lib/syntax_tree/yarv/instructions.rb', line 4169

def disasm(fmt)
  fmt.instruction("putnil")
end

#lengthObject



4177
4178
4179
# File 'lib/syntax_tree/yarv/instructions.rb', line 4177

def length
  1
end

#popsObject



4181
4182
4183
# File 'lib/syntax_tree/yarv/instructions.rb', line 4181

def pops
  0
end

#pushesObject



4185
4186
4187
# File 'lib/syntax_tree/yarv/instructions.rb', line 4185

def pushes
  1
end

#to_a(_iseq) ⇒ Object



4173
4174
4175
# File 'lib/syntax_tree/yarv/instructions.rb', line 4173

def to_a(_iseq)
  [:putnil]
end