Exception: Whittle::ParseError
- Defined in:
- lib/whittle/errors/parse_error.rb
Overview
ParseError is raised if the parse encounters an unexpected token in the input.
You can extract the line number, the expected input and the received input.
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#received ⇒ Object
readonly
Returns the value of attribute received.
Instance Method Summary collapse
-
#initialize(message, line, expected, received) ⇒ ParseError
constructor
Initialize the ParseError with information about the location.
Constructor Details
#initialize(message, line, expected, received) ⇒ ParseError
Initialize the ParseError with information about the location
27 28 29 30 31 32 33 |
# File 'lib/whittle/errors/parse_error.rb', line 27 def initialize(, line, expected, received) super() @line = line @expected = expected @received = received end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
11 12 13 |
# File 'lib/whittle/errors/parse_error.rb', line 11 def expected @expected end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
10 11 12 |
# File 'lib/whittle/errors/parse_error.rb', line 10 def line @line end |
#received ⇒ Object (readonly)
Returns the value of attribute received.
12 13 14 |
# File 'lib/whittle/errors/parse_error.rb', line 12 def received @received end |