nom::peek!
[−]
[src]
macro_rules! peek { ($i:expr, $submac:ident!( $($args:tt)* )) => { ... }; ($i:expr, $f:expr) => { ... }; }
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"[..]));