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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//! Dump - the textual dump format every Davinci stage speaks.
//!
//! A folio is a stage artifact rendered as text. The contract is defined by
//! [`Dump`] together with the mode-explicit equality laws below; the
//! normalization rules shared by every folio page are documented in
//! `docs/davinci/plan/folio-format.md`.
//!
//! # Equality laws (mode-explicit)
//!
//! - [`Mode::Full`] is the injective, parseable form. The round-trip
//! laws apply: `print(parse(t)) == t` byte-for-byte for canonical
//! (normalized) text `t`, and `parse(print(v)) == v` structurally for
//! values. Non-canonical input is normalized by the first print, by
//! design - parse is lenient about section order and unsorted lists;
//! print always emits the canonical form.
//! - [`Mode::Display`] elides spans and defaults for humans and
//! carries **no** round-trip law. Do not parse `Display` output.
//!
//! Normalization (stable sequential ids, sorted map iteration) applies to
//! both modes.
use fmt;
use String;
/// `#[derive(Dump)]` - generates the mechanical trio (print / parse /
/// field order) for an owned document struct; see `vize_l0_derive`.
/// Anything semantic (`Display` elision, section meaning) stays
/// hand-written, so derived pages print the same canonical text in both
/// modes.
pub use Dump;
/// Print mode for a folio page.
///
/// See the module docs for the mode-explicit equality laws.
/// Parse error for a folio page.
///
/// Carries the 1-based line number in the input at which parsing failed.
/// A stage artifact that can be dumped as text and read back.
///
/// `print` with [`Mode::Full`] and `parse` form the round-trip pair;
/// see the module docs for the exact laws. Both directions normalize:
/// `parse` accepts non-canonical input where the format allows it, and
/// `print` always emits canonical text.
/// Snapshot-assert a [`Dump`] value using the normalized `Full`-mode
/// printer.
///
/// Expands to `insta::assert_snapshot!` over
/// `Dump::print_to_string(&value, Mode::Full)`, so snapshots pin the
/// canonical text and stay diffable. The expansion carries the workspace's
/// `#[expect(clippy::disallowed_macros)]` insta convention; the consuming
/// crate needs `insta` as a dev-dependency.
// Stable aliases for the earlier foundation surface.
pub use Error as DumpError;
pub use Mode as DumpMode;
pub use ;
pub use DumpValue;