MCPcopy Create free account
hub / github.com/pest-parser/pest / parse

Method parse

pest/src/macros.rs:335–348  ·  view source on GitHub ↗
(_: Rule, input: &str)

Source from the content-addressed store, hash-verified

333
334 impl Parser<Rule> for AbcParser {
335 fn parse(_: Rule, input: &str) -> Result<Pairs<'_, Rule>, Error<Rule>> {
336 state(input, |state| {
337 state
338 .rule(Rule::a, |s| {
339 s.skip(1)
340 .unwrap()
341 .rule(Rule::b, |s| s.skip(1))
342 .unwrap()
343 .skip(1)
344 })
345 .and_then(|s| s.skip(1).unwrap().rule(Rule::c, |s| s.match_string("e")))
346 .and_then(|s| s.optional(|s| s.rule(Rule::d, |s| s.match_string("fgh"))))
347 })
348 }
349 }
350
351 #[test]

Callers

nothing calls this directly

Calls 5

stateFunction · 0.85
ruleMethod · 0.80
optionalMethod · 0.80
skipMethod · 0.45
match_stringMethod · 0.45

Tested by

no test coverage detected