Class: Opal::Rewriters::BreakFinder

Inherits:
Base
  • Object
show all
Defined in:
opal/lib/opal/rewriters/break_finder.rb

Constant Summary

Constants inherited from Base

Opal::Rewriters::Base::DUMMY_LOCATION

Instance Attribute Summary

Attributes inherited from Base

#current_node

Instance Method Summary collapse

Methods inherited from Base

#append_to_body, #begin_with_stmts, #error, #prepend_to_body, #process, #s, s, #stmts_of

Constructor Details

#initializeBreakFinder

Returns a new instance of BreakFinder.



8
9
10
# File 'opal/lib/opal/rewriters/break_finder.rb', line 8

def initialize
  @found_break = false
end

Instance Method Details

#found_break?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'opal/lib/opal/rewriters/break_finder.rb', line 12

def found_break?
  @found_break
end

#on_break(node) ⇒ Object



16
17
18
19
# File 'opal/lib/opal/rewriters/break_finder.rb', line 16

def on_break(node)
  @found_break = true
  node
end

#stop_lookup(node) ⇒ Object Also known as: on_for, on_while, on_while_post, on_until, on_until_post, on_block



21
22
23
# File 'opal/lib/opal/rewriters/break_finder.rb', line 21

def stop_lookup(node)
  # noop
end