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

string parser does not recognize uncompliant strings #12

Closed
nlohmann opened this issue Jan 5, 2015 · 3 comments
Closed

string parser does not recognize uncompliant strings #12

nlohmann opened this issue Jan 5, 2015 · 3 comments

Comments

@nlohmann
Copy link
Owner

nlohmann commented Jan 5, 2015

The Readme currently states:

Furthermore, we allow for more escape symbols in strings as the JSON specification. While this may not be a problem in reality, we are aware of it, but as long as we have a hand-written parser, we won't invest too much to be fully compliant.

And in fact, anything between two unescaped quotes will be treated as strings. However, the JSON standard is very explicit how a string may look like:

As long as the class does not implement this string specification, the class is not fully JSON compliant.

@nlohmann
Copy link
Owner Author

nlohmann commented Jan 5, 2015

The parser of https://github.com/dropbox/json11 could give some ideas how to write a compliant parser manually.

@nlohmann
Copy link
Owner Author

nlohmann commented Jan 6, 2015

Also http://re2c.org may help (as pointed out by drac667).

nlohmann added a commit that referenced this issue Jan 9, 2015
Implemented the JSON spec for string parsing for everything but the \uXXXX escaping - see issue #12.
@nlohmann
Copy link
Owner Author

Fixed in latest commit: re2c is used.

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

No branches or pull requests

1 participant