1 unstable release
new 0.1.0 | Nov 24, 2024 |
---|
#71 in Parser tooling
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());