Open mulle-nat opened 4 years ago
Currently JSMN does not allow anything else than object or array as the root value. This is going to be fixed in the future.
Well it does work, if you don't define JSMN_STRICT
though. So your comment isn't entirely correct.
Well, yeah. The non strict mode is.... special. I'd advice against using it personally. In future version it will be either gone or replaced by mode that implements proper standards.
Actually I kinda like the non-strict mode, as I am using jsmn more as a tokenizer and do the verification f.e. of floating point numbers or "true" vs. "thanks" at a later stage.
If you define
JSMN_STRICT
, then parsing a simple number doesn't work anymore (it does if you undefineJSMN_STRICT
):This will bail with error 2.