Closed gregwebs closed 12 years ago
Excellent point. This should be really easy to do. All the information is there, so I'll try and get this in this evening's release.
This is now in 0.0.7. Example:
/Users/chris/coding/whittle/lib/whittle/parser.rb:277:in `error': Parse error: expected "," but got "-" on line 4. (Whittle::ParseError)
Exact region marked...
fourteen, fifteen - sixteen, seventeen
... ^ ... right here
Tested out- works great. thank you!
I think you could consider getting rid of "Exact region marked..." and change "right here" accordingly to something like "error occurred here"
Good point. I'll change the wording, thanks :)
It isn't always easy to determine the exact parsing issue from the current error information. My ideal error report would include the existing information, but also give the line contents and the exact character on which the parse failed. The ideal way to show this would be with 2 lines where the second has a '^' underneath the character of the first line where the parse failed.