Function single_expression

Source
pub fn single_expression<'a, I>(
    input: I,
    indexer: &mut usize,
) -> IResult<I, SingleExpression<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 a single-expression as defined in the grammar spec.

§Grammar

single-expression       = alternation
                           | optional
                           | parameter
                           | text-without-whitespace+
                           | whitespace+
text-without-whitespace = (- (text-to-escape | whitespace))
                           | ('\', text-to-escape)
text-to-escape          = '(' | '{' | '/' | '\'

§Example

text(opt)/text
(opt)
{string}
text

§Errors

§Irrecoverable Failure

Any Failure of alternation(), optional() or parameter().

§Indexing

The given indexer is incremented only if the parsed SingleExpression is returned and it represents a Parameter.