Method: Orenono::Brain#goto_end_loop_next

Defined in:
lib/brain.rb

#goto_end_loop_nextObject



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/brain.rb', line 69

def goto_end_loop_next
  hit_cnt = 0
  index = 0
  @tokens[@code_cursol..-1].each_with_index do |token, i|
    hit_cnt += 1 if token == @config.end_loop
    next unless hit_cnt == @loop_stack.size
    index = i + @code_cursol
    break
  end
  @loop_stack.pop
  @code_cursol = index + 1
end