Exception: Bismas::Parser::ParseError
- Inherits:
-
StandardError
- Object
- StandardError
- Bismas::Parser::ParseError
- Defined in:
- lib/bismas/parser.rb
Instance Method Summary collapse
-
#initialize(input, message) ⇒ ParseError
constructor
A new instance of ParseError.
- #to_s ⇒ Object
Constructor Details
#initialize(input, message) ⇒ ParseError
Returns a new instance of ParseError.
151 152 153 |
# File 'lib/bismas/parser.rb', line 151 def initialize(input, ) @input, @message = input, end |
Instance Method Details
#to_s ⇒ Object
155 156 157 158 159 160 161 |
# File 'lib/bismas/parser.rb', line 155 def to_s '%s at %d:%d: %s' % [@message] .insert(*@input.eos? ? [0, 'Unexpected end of input'] : [-1, @input.peek(16).inspect]) .insert(1, $., @input.pos) end |