Class: Melbourne::AST::Break

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/control_flow.rb

Overview

A break statement as in:

while true do
  begin
    x
  rescue Exception => x
    break
  end
end

Direct Known Subclasses

Next, Redo, Retry

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, expr) ⇒ Break



300
301
302
303
# File 'lib/melbourne/ast/control_flow.rb', line 300

def initialize(line, expr)
  @line = line
  @value = expr || Nil.new(line)
end

Instance Attribute Details

#valueObject

The value passed to break



298
299
300
# File 'lib/melbourne/ast/control_flow.rb', line 298

def value
  @value
end