Macro nom::many0 [] [src]

macro_rules! many0 {
    ($i:expr, $submac:ident!( $($args:tt)* )) => { ... };
    ($i:expr, $f:expr) => { ... };
}

many0!(I -> IResult<I,O>) => I -> IResult<I, Vec<O>> Applies the parser 0 or more times and returns the list of results in a Vec

the embedded parser may return Incomplete

 named!(multi<&[u8], Vec<&[u8]> >, many0!( tag!( "abcd" ) ) );

 let a = b"abcdabcdefgh";
 let b = b"azerty";

 let res = vec![&b"abcd"[..], &b"abcd"[..]];
 assert_eq!(multi(&a[..]), Done(&b"efgh"[..], res));
 assert_eq!(multi(&b[..]), Done(&b"azerty"[..], Vec::new()));

0 or more