Macro peel_ip::prelude::add_return_error []

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

Add an error if the child parser fails

While error! does an early return and avoids backtracking, add_return_error! backtracks normally. It just provides more context for an error

    named!(err_test, add_return_error!(ErrorKind::Custom(42), tag!("abcd")));

    let a = &b"efghblah"[..];
    let res_a = err_test(a);
    assert_eq!(res_a, Error(error_node_position!(ErrorKind::Custom(42), a, error_position!(ErrorKind::Tag, a))));