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

Inherits:
Struct
  • Object
show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/ebnf-c8f40958c6c3/lib/ebnf/peg/parser.rb,
vendor/bundler/ruby/3.3.0/bundler/gems/ebnf-c8f40958c6c3/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 'vendor/bundler/ruby/3.3.0/bundler/gems/ebnf-c8f40958c6c3/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 'vendor/bundler/ruby/3.3.0/bundler/gems/ebnf-c8f40958c6c3/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 'vendor/bundler/ruby/3.3.0/bundler/gems/ebnf-c8f40958c6c3/lib/ebnf/peg/parser.rb', line 7

def pos
  @pos
end

Instance Method Details

#to_sObject



534
535
536
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/ebnf-c8f40958c6c3/lib/ebnf/peg/parser.rb', line 534

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