Crate rsexpr

Source
Expand description

§rsexpr

Small and simple S-expression parsing and manipulation with support for square-bracketed groups and strings. Used by syntastica for processing tree-sitter queries.

Have a look at Sexpr, OwnedSexpr, from_slice, and from_slice_multi for more information.

§Features

  • comments — Include comments in the parsed tree and pretty-printed output
  • docs — Meant to be enabled when building docs

Structs§

OwnedSexprs
A thin wrapper around Vec<OwnedSexpr> with its own Display implementation. See OwnedSexpr for more information.
Sexprs
A thin wrapper around Vec<Sexpr> with its own Display implementation. See Sexpr for more information.

Enums§

Error
The crate error type.
OwnedSexpr
An owned version of Sexpr. You can convert to and from Sexpr using the From trait.
ParenKind
A kind of parentheses. Used in Error::MissingClosingParen and Error::ExtraClosingParen to indicate the kind of parentheses that caused the error.
Sexpr
A single node of the tree. The Atom and String variants reference the input slice. For an owned version have a look at OwnedSexpr.

Functions§

from_slice
Parse a Sexpr from bytes. This fails if there is more than one S-expression in the input. To allow an arbitrary amount of S-expressions, have a look at from_slice_multi.
from_slice_multi
Parse multiple Sexprs from bytes. To only parse a single one, have a look at from_slice.

Type Aliases§

Result
The default result type. The error variant is a vector of Errors