1 unstable release
0.1.0 | Nov 24, 2024 |
---|
#70 in Parser tooling
122 downloads per month
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());