mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-24 03:20:30 +00:00
Make JSON parser perfectly conformant
This commit is contained in:
parent
60164a7266
commit
b707fca77a
7 changed files with 260 additions and 183 deletions
|
@ -725,16 +725,12 @@ FUNCTIONS
|
|||
output is valid. Please note that invalid utf-8 could still
|
||||
happen if it's encoded as utf-8.
|
||||
|
||||
This parser is lenient about commas and colons. For example
|
||||
it's permissible to say `DecodeJson('[1 2 3 4]')`. Trailing
|
||||
commas are allowed. Even prefix commas are allowed. However
|
||||
it's not recommended that you rely on this behavior, and it
|
||||
won't round-trip with EncodeJson() currently.
|
||||
|
||||
When objects are parsed, your Lua object can't preserve the
|
||||
the original ordering of fields. As such, they'll be sorted
|
||||
by EncodeJson() and may not round-trip with original intent
|
||||
|
||||
This parser has perfect conformance with JSONTestSuite.
|
||||
|
||||
EncodeJson(value[, options:table])
|
||||
├─→ json:str
|
||||
├─→ true [if useoutput]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue