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

Parser issues #509

Closed
berkus opened this issue Mar 16, 2017 · 6 comments
Closed

Parser issues #509

berkus opened this issue Mar 16, 2017 · 6 comments

Comments

@berkus
Copy link
Contributor

berkus commented Mar 16, 2017

on a following json {"body": "text\v"}
it gives
parse error at 10: parse error - unexpected '"'

dropbox/json11 gives:

unescaped (11) in string

which is correct (this is an unescaped vertical tab, disallowed by JSON std)

@nlohmann
Copy link
Owner

The scanner recognizes the malformed string and returns a parse_error token. The problem is the implementation of the unexpect function. I wanted to be clever and avoid a unexpected parse error output, so I output the text of the last token which in this case is only the opening ". I have to look into this.

@nlohmann nlohmann added this to the Release 3.0.0 milestone Mar 16, 2017
@nlohmann
Copy link
Owner

With the overworked scanner in branch manual_lexer, the error message for the above code is

[json.exception.parse_error.101] parse error at 16: syntax error - invalid string: forbidden character after backspace; last read '"text\v'

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Mar 28, 2017
@nlohmann
Copy link
Owner

nlohmann commented Apr 8, 2017

The example in #551 shows that the diagnosis information got better. However, the output could be improved: last read '"\303?' does not help too much here.

@nlohmann
Copy link
Owner

nlohmann commented May 7, 2017

The new scanner (merged yesterday) now provides the diagnosis information described in #509 (comment).

@nlohmann nlohmann closed this as completed May 7, 2017
@nlohmann nlohmann self-assigned this May 7, 2017
@nlohmann nlohmann removed the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label May 7, 2017
@berkus
Copy link
Contributor Author

berkus commented May 12, 2017

After backspace?

@nlohmann
Copy link
Owner

Ooops. Fixed this.

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

2 participants