Registry / other / pest
library2.8.6rscratesunverified

The Elegant Parser: a PEG parser generator for Rust.

# Cargo.toml [dependencies] pest = "2.8.6"
INSTALL
IMPORT
SIG · PEST
P
pest
otherrustv2.8.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Parser
use pest::Parser;

Define a PEG grammar inline and parse input using the generated parser.

use pest::Parser; #[derive(Parser)] #[grammar_inline = "greeting = { \"hello\" ~ \"world\" }"] struct GreetingParser; let pairs = GreetingParser::parse(Rule::greeting, "helloworld").unwrap(); println!("Parsed: {:?}", pairs);
Debug
Known issues
gotchaGrammar files must be included at compile time via #[grammar_inline] or #[grammar_file]
fix
Use #[grammar_inline = "..."] for inline grammar or ensure .pest file is in the correct path
affects: >=2.0.0
Upgrade
Version history
2.8.6latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
pest — cargo add pest · libregistry