class SyntaxTree::YARV::VM::Stack
wraps mutating functions with instrumentation.
This represents the global VM stack. It effectively is an array, but
def [](...)
def [](...) values.[](...) end
def []=(...)
def []=(...) values.[]=(...).tap { events.publish_stack_change(self) } end
def concat(...)
def concat(...) values.concat(...).tap { events.publish_stack_change(self) } end
def initialize(events)
def initialize(events) @events = events @values = [] end
def last
def last values.last end
def length
def length values.length end
def pop(...)
def pop(...) values.pop(...).tap { events.publish_stack_change(self) } end
def push(...)
def push(...) values.push(...).tap { events.publish_stack_change(self) } end
def slice!(...)
def slice!(...) values.slice!(...).tap { events.publish_stack_change(self) } end