oni-comb-parser-rs 0.0.663

A Rust crate for parser combinators
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::core::{ParserMonad, Parsers};
use crate::extension::parsers::LazyParsers;
use crate::internal::ParsersImpl;
use std::fmt::Debug;

impl LazyParsers for ParsersImpl {
  fn lazy<'a, I, A, F>(f: F) -> Self::P<'a, I, A>
  where
    F: Fn() -> Self::P<'a, I, A> + 'a,
    A: Debug + 'a, {
    Self::unit().flat_map(move |_| f())
  }
}