Class: Duby::Compiler::JavaSource::RedoableForLoop

Inherits:
SimpleForLoop show all
Includes:
Redoable
Defined in:
lib/duby/jvm/source_generator/loops.rb

Instance Attribute Summary

Attributes inherited from SimpleWhileLoop

#compiler, #loop

Instance Method Summary collapse

Methods included from Redoable

#break, #compile_with_redo, #next, #redo

Methods inherited from SimpleWhileLoop

#break, #compile, #initialize, #next, #redo

Constructor Details

This class inherits a constructor from Duby::Compiler::JavaSource::SimpleWhileLoop

Instance Method Details

#compile_bodyObject



127
128
129
130
# File 'lib/duby/jvm/source_generator/loops.rb', line 127

def compile_body
  compiler.method.puts "#{@inner}:"
  compile_with_redo(@loop.body)
end

#prepareObject



120
121
122
123
124
125
# File 'lib/duby/jvm/source_generator/loops.rb', line 120

def prepare
  super
  @outer = compiler.method.label
  @inner = compiler.method.label
  compiler.method.puts "#{@outer}:"
end