sexpr_parse 1.0.0

Parser for S-expressions
Documentation
  • Coverage
  • 0%
    0 out of 20 items documented0 out of 0 items with examples
  • Size
  • Source code size: 12.64 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.93 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: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • cyruscook/spectec_parse
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cyruscook

sexpr_parse

Parser for S-expressions.

Reads a string and parses it into S-expressions of either nodes, atoms, or text.

This crate is specifically designed to parse the S-expressions generated by SpecTec, and it has not been tested on other forms of S-expressions.

Usage

let input = r#"(typ "m" (inst (alias nat)))"#;
let sexprs = parse_sexpr_stream(input).unwrap();
assert_eq!(
    sexprs,
    vec![SExprItem::Node(
        "typ".to_string(),
        vec![
            SExprItem::Text("m".to_string()),
            SExprItem::Node(
                "inst".to_string(),
                vec![SExprItem::Node(
                    "alias".to_string(),
                    vec![SExprItem::Atom("nat".to_string())]
                )]
            )
        ]
    )]
);