Top Level Namespace
Defined Under Namespace
Constant Summary collapse
- STACK =
[]
Instance Method Summary collapse
Instance Method Details
#frame_end ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/goto.rb', line 30 def frame_end frame = STACK.pop idx = 0 begin for i in (idx...frame.size) frame[i].block.call if frame[i].block end rescue Goto => g idx = frame.index(g.label) retry end end |
#frame_start ⇒ Object
26 27 28 |
# File 'lib/goto.rb', line 26 def frame_start STACK << [] end |
#goto(label) ⇒ Object
44 45 46 |
# File 'lib/goto.rb', line 44 def goto(label) raise Goto.new(label) end |
#label(sym, &block) ⇒ Object
22 23 24 |
# File 'lib/goto.rb', line 22 def label(sym, &block) STACK.last << Label.new(sym, block) end |