parse_optional

Function parse_optional 

Source
pub fn parse_optional<'a, F, R>(
    lexer: &mut Lexer<'a>,
    expected: Token,
    cb: F,
) -> ParseResult<Option<R>>
where F: FnOnce(&mut Lexer<'a>) -> ParseResult<R>,
Expand description

Parses an optional tokens from a lexer.

The expected token is removed from the token stream before the callback is invoked.