Class: Duby::AST::Break

Inherits:
Node
  • Object
show all
Defined in:
lib/duby/ast/flow.rb,
lib/duby/compiler.rb

Direct Known Subclasses

Next, Redo

Instance Attribute Summary

Attributes inherited from Node

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

Instance Method Summary collapse

Methods inherited from Node

#<<, ===, #[], #_set_parent, child, child_name, #each, #empty?, #expr?, #initialize, #initialize_copy, #insert, #inspect, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #temp, #to_s

Constructor Details

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

Instance Method Details

#compile(compiler, expression) ⇒ Object



278
279
280
281
# File 'lib/duby/compiler.rb', line 278

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

#infer(typer) ⇒ Object



211
212
213
214
215
216
217
# File 'lib/duby/ast/flow.rb', line 211

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