toml_parser/
lib.rs

1//! TOML lexer and parser
2//!
3//! Characteristics:
4//! - Error recovery
5//! - Lazy validation
6//! - `forbid(unsafe)` by default, requiring the `unsafe` feature otherwise
7//! - `no_std` support, including putting users in charge of allocation choices (including not
8//!   allocating)
9//!
10//! Full parsing is broken into three phases:
11//! 1. [Lexing tokens][lexer]
12//! 2. [Parsing tokens][parser] (push parser)
13//! 3. Organizing the physical layout into the logical layout,
14//!    including [decoding keys and values][decoder]
15
16#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
17#![cfg_attr(docsrs, feature(doc_auto_cfg))]
18#![cfg_attr(not(feature = "unsafe"), forbid(unsafe_code))]
19#![warn(clippy::std_instead_of_core)]
20#![warn(clippy::std_instead_of_alloc)]
21#![warn(clippy::print_stderr)]
22#![warn(clippy::print_stdout)]
23
24#[cfg(feature = "alloc")]
25extern crate alloc;
26
27#[macro_use]
28mod macros;
29
30#[cfg(feature = "debug")]
31pub(crate) mod debug;
32mod error;
33mod source;
34
35pub mod decoder;
36pub mod lexer;
37pub mod parser;
38
39pub use error::ErrorSink;
40pub use error::Expected;
41pub use error::ParseError;
42pub use source::Raw;
43pub use source::Source;
44pub use source::SourceIndex;
45pub use source::Span;
46
47#[doc = include_str!("../README.md")]
48#[cfg(doctest)]
49pub struct ReadmeDoctests;