How to add "... expected {TOKEN}" to error messages?
Hi! I've been using Racc very happily with graphql-ruby for a while now. It's easy-to-use and fast, so thanks for maintaining it!
I'd like to improve the error messages to have some helpful info, for example, instead of:
Parse error on ")" at [1, 17]
I'd like to say:
Parse error on ")" at [1,17] (expected ":")
However, in reviewing the on_error docs, I don't see a way to access which token was expected. Is it possible to do that with Racc?
Thanks!
This is a great idea! It would require modifying the Racc engine, which is something almost no-one since the original author has done.
Cool, thanks for your response! If I get a chance to take a look, I'll be sure to report back :)
@rmosolgo... Not sure why you closed this. Perhaps you thought that "it would require modifying the Racc engine" was a secret code for "no"? It wasn't.
I got the answer to my question, and I don't have the bandwidth to work on a fix now (:'() so I figured I'd close it out. Feel free to keep it open if you want to thought!