GLib.Scanner.prototype.peek_next_token
function peek_next_token(): GLib.TokenType {
// Gjs wrapper for g_scanner_peek_next_token()
}
Parses the next token, without removing it from the input stream. The token data is placed in the @next_token, @next_value, @next_line, and @next_position fields of the GLib.Scanner structure.
Note that, while the token is not removed from the input stream (i.e. the next call to GLib.Scanner.prototype.get_next_token will return the same token), it will not be reevaluated. This can lead to surprising results when changing scope or the scanner configuration after peeking the next token. Getting the next token after switching the scope or configuration will return whatever was peeked before, regardless of any symbols that may have been added or removed in the new scope.
- Returns
the type of the token