Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
pest 0.0.1 - Docs.rs
[go: Go Back, main page]

pest 0.0.1

Smart PEGs in Rust
Documentation

pest. Smart PEGs in Rust

pest is a parser generator that works with PEGs.

It relies exclusively on macros to create an efficient parser at compile-time.

Example

impl_rdp!(MyRdp);

impl MyRdp {
    grammar! {
        exp = { paren ~ exp | [""] }
        paren = { ["("] ~ exp ~ [")"] }
    }
}

let mut parser = MyRdp::new(Box::new(StringInput::new("(())((())())()")));

assert!(parser.exp());
assert!(parser.end());