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

[Feature Request] More helpful error message when single quotes detected #119

Open
agilgur5 opened this issue Jan 5, 2019 · 2 comments
Open

Comments

@agilgur5
Copy link

agilgur5 commented Jan 5, 2019

If you use single quotes, it will (confusingly) tell you "expected STRING, got undefined". Single quotes are in fact strings, but invalid JSON, and therefore a very common error (see #46 , and Kong/insomnia#1150), so I think a more informative error message would be much more helpful.

@agilgur5 agilgur5 closed this as completed Jan 5, 2019
@agilgur5 agilgur5 changed the title expected string [Feature Request] More helpful error message when single quotes detected Jan 5, 2019
@agilgur5 agilgur5 reopened this Jan 5, 2019
@prantlf
Copy link

prantlf commented May 18, 2019

You could add single quotes to the lexer and instead of recognising them as string declarators, you would just make the tokenisation fail. I did something similar for JavaScript-like comments, so that they could be either ignored, or reported by a better error message.

@agilgur5
Copy link
Author

Oh cool, thanks for the suggestion @prantlf !

Good luck on the fork and hope it does well! I also maintain a heavily updated fork of a library :)

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

No branches or pull requests

2 participants