This is an S-Expression parser and formatter with the following goals:
Offering direct access to the tokenizer, anysexpr::parse
, but also
anysexpr::read
to build an in-memory tree easily.
Good error reporting (precise location information and messages).
(Future) Make the data constructors for anysexpr::read
parametrizable (generic), e.g. like in the sexpr_parser
crate.
Streaming: allow to read from and print to file handles lazily, for
use e.g. in communications. This currently works by using
anysexpr::parse
directly for input, or creating tokens to print
via a custom loop for output. Future: more possibilities, e.g. turn
a tree into a token stream, or parameterize with a tree that's
generated on demand while printing.
(Future) Support various s-expression variants (R*RS, Guile, Clojure, Common Lisp, ..) via runtime (and compile-time?) settings.
(Perhaps) be usable on microcontrollers (compilable small enough, no-std?).
This is an early alpha version. Even some basics are unfinished (inexact and complex numbers, quoting sugar, some comment styles, ..). The author is quite new to Rust. He is aware of the huge list of API guideline entries not currently being followed, and welcomes help in that area as well as others. The author is also quite invested in lisps and expects to support this library for a long time.
See examples/main.rs.
#\x...
, #\u...
, #\U...
#| |#
and #;
style comments#:foo
Orthogonally:
lexpr
crate in more detail (missed when researching
existing crates before starting this project)Christian Jaeger ch@christianjaeger.ch