[][src]Macro nom::call

macro_rules! call {
    ($i:expr, $fun:expr) => { ... };
    ($i:expr, $fun:expr, $($args:expr),* ) => { ... };
}

Used to wrap common expressions and function as macros

  fn take_wrapper(input: &[u8], i: u8) -> IResult<&[u8],&[u8]> { take!(input, i * 10) }

  // will make a parser taking 20 bytes
  named!(parser, call!(take_wrapper, 2));