class SyntaxTree::YARV::VM::Stack
This represents the global VM
stack. It effectively is an array, but wraps mutating functions with instrumentation.
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/vm.rb, line 167 def initialize(events) @events = events @values = [] end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/vm.rb, line 200 def []=(...) values.[]=(...).tap { events.publish_stack_change(self) } end
Source
# File lib/syntax_tree/yarv/vm.rb, line 172 def concat(...) values.concat(...).tap { events.publish_stack_change(self) } end
Source
# File lib/syntax_tree/yarv/vm.rb, line 188 def pop(...) values.pop(...).tap { events.publish_stack_change(self) } end
Source
# File lib/syntax_tree/yarv/vm.rb, line 184 def push(...) values.push(...).tap { events.publish_stack_change(self) } end
Source
# File lib/syntax_tree/yarv/vm.rb, line 192 def slice!(...) values.slice!(...).tap { events.publish_stack_change(self) } end