Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add "... expected {TOKEN}" to error messages? #88

Open
rmosolgo opened this issue Nov 2, 2017 · 4 comments
Open

How to add "... expected {TOKEN}" to error messages? #88

rmosolgo opened this issue Nov 2, 2017 · 4 comments

Comments

@rmosolgo
Copy link

rmosolgo commented Nov 2, 2017

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!

@alexdowad
Copy link
Contributor

This is a great idea! It would require modifying the Racc engine, which is something almost no-one since the original author has done.

@rmosolgo
Copy link
Author

rmosolgo commented Nov 2, 2017

Cool, thanks for your response! If I get a chance to take a look, I'll be sure to report back :)

@rmosolgo rmosolgo closed this as completed Nov 2, 2017
@alexdowad
Copy link
Contributor

@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.

@alexdowad alexdowad reopened this Nov 3, 2017
@rmosolgo
Copy link
Author

rmosolgo commented Nov 3, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants