public SourceTokenCursor(tokens as ArrayList<Token>, skipTrivia as Boolean = true)
Constructs a cursor over a list of Tokens.
| Parameter | Description |
|---|---|
tokens | Token list produced by a Tokenizer. |
skipTrivia | true to automatically skip whitespace and comments during iteration. |
import klyn.code
import klyn.code.klyn
cursor = SourceTokenCursor(KlynTokenizer().tokenize("def run(): pass"), true)
assert cursor.hasNext()