consume
Consumes the current token and returns its text content.
fun consume(type: T, errorMessage: (Token<T>) -> String = { "Token type $type expected." }): Token<T>
Consumes a token with the given type and returns it. If the current token has a different type, an exception is thrown.
fun consume(text: String, ignoreCase: Boolean = false, errorMessage: (Token<T>) -> String = {"Expected: '$text'"}): Token<T>
Consume and return a token with the given text value. If the current token type does not match, an exception is thrown.