Function escaped
fn escaped<Input, Error, Normal, NormalOutput, Escape, EscapeOutput, Output>(normal: Normal, control_char: char, escape: Escape) -> impl Parser<Input, Output, Error>
where
Input: StreamIsPartial + Stream + Compare<char>,
Normal: Parser<Input, NormalOutput, Error>,
Escape: Parser<Input, EscapeOutput, Error>,
Output: Accumulate<NormalOutput> + Accumulate<EscapeOutput>,
Error: ParserError<Input>
Parse escaped characters, unescaping them
Arguments:
normal: unescapeable characters- Must not include
control
- Must not include
control_char: e.g.\for strings in most languagesescape: parse and transform the escaped character
Parsing ends when:
alt(normal, control._char)[Backtracks][crate::error::ErrMode::Backtrack]normaldoesn't advance the input stream- (complete) input stream is exhausted
Warning: If the normal parser passed to escaped_transform accepts empty inputs
(like alpha0 or digit0), escaped_transform will return an error,
to prevent going into an infinite loop.
Example
#
#