Function Parser.expect

final const(TokenStructure!(ubyte,"import dparse.lexer:TokenTriviaFields,TriviaToken; mixin TokenTriviaFields;"))* expect (
  ubyte type
);

Returns

a pointer to a token of the specified type if it was the next token, otherwise calls the error function and returns null.

Advances the lexer by one token in the case that the token was the one that was expected. Otherwise, only advances if the current token is not a semicolon, right parenthesis, or closing curly brace.