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

Returns the current token without advancing the cursor, or null at end of stream.

Returns

Current Token or null.

Example
import klyn.code
import klyn.code.klyn

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