Class: Peruby::Op::Local
Overview
Dynamically localizes a package variable or aggregate element.
Instance Method Summary collapse
-
#initialize(target, assignment) ⇒ Local
constructor
A new instance of Local.
- #run(env, context) ⇒ Object
Methods inherited from Base
#argument_cells, #local_slot, #lvalue, #run_subroutine, #to_callable, #warning_directive?
Constructor Details
#initialize(target, assignment) ⇒ Local
Returns a new instance of Local.
521 522 523 524 |
# File 'lib/peruby/op/variable.rb', line 521 def initialize(target, assignment) @target = target @assignment = assignment end |
Instance Method Details
#run(env, context) ⇒ Object
526 527 528 529 530 531 |
# File 'lib/peruby/op/variable.rb', line 526 def run(env, context) @target.localize(env, env.runtime.local_stack) return @assignment.run(env, context) if @assignment nil end |