[−][src]Macro nom::peek
peek!(I -> IResult<I,O>) => I -> IResult<I, O>
returns a result without consuming the input
the embedded parser may return Err(Err::Incomplete
named!(ptag, peek!( tag!( "abcd" ) ) ); let r = ptag(&b"abcdefgh"[..]); assert_eq!(r, Ok((&b"abcdefgh"[..], &b"abcd"[..])));