This is a great library which I was successfully using, but in recent commits I have a problem with calculation of token size. Always the size is
1 for top-level or nested objects/arrays, and is
1 for Name strings (why would string have a size > 0?)
Given the simple JSON object:
token.size = 1
A simple nested object example:
I suspect this became broken at commit 84cb579. Token size was correct previously. Is it related to the "implemented key/value hierarchy"? (which is not documented anywhere that I can find)
case ':': parser->toksuper = parser->toknext - 1; break;
Removing line 240 fixes the issue for non-strict parsing. However, with JSMN_STRICT, this causes other issues which I did not fully characterize.
I do not understand what is being done at line 240 (it probably is related to "implemented key/value hierarchy", but there are no comments or documentation about that).