class EBNF::PEG::Parser::Error
Raised for errors during parsing.
@example Raising a parser error
raise Error.new( "invalid token '%' on line 10", rest: '%', lineno: 9, production: :turtleDoc)
Attributes
lineno[R]
The line number where the error occurred.
@return [Integer]
production[R]
The current production.
@return [Symbol]
rest[R]
The read head when scanning failed
@return [String]
Public Class Methods
new(message, **options)
click to toggle source
Initializes a new lexer error instance.
@param [String, to_s] message @param [Hash{Symbol => Object}] options @option options [Symbol] :production (nil) @option options [String] :rest (nil) @option options [Integer] :lineno (nil)
Calls superclass method
# File lib/ebnf/peg/parser.rb, line 568 def initialize(message, **options) @production = options[:production] @rest = options[:rest] @lineno = options[:lineno] super(message.to_s) end