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
//! Lossless, error-tolerant TOML parsing, validation, semantics, highlighting, and formatting.
//!
//! [`Document`] is the main entry point. It owns an immutable source snapshot and all products
//! derived from that snapshot. Choose the TOML language version explicitly in reusable tools;
//! [`Document::parse`] is a convenience that currently selects TOML 1.1.
//!
//! ```
//! use tomlsmith::{Document, FormatOutcome, TomlVersion};
//!
//! let document = Document::parse_as("name=\"TomlSmith\"\n", TomlVersion::V1_1);
//! assert!(document.diagnostics().is_empty());
//! assert_eq!(document.semantics().declarations().len(), 1);
//!
//! match document.format() {
//! FormatOutcome::Changed { text, .. } => assert_eq!(&*text, "name = \"TomlSmith\"\n"),
//! outcome => panic!("expected a formatting change, got {outcome:?}"),
//! }
//! ```
//!
//! Formatting is guarded: snapshots with parse, version, or semantic errors produce
//! [`FormatOutcome::Refused`] instead of rewritten text. Syntax handles are snapshot-scoped and
//! expose `TomlSmith`'s own [`SyntaxKind`] rather than the private tree implementation.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;