Function alternative

Source
pub fn alternative<'a, I>(input: I) -> IResult<I, Alternative<I>, Error<I>>
where I: Clone + Display + Offset + Input + for<'s> Compare<&'s str> + 'a, <I as Input>::Item: AsChar + Copy, Error<I>: ParseError<I>, for<'s> &'s str: FindToken<<I as Input>::Item>,
Expand description

Parses an alternative as defined in the grammar spec.

§Grammar

alternative           = optional | (text-in-alternative+)
text-in-alternative   = (- alternative-to-escape)
                         | ('\', alternative-to-escape)
alternative-to-escape = ' ' | '(' | '{' | '/' | '\'

§Example

text
escaped\ whitespace
no-need-to-escape)}
🦀
(optional)

§Errors

§Irrecoverable Failure

Any Failure of optional().