public class LineScanResult extends Object
Holds the token spans produced for a single line along with the resulting end-of-line LexicalState.
import klyn.code result = LineScanResult([], LexicalState.NORMAL) assert result.endState.isNormal()
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | endStateendState as LexicalState |
Lexical state reached at the end of the scanned line. |
| public readonly property | spans | Ordered list of token spans on the scanned line. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | LineScanResultLineScanResult(spans as ArrayList<TokenSpan>, endState as LexicalState = null) |
Constructs a line scan result from a list of spans and an end-of-line state. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | isCodePosition | Determines whether column lies in executable code (neither inside a comment nor inside a string/character/regex literal). |
| public | tokenAt | Finds the TokenSpan containing the given zero-based column using binary search. |