-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Parsing fails without space at end of file #306
Comments
This surely sounds like a bug... I'll have a look. |
This is a bug in the |
I could fix the bug. The reason was that instead of checking for |
I seem to experience this issues with version 2.1.1. libc++abi.dylib: terminating with uncaught exception of type std::invalid_argument: parse error - unexpected '|'; expected end of input |
@asimonov This is strange, as we added a regression test for this and the issue has not come up until since. As your error message mentions a different character: how does your JSON file and the code that parses it looks like? |
I'll try to get the text.
But it fails intermittently, thats the problem.
What is important is that i just replaced my json.hpp with your development version for 3.0.0 and i do not have the issue anymore
…_____________________________
Kind Regards,
Alexey Simonov
On 2 Oct 2017, at 12:05, Niels Lohmann ***@***.***> wrote:
@asimonov This is strange, as we added a regression test for this and the issue has not come up until since. As your error message mentions a different character: how does your JSON file and the code that parses it looks like?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm not planning to make any fixes for 2.x.x any more, so I'm glad that changing to the develop version helps you. But it would be good to see what went wrong anyway. |
For other people who ended up here from google: I was getting a similar error My issue was that I had a trailing comma after the last |
I understand the error message is a bit tricky, because it describes the parser's expectation... |
On parsing of this JSON file:
With the code:
json::parse gives this error:
However, it succeeds when adding a space to the end of the JSON file.
Is this a bug, or something obvious that I've missed?
Here's an archive with a working file, and a broken file:
example_json_files.zip
The text was updated successfully, but these errors were encountered: