nextInt

abstract fun nextInt(): Int

Returns the Token.NUMBER value of the next token, consuming it.

If the next token is a string, this method will attempt to parse it as an int. If the next token's numeric value cannot be exactly represented by a Int, this method throws.

Throws

if the next token is not a literal value, if the next literal value cannot be parsed as a number, or exactly represented as an int.