[][src]Macro nom::delimited

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

delimited!(I -> IResult<I,T>, I -> IResult<I,O>, I -> IResult<I,U>) => I -> IResult<I, O> delimited(opening, X, closing) returns X

named!(bracketed,
    delimited!(
        tag!("("),
        take_until!(")"),
        tag!(")")
    )
);

let input = &b"(test)"[..];
assert_eq!(bracketed(input), Ok((&b""[..], &b"test"[..])));