Skip to main content

scheme_edit/
lib.rs

1//! Lossless Scheme S-expression parser and editor (toml_edit-style CST).
2//!
3//! Every byte of the source (whitespace, comments, escapes) is stored in the
4//! tree, so `parse(s).to_string() == s` holds by construction; edits splice
5//! in new nodes while untouched regions survive verbatim.
6//!
7//! ```
8//! use scheme_edit::Document;
9//! let src = "; header\n(list (a 1)\t(b 2))\n";
10//! let doc = Document::parse(src).unwrap();
11//! assert_eq!(doc.to_string(), src);
12//! ```
13
14mod build;
15mod cst;
16mod document;
17mod edit;
18mod lexer;
19mod parser;
20mod pretty;
21
22pub use build::{atom, escape_string, list, quoted_sym, string_lit, sym};
23pub use cst::{Item, ListKind, Node};
24pub use document::Document;
25pub use lexer::ParseError;
26pub use pretty::pretty;