Function parameter

Source
pub fn parameter<'a, I>(
    input: I,
    indexer: &mut usize,
) -> IResult<I, Parameter<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 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.