Class: SyntaxTree::YARV::Pop

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/yarv/instructions.rb

Overview

### Summary

pop pops the top value off the stack.

### Usage

~~~ruby a ||= 2 ~~~

Instance Method Summary collapse

Instance Method Details

#call(vm) ⇒ Object



4153
4154
4155
# File 'lib/syntax_tree/yarv/instructions.rb', line 4153

def call(vm)
  vm.pop
end

#canonicalObject



4149
4150
4151
# File 'lib/syntax_tree/yarv/instructions.rb', line 4149

def canonical
  self
end

#disasm(fmt) ⇒ Object



4129
4130
4131
# File 'lib/syntax_tree/yarv/instructions.rb', line 4129

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

#lengthObject



4137
4138
4139
# File 'lib/syntax_tree/yarv/instructions.rb', line 4137

def length
  1
end

#popsObject



4141
4142
4143
# File 'lib/syntax_tree/yarv/instructions.rb', line 4141

def pops
  1
end

#pushesObject



4145
4146
4147
# File 'lib/syntax_tree/yarv/instructions.rb', line 4145

def pushes
  0
end

#to_a(_iseq) ⇒ Object



4133
4134
4135
# File 'lib/syntax_tree/yarv/instructions.rb', line 4133

def to_a(_iseq)
  [:pop]
end