jsmn_util.c - do you want extras?

Issue #48 new
Matthew Astley
created an issue

Thanks for the parser, surprisingly easy to use!

I found I wanted some extra stuff, like unescaping strings and converting jsmntype_t into text. I wrote some stuff (it's in a Git repo on another project - cf. issue #47) and with tests, so I could convert back to .hg and make a pull request.

Do you want extras, given they could be completely omitted and not increase the footprint if there were unwanted?

What about additions that add a (void*) to jsmn_parser and some extra code to jsmn.c, for generating errors?

Comments (3)

  1. Matthew Astley reporter

    @Gabriel Gritsch True, I didn't make an escape hatch here for errors. It translates as in new jsmn_test.c fn,

    "\\u0000\\u00ff" --> "\x00\xff" but "\\u0100" --> "\\u0100" (unchanged).

    The plumbing is there, it just needs a u8_wc_toutf8 or similar, and the relevant bounds checking.

    My data doesn't need it... I'm not going to venture an answer on whether "minimal" is compatible with "Unicode". I do think 70% of users parsing strings are going to want them unescaped though.

  2. Log in to comment