klyn.code.SourceTokenCursor.next
method
public next() as Token
Description

Returns the current token and advances the cursor to the next token.

Returns

Consumed Token, or null if at end of stream.

Example
import klyn.code
import klyn.code.klyn

cursor = SourceTokenCursor.fromSource(KlynTokenizer(), "return 42")
assert cursor.next().text == "return"
assert cursor.next().text == "42"