Skip to content

add JSON5 support#185

Open
payneca wants to merge 12 commits intobecls:devfrom
payneca:cpayne/json
Open

add JSON5 support#185
payneca wants to merge 12 commits intobecls:devfrom
payneca:cpayne/json

Conversation

@payneca
Copy link
Copy Markdown
Collaborator

@payneca payneca commented Mar 30, 2026

Fixes

  • fixed an issue where reading a JSON string immediately after a failure to read a string resulted in incorrect output.

  • fixed an issue where reading a JSON float with a large exponent consumed CPU.

Proposed changes

  • require Chez Scheme 10.3.0; drop 9.6.4

  • breaking: change representation of JSON null from the character #\nul to the symbol null

  • breaking: change JSON read and write functions to use options
    This introduces new json:read-options and json:write-options.
    custom-inflate is now the inflate-object field of json:read-options.
    custom-write is now the custom-write field of json:write-options.

  • breaking: move stack->json and json-stack->string to json.ss
    Code that used (import (swish log-db)) may now need (import (swish json)) to access these procedures.

  • A new json5? option allows disabling JSON5 support. By default JSON5 is enabled.

  • A new inflate-symbol option allows raw symbols in JSON-like input to be internalized using a custom function.

  • A new extended-identifiers? option allows raw symbols in JSON-like input to include characters not allowed by the JSON5 identifier syntax.

  • split JSON documentation into a separate chapter

  • export json:key=?

@laqrix laqrix requested a review from burgerrg March 30, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant