Macro peel_ip::prelude::peek
[−]
macro_rules! peek { ( $ i : expr , $ submac : ident ! ( $ ( $ args : tt ) * ) ) => { ... }; ( $ i : expr , $ f : expr ) => { ... }; }
peek!(I -> IResult<I,O>) => I -> IResult<I, O>
returns a result without consuming the input
the embedded parser may return Incomplete
named!(ptag, peek!( tag!( "abcd" ) ) ); let r = ptag(&b"abcdefgh"[..]); assert_eq!(r, Done(&b"abcdefgh"[..], &b"abcd"[..]));