pub fn repeat<P: Parser, R, F, E>(p: &mut P, mut parse: F) -> Result<Vec<R>, E>
where
    F: FnMut(&mut P) -> Result<Option<R>, E>,
{
    let mut v = Vec::new();
    while p.peek(0).value != Eof {
        match parse(p)? {
            Some(x) => v.push(x),
            None => break,
        }
    }
    Ok(v)
}
/// Repeatedly apply a parser until it returns `None`.
Repeatedly apply a parser until it returns `None`.
Repeatedly apply a parser until it returns ` None ` .
pub fn repeat<P: Parser, R, F, E>(p: &mut P, mut parse: F) -> Result<Vec<R>, E>
where
    F: FnMut(&mut P) -> Result<Option<R>, E>,
{
    let mut v = Vec::new();
    while p.peek(0).value != Eof {
        match parse(p)? {
            Some(x) => v.push(x),
            None => break,
        }
    }
    Ok(v)
}
pub fn repeat < P : Parser , R , F , E > ( p : & mut P , mut parse : F ) -> Result < Vec < R > , E > where F : FnMut ( & mut P ) -> Result < Option < R > , E > , { let mut v = Vec :: new ( ) ; while p . peek ( 0 ) . value != Eof { match parse ( p ) ? { Some ( x ) => v . push ( x ) , None => break , } } Ok ( v ) }
Repeatedly apply a parser until it returns `None`.
Repeatedly apply a parser until it returns ` None ` .
p
&mut P
parse
F
p
&mut P
parse
F