Checks if the token at the specified index matches any of the expected types.
The index to check.
Optional
Rest
...expected: string[]The expected token types.
The token at the specified index if it matches, otherwise false.
Throws a syntax error.
The error message.
Optional
token: TokenThe token that caused the error.
The lexer instance for tokenizing input