Exception: PackratParser::ParseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/packrat_parser/result.rb

Overview

Raised by PackratParser#parse when the input cannot be parsed, or when the start symbol succeeds but does not consume the whole input.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, pos) ⇒ ParseError

Returns a new instance of ParseError.



48
49
50
51
# File 'lib/packrat_parser/result.rb', line 48

def initialize(message, pos)
  @pos = pos
  super("#{message} (at position #{pos})")
end

Instance Attribute Details

#posObject (readonly)

Returns the value of attribute pos.



46
47
48
# File 'lib/packrat_parser/result.rb', line 46

def pos
  @pos
end