Function alternation

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

Parses an alternation as defined in the grammar spec.

§Grammar

alternation        = single-alternation, (`/`, single-alternation)+
single-alternation = ((text-in-alternative+, optional*)
                       | (optional+, text-in-alternative+))+

§Example

left/right
left(opt)/(opt)right
escaped\ /text
no-need-to-escape)}/text
🦀/⚙️

§Errors

§Recoverable Error

  • If input doesn’t have /.

§Irrecoverable Failure