jassielof/toonz
A Zig implementation of the TOON (Token-Oriented Object Notation) format.
A Zig parser implementation of the TOON (Token-Oriented Object Notation) format.
TOON is a line-oriented, indentation-based text format that encodes the JSON data model with explicit structure and minimal quoting. It's particularly efficient for arrays of uniform objects, providing a more compact and readable alternative to JSON for structured data.
See the full specification for details in depth.
Core Encoding/Decoding: Full JSON ↔ TOON conversion
Primitives: strings, numbers, booleans, null with smart quoting
Objects: Nested objects with indentation-based structure
Arrays: Both inline (primitives) and multi-line (objects/nested)
Tabular Arrays: Compact [N]{field1,field2}: format for uniform object arrays
Alternative Delimiters: Comma (default), tab (\t), and pipe (|) support
Delimiter Detection: Automatic delimiter detection in array headers [N<delim>]
CLI Tool: Encode and decode via command line or pipes
The project provides both a simple CLI for JSON to TOON conversion and vice versa, and its library.
keyFolding="safe" mode) - collapse single-key object chains into dotted notationexpandPaths="safe" mode) - split dotted keys into nested objectsspec/tests/fixtures/To continue improving this implementation:
keyFolding="safe" mode for dotted-path notationexpandPaths="safe" mode for splitting dotted keysTesting depends on the specification submodule fixtures.