pub fn parameter<'a, Input>(
    input: Input,
    indexer: &mut usize
) -> IResult<Input, Parameter<Input>, Error<Input>>where
    Input: Clone + Display + Offset + InputLength + InputTake + InputTakeAtPosition<Item = char> + Slice<RangeFrom<usize>> + InputIter + for<'s> Compare<&'s str> + 'a,
    <Input as InputIter>::Item: AsChar + Copy,
    Error<Input>: ParseError<Input>,
    for<'s> &'s str: FindToken<<Input as InputIter>::Item>,
Expand description

Parses a parameter as defined in the grammar spec.

Grammar

parameter       = '{', name*, '}'
name            = (- name-to-escape) | ('\', name-to-escape)
name-to-escape  = '{' | '}' | '(' | '/' | '\'

Example

{}
{name}
{with spaces}
{escaped \/\{\(}
{no need to escape )}
{🦀}

Errors

Recoverable Error

  • If input doesn’t start with {.

Irrecoverable Failure.

Indexing

The given indexer is incremented only if the parsed Parameter is returned.