klyn.code.SourceTokenCursor.SourceTokenCursor
constructor
public SourceTokenCursor(tokens as ArrayList<Token>, skipTrivia as Boolean = true)
Description

Constructs a cursor over a list of Tokens.

Parameters
ParameterDescription
tokensToken list produced by a Tokenizer.
skipTriviatrue to automatically skip whitespace and comments during iteration.
Example
import klyn.code
import klyn.code.klyn

cursor = SourceTokenCursor(KlynTokenizer().tokenize("def run(): pass"), true)
assert cursor.hasNext()