Skip to main content

Crate scheme_edit

Crate scheme_edit 

Source
Expand description

Lossless Scheme S-expression parser and editor (toml_edit-style CST).

Every byte of the source (whitespace, comments, escapes) is stored in the tree, so parse(s).to_string() == s holds by construction; edits splice in new nodes while untouched regions survive verbatim.

use scheme_edit::Document;
let src = "; header\n(list (a 1)\t(b 2))\n";
let doc = Document::parse(src).unwrap();
assert_eq!(doc.to_string(), src);

Structs§

Document
A whole source file: top-level forms plus all surrounding trivia.
ParseError

Enums§

Item
One element of a list body or the top level. Whitespace and comments are items like any other, so emitting a document is pure concatenation.
ListKind
Node

Functions§

atom
Any atom rendered verbatim (numbers, booleans, keywords, …).
escape_string
The quoted, escaped literal as text: a"b -> "a\"b".
list
A paren list with children separated by single spaces.
pretty
Render NODE in guix house style starting at column INDENT.
quoted_sym
'name
string_lit
A string literal node; escapes \ and " only.
sym
A symbol atom.