1 unstable release

0.1.0 Nov 24, 2024

#70 in Parser tooling

Download history 69/week @ 2024-11-18 53/week @ 2024-11-25

122 downloads per month

MIT license

48KB
904 lines

syntaxe

A simple, declarative parser-combinator library.


lib.rs:

Memoir is a library of self-describing, reflective parser-combinators. Parsers are represented as reified objects that can print themselves as documentation.

For most purposes, syntaxe's prelude should be imported.

use syntaxe::*;

let parser =
    string("set").then(optional(symbol('!')))
    .then(whitespace())
    .then(string("on").or(string("off")));

assert!(parser.parse("set on").is_ok());

No runtime deps