nom::map_res!
[−]
[src]
macro_rules! map_res( ($i:expr, $submac:ident!( $($args:tt)* ), $submac2:ident!( $($args2:tt)* )) => ( { match $submac!($i, $($args)*) { $crate::IResult::Error(e) => $crate::IResult::Error(e), $crate::IResult::Incomplete($crate::Needed::Unknown) => $crate::IResult::Incomplete($crate::Needed::Unknown), $crate::IResult::Incomplete($crate::Needed::Size(i)) => $crate::IResult::Incomplete($crate::Needed::Size(i)), $crate::IResult::Done(i, o) => match $submac2!(o, $($args2)*) { Ok(output) => $crate::IResult::Done(i, output), Err(_) => $crate::IResult::Error($crate::Err::Position($crate::ErrorCode::MapRes as u32, $i)) } } } ); ($i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => ( map_res!($i, $submac!($($args)*), call!($g)); ); ($i:expr, $f:expr, $g:expr) => ( map_res!($i, call!($f), call!($g)); ); ($i:expr, $f:expr, $submac:ident!( $($args:tt)* )) => ( map_res!($i, call!($f), $submac!($($args)*)); ); );
maps a function returning a Result on the output of a parser