Scanner.unexpToken

void unexpToken(glib.types.TokenType expectedToken, string identifierSpec, string symbolSpec, string symbolName, string message, int isError)

Outputs a message through the scanner's msg_handler, resulting from an unexpected token in the input stream. Note that you should not call [glib.scanner.Scanner.peekNextToken] followed by [glib.scanner.Scanner.unexpToken] without an intermediate call to [glib.scanner.Scanner.getNextToken], as [glib.scanner.Scanner.unexpToken] evaluates the scanner's current token (not the peeked token) to construct part of the message.

Parameters

expectedTokenthe expected token
identifierSpeca string describing how the scanner's user refers to identifiers (null defaults to "identifier"). This is used if expected_token is G_TOKEN_IDENTIFIER or G_TOKEN_IDENTIFIER_NULL.
symbolSpeca string describing how the scanner's user refers to symbols (null defaults to "symbol"). This is used if expected_token is G_TOKEN_SYMBOL or any token value greater than G_TOKEN_LAST.
symbolNamethe name of the symbol, if the scanner's current token is a symbol.
messagea message string to output at the end of the warning/error, or null.
isErrorif true it is output as an error. If false it is output as a warning.