-
Notifications
You must be signed in to change notification settings - Fork 59
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
Improve the error messages displayed by the JSON5 lexer and parser. #182
Improve the error messages displayed by the JSON5 lexer and parser. #182
Conversation
* Display the line number in the error message * Try to harmonize the error messages with the ones displayed by the classic yojson parser.
6f4cdb8
to
b9a1530
Compare
Thanks for the PR, it's definitely useful to have some better error messages. Can you add some tests for the error messages so that we know they are working fine and how they look? That will also serve as regression test. |
Thanks for the review. |
9b7ac7d
to
4796445
Compare
I think this is good for now. If you want to add more tests you're welcome. The CI failures are known and I have opened ocaml/opam-repository#26154 and ocaml/opam-repository#26156 to solve them but they are unrelated to the PR. Merging. Thanks for your contribution! |
93f3496
into
ocaml-community:master
CHANGES: *2024-06-27* ### Added - Add locations in the JSON5 parser error messages (@gcluzel, ocaml-community/yojson#182)
CHANGES: *2024-06-27* ### Added - Add locations in the JSON5 parser error messages (@gcluzel, ocaml-community/yojson#182)
Since JSON5 is a standard intended to parse JSON written by humans, it's a bit unfortunate that the error messages were not very descriptive.
I tried to make them closer to the ones displayed by the classic YoJson parser. Also, when it's available, the line where the error message is located is displayed.