Class: Peruby::Op::LoopJump

Inherits:
Base
  • Object
show all
Defined in:
lib/peruby/op/loop.rb

Overview

Non-local loop control, optionally targeting a label.

Instance Method Summary collapse

Methods inherited from Base

#argument_cells, #local_slot, #lvalue, #run_subroutine, #to_callable, #warning_directive?

Constructor Details

#initialize(kind, label) ⇒ LoopJump

Returns a new instance of LoopJump.



7
8
9
10
# File 'lib/peruby/op/loop.rb', line 7

def initialize(kind, label)
  @kind = kind
  @label = label
end

Instance Method Details

#run(_env, _context) ⇒ Object

Raises:



12
# File 'lib/peruby/op/loop.rb', line 12

def run(_env, _context) = raise LoopControl.new(@kind, @label)