s-expression 0.2.0

A simple S-Expression parser
Documentation
  • Coverage
  • 100%
    23 out of 23 items documented7 out of 8 items with examples
  • Size
  • Source code size: 36.91 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.27 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • eckertliam/s-expression
    4 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • eckertliam

S-Expression Parser

A high-performance, zero-copy S-expression parser optimized for compiler use cases. Features fast parsing with minimal memory allocations through borrowed string slices and various performance optimizations.

Features

  • Zero-copy parsing: Uses borrowed string slices to avoid unnecessary allocations
  • Fast-path optimizations: Optimized number parsing and single-character symbols
  • Production error handling: Proper error types instead of panics
  • Memory efficient: Pre-allocated vectors and optimized tokenization

Quick Start

use sexpression::{Expression, read, ParseError};

fn main() -> Result<(), ParseError> {
    let source = "(define (factorial n) (if (= n 0) 1 (* n (factorial (- n 1)))))";
    let expr = read(source)?;
    println!("Parsed: {:?}", expr);
    Ok(())
}

Documentation

Run cargo doc --open to view the full documentation.