[][src]Macro nom::apply

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

emulate function currying: apply!(my_function, arg1, arg2, ...) becomes my_function(input, arg1, arg2, ...)

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

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