Module: Remap::Catchable Private

Included in:
Base, Compiler, Compiler, Rule
Defined in:
lib/remap/catchable.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#catch_fatal(state, backtrace) {|state, id| ... } ⇒ State<T>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • state (State)
  • backtrace (Array<String>)

Yield Parameters:

  • state (State)
  • id (Symbol, String)

Yield Returns:

Returns:

Raises:



32
33
34
35
36
37
38
39
40
# File 'lib/remap/catchable.rb', line 32

def catch_fatal(state, backtrace, &block)
  id = to_id(:fatal)

  failure = catch(id) do
    return block[state.set(fatal_id: id), fatal_id: id].remove_fatal_id
  end

  raise failure.exception(backtrace)
end

#catch_ignored(state) {|state, id| ... } ⇒ State<T>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

Yield Parameters:

  • state (State)
  • id (Symbol, String)

Yield Returns:

Returns:



15
16
17
18
19
20
21
# File 'lib/remap/catchable.rb', line 15

def catch_ignored(state, &block)
  id = to_id(:ignored)

  catch(id) do
    block[state.set(id: id), id: id].remove_id
  end
end