yyjson icon indicating copy to clipboard operation
yyjson copied to clipboard

JSON5 Support

Open VaslD opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

No.

Describe the solution you'd like

Would YYJSON support JSON5 standard? It expands the JSON spec to support previously non-standard comments, single quotes, and trailing commas, also adds infinite numbers, multiline strings, and hex representations, etc.

At the moment, I'm more interested in reading JSON5 than having write support. Programs usually have full control of its output, but most inputs may be user-supplied or produced by another program, which may have already adopted JSON5.

Describe alternatives you've considered

Some of these additions in JSON5 can be read/write with YYJSON's nonstandard options, but most of the new syntax is considered invalid JSON, therefore unusable.

Additional context

None.

VaslD avatar Jul 10 '23 15:07 VaslD

I'll consider it in the future, but it's not a high priority right now. Supporting more non-standard JSON formats could affect the parsing performance of standard JSON. So I need to do more evaluation before making any changes.

ibireme avatar Jul 10 '23 16:07 ibireme