3 pub(crate) trait Parser: Sized {
5 fn parse(&mut self, _input: &str) -> Result<(), ()> {
8 fn map<F, B>(self, _f: F) -> Map<Self, F>
10 F: FnMut(Self::Output) -> B,
16 pub(crate) struct Chainl1<P, Op>(P, Op);
17 impl<P, Op> Parser for Chainl1<P, Op>
21 Op::Output: FnOnce(P::Output, P::Output) -> P::Output,
23 type Output = P::Output;
25 pub(crate) fn chainl1<P, Op>(_parser: P, _op: Op) -> Chainl1<P, Op>
29 Op::Output: FnOnce(P::Output, P::Output) -> P::Output,
34 pub(crate) struct Map<P, F>(P, F);
35 impl<A, B, P, F> Parser for Map<P, F>
37 P: Parser<Output = A>,
47 pub fn chainl1_error_consume() {
48 fn first<T, U>(t: T, _: U) -> T {
51 let _ = chainl1(1, 1.map(|_| first)).parse("");