Class: Duby::AST::Break

Inherits:
JumpNode show all
Defined in:
lib/duby/ast/flow.rb,
lib/duby/compiler.rb

Direct Known Subclasses

Next, Redo

Instance Attribute Summary

Attributes inherited from JumpNode

#ensures

Attributes inherited from Node

#children, #inferred_type, #newline, #parent, #position

Instance Method Summary collapse

Methods inherited from JumpNode

#initialize

Methods inherited from Node

#[], #each, #expr?, #initialize, #inspect, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #temp, #to_s

Constructor Details

This class inherits a constructor from Duby::AST::JumpNode

Instance Method Details

#compile(compiler, expression) ⇒ Object



220
221
222
223
# File 'lib/duby/compiler.rb', line 220

def compile(compiler, expression)
  compiler.line(line_number)
  compiler.break(self)
end

#infer(typer) ⇒ Object



191
192
193
194
195
196
# File 'lib/duby/ast/flow.rb', line 191

def infer(typer)
  unless resolved?
    resolved!
    @inferred_type = typer.null_type
  end
end