GLib.Scanner.prototype.unexp_token

function unexp_token(expected_token: GLib.TokenType, identifier_spec: String, symbol_spec: String, symbol_name: String, message: String, is_error: Number(gint)): void {
    // Gjs wrapper for g_scanner_unexp_token()
}
  

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.prototype.peek_next_token followed by GLib.Scanner.prototype.unexp_token without an intermediate call to GLib.Scanner.prototype.get_next_token, as GLib.Scanner.prototype.unexp_token evaluates the scanner's current token (not the peeked token) to construct part of the message.

expected_token

the expected token

identifier_spec

a string describing how the scanner's user refers to identifiers (null defaults to "identifier"). This is used if expected_token is GLib.TokenType.identifier or GLib.TokenType.identifier_null.

symbol_spec

a string describing how the scanner's user refers to symbols (null defaults to "symbol"). This is used if expected_token is GLib.TokenType.symbol or any token value greater than %G_TOKEN_LAST.

symbol_name

the name of the symbol, if the scanner's current token is a symbol.

message

a message string to output at the end of the warning/error, or null.

is_error

if true it is output as an error. If false it is output as a warning.