1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! # temporal-cortex-toon
//!
//! Pure-Rust encoder and decoder for **TOON (Token-Oriented Object Notation)** v3.0.
//!
//! TOON is a compact, human-readable serialization format designed to reduce LLM token
//! consumption when processing structured data. It achieves this through key folding
//! (indentation instead of braces), tabular compression for uniform arrays, and
//! context-dependent quoting that eliminates unnecessary quote tokens.
//!
//! ## Quick start
//!
//! ```rust
//! use toon_core::{encode, decode};
//!
//! // JSON → TOON
//! let json = r#"{"name":"Alice","scores":[95,87,92]}"#;
//! let toon = encode(json).unwrap();
//! assert_eq!(toon, "name: Alice\nscores[3]: 95,87,92");
//!
//! // TOON → JSON (roundtrip)
//! let back = decode(&toon).unwrap();
//! assert_eq!(back, json);
//! ```
//!
//! ## Modules
//!
//! - [`encoder`] — JSON string → TOON string
//! - [`decoder`] — TOON string → JSON string
//! - [`filter`] — Semantic filtering + TOON encode (`filter_and_encode`, `CalendarFilter`)
//! - [`error`] — Error types for parse/encode failures
//! - [`types`] — `ToonValue` AST (reserved for future direct-manipulation use)
pub use decode;
pub use encode;
pub use ToonError;
pub use ;