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

#==(other) ⇒ Object



4744
4745
4746
# File 'lib/syntax_tree/yarv/instructions.rb', line 4744

def ==(other)
  other.is_a?(Pop)
end

#call(vm) ⇒ Object



4764
4765
4766
# File 'lib/syntax_tree/yarv/instructions.rb', line 4764

def call(vm)
  vm.pop
end

#canonicalObject



4760
4761
4762
# File 'lib/syntax_tree/yarv/instructions.rb', line 4760

def canonical
  self
end

#deconstruct_keys(_keys) ⇒ Object



4740
4741
4742
# File 'lib/syntax_tree/yarv/instructions.rb', line 4740

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4732
4733
4734
# File 'lib/syntax_tree/yarv/instructions.rb', line 4732

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

#lengthObject



4748
4749
4750
# File 'lib/syntax_tree/yarv/instructions.rb', line 4748

def length
  1
end

#popsObject



4752
4753
4754
# File 'lib/syntax_tree/yarv/instructions.rb', line 4752

def pops
  1
end

#pushesObject



4756
4757
4758
# File 'lib/syntax_tree/yarv/instructions.rb', line 4756

def pushes
  0
end

#to_a(_iseq) ⇒ Object



4736
4737
4738
# File 'lib/syntax_tree/yarv/instructions.rb', line 4736

def to_a(_iseq)
  [:pop]
end