Exception: Succubus::ExecuteError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/succubus.rb

Overview

Raised by Grammar#execute if the Generator encountered any errors while executing the grammar.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorsArray<String> (readonly)

Returns the errors encountered during execution.

Returns:

  • (Array<String>)

    the errors encountered during execution



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/succubus.rb', line 30

class ExecuteError < RuntimeError
  attr_reader :errors, :partial

  # @private
  def set_errors(errors)
    @errors = errors
  end

  # @private
  def set_partial(partial)
    @partial = partial
  end
end

#partialResult (readonly)

Returns as much of the result as the Generator was able to produce. Typically, this will be a string with missing rules surrounded by !!missing!!. For instance, “My !!pet!! is nice”.

Returns:

  • (Result)

    as much of the result as the Generator was able to produce. Typically, this will be a string with missing rules surrounded by !!missing!!. For instance, “My !!pet!! is nice”



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/succubus.rb', line 30

class ExecuteError < RuntimeError
  attr_reader :errors, :partial

  # @private
  def set_errors(errors)
    @errors = errors
  end

  # @private
  def set_partial(partial)
    @partial = partial
  end
end

Instance Method Details

#set_errors(errors) ⇒ Object



34
35
36
# File 'lib/succubus.rb', line 34

def set_errors(errors)
  @errors = errors
end

#set_partial(partial) ⇒ Object



39
40
41
# File 'lib/succubus.rb', line 39

def set_partial(partial)
  @partial = partial
end