logo
pub fn alternative<'a, Input: 'a>(
    input: Input
) -> IResult<Input, Alternative<Input>, Error<Input>> where
    Input: Clone + Display + Offset + InputLength + InputTake + InputTakeAtPosition<Item = char> + Slice<RangeFrom<usize>> + InputIter + for<'s> Compare<&'s str>,
    <Input as InputIter>::Item: AsChar + Copy,
    Error<Input>: ParseError<Input>,
    for<'s> &'s str: FindToken<<Input as InputIter>::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().