pest 0.1.0

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.

The parser generator is currently experimental and will change.

Example

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

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

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

Features

  • infix PEG rules
  • macro-generated recursive descent parser
  • white-space detection
  • token generation
  • automatic error reporting
  • macro-generated Packrat parser
  • large file buffer
  • token pattern-matching