nom::recognize
[−]
[src]
macro_rules! recognize { ($i:expr, $submac:ident!( $($args:tt)* )) => { ... }; ($i:expr, $f:expr) => { ... }; }
recognize!(&[T] -> IResult<&[T], O> ) => &[T] -> IResult<&[T], &[T]>
if the child parser was successful, return the consumed input as produced value
named!(x, recognize!(delimited!(tag!("<!--"), take!(5), tag!("-->")))); let r = x(&b"<!-- abc --> aaa"[..]); assert_eq!(r, Done(&b" aaa"[..], &b"<!-- abc -->"[..]));