Function escaped_transform
fn escaped_transform<I, Error, F, G, O1, O2, ExtendItem, Output>(normal: F, control_char: char, transform: G) -> impl FnMut(I) -> crate::internal::IResult<I, Output, Error>
where
I: Clone + crate::traits::Offset + Input + crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
O1: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
O2: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
<I as Input>::Item: crate::traits::AsChar,
F: Parser<I, Output = O1, Error = Error>,
G: Parser<I, Output = O2, Error = Error>,
Error: ParseError<I>
Matches a byte string with escaped characters.
- The first argument matches the normal characters (it must not match the control character)
- The second argument is the control character (like
\in most languages) - The third argument matches the escaped characters and transforms them
As an example, the chain abc\tdef could be abc def (it also consumes the control character)
# use ;
# use from_utf8;
use ;
use alpha1;
use alt;
use value;
assert_eq!;
assert_eq!;