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)
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.
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'
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.
The new scanner (merged yesterday) now provides the diagnosis information described in https://github.com/nlohmann/json/issues/509#issuecomment-289915749.
After backspace?
Ooops. Fixed this.