Class: EBNF::PEG::Parser::Unmatched

Inherits:
Struct
  • Object
show all
Defined in:
lib/ebnf/peg/parser.rb,
lib/ebnf/peg/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expectingArray<Symbol,String> (readonly)

Returns Strings or production rules that attempted to match at this position.

Returns:

  • (Array<Symbol,String>)

    Strings or production rules that attempted to match at this position.



12
13
14
# File 'lib/ebnf/peg/parser.rb', line 12

def expecting
  @expecting
end

#linenoInteger (readonly)

Returns The line number which did not match.

Returns:

  • (Integer)

    The line number which did not match.



9
10
11
# File 'lib/ebnf/peg/parser.rb', line 9

def lineno
  @lineno
end

#posInteger (readonly)

Returns The position within the scanner which did not match.

Returns:

  • (Integer)

    The position within the scanner which did not match.



7
8
9
# File 'lib/ebnf/peg/parser.rb', line 7

def pos
  @pos
end

Instance Method Details

#to_sObject



533
534
535
# File 'lib/ebnf/peg/parser.rb', line 533

def to_s
  "syntax error, expecting #{expecting.map(&:inspect).join(', ')}"
end