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

Fix lexing failure #35

Merged
merged 1 commit into from
Oct 26, 2016
Merged

Fix lexing failure #35

merged 1 commit into from
Oct 26, 2016

Conversation

314eter
Copy link
Contributor

@314eter 314eter commented Oct 26, 2016

When there is an invalid token consisting of one character followed by eof, long_error tries to print more than one character, which results in a failure.

# Yojson.Safe.from_string "x";;
Exception: Failure "lexing: empty token".

# Yojson.Safe.from_string "xx";;
Exception: Yojson.Json_error "Line 1, bytes 0-2:\nInvalid token 'xx'".

I don't know whether there was a valid reason to look for more characters. If not, the fix is very easy.

@mjambon
Copy link
Member

mjambon commented Oct 26, 2016

We're only using the junk pattern and rule for error reporting so this should work.

@mjambon mjambon merged commit ac68013 into ocaml-community:master Oct 26, 2016
@mjambon
Copy link
Member

mjambon commented Oct 26, 2016

opam release in progress ocaml/opam-repository#7691

@314eter 314eter mentioned this pull request Feb 22, 2019
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

Successfully merging this pull request may close these issues.

2 participants