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
43
44
45
46
47
48
49
//! JSON behind the format seam (SPEC.md §JSON).
//!
//! Deliberately minimal, like [`crate::csv`]: the pieces live in their own
//! modules and this file only names them and re-exports the surface everything
//! else uses.
//!
//! * [`error`] — what a parse failure says: a byte offset and a reason.
//! * [`index`] — the lazy structural scanner: a container's immediate members
//! as byte ranges, found by a linear walk that builds no values and is
//! resumable a chunk at a time.
//! * [`parse`] — the hand-written RFC 8259 reader. Iterative, so nesting is
//! heap and never stack; fallible with a byte offset, so a bad `.jsonl` line
//! becomes an error row rather than a dead file.
//! * [`value`] — the tree it builds. Source-faithful: numbers keep their
//! literal text, duplicate object keys are kept in order.
//! * [`write`] — the tree back to compact JSON, which is what `Y` yanks.
//!
//! Nothing here reads a file, decides a viewport or paints: this is the format,
//! not the source. The lazy structural index and the `Source` implementation
//! sit above it.
// The format's surface, named once here so callers above it write
// `json::parse(...)` and `json::Value` rather than reaching into submodules.
// Nothing outside this module uses it yet — the JSON `Source` is a later roll —
// and in a binary crate an unused re-export is a warning; drop the allow once
// the source is wired in.
pub use ;
pub use ;
pub use ;
pub use to_compact;
// The seam between the three: text parsed to a value and written back must
// come out as the same document, and a value written and re-parsed must come
// out as the same value. Neither module owns that agreement, so the
// round-trip tests live here.