class EBNF::PEG::Parser::Unmatched

@!parse

# Record details about an inmatched rule, including the following:
#
# * Input location and line number at time of failure.
# * The rule at which this was found (non-terminal, and nat starting with '_').
class Unmatched
  # @return [Integer] The position within the scanner which did not match.
  attr_reader :pos
  # @return [Integer] The line number which did not match.
  attr_reader :lineno
  # @return [Array<Symbol,String>]
  #   Strings or production rules that attempted to match at this position.
  attr_reader :expecting
end

Public Instance Methods

to_s() click to toggle source
# File lib/ebnf/peg/parser.rb, line 527
def to_s
  "syntax error, expecting #{expecting.map(&:inspect).join(', ')}"
end