Skip to main content

Module json

Module json 

Source
Expand description

Hand-rolled JSON parser and emitter for CJC.

Design decisions:

  • Uses BTreeMap for object keys → deterministic, sorted output
  • No external dependencies (no serde)
  • Converts JSON ↔ CJC Value directly
  • Strings always use \uXXXX escaping for non-ASCII in output

Enums§

JsonValue
A JSON value, using BTreeMap for deterministic key ordering.

Functions§

json_parse
Parse a JSON string into a CJC Value.
json_stringify
Convert a CJC Value to a JSON string with sorted keys.