LineScanResult
classin packageklyn.code
public class LineScanResult extends Object
└ LineScanResult

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()
Properties
Modifier and Type Member Description
public readonly property endState
endState 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.
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public LineScanResult
LineScanResult(spans as ArrayList<TokenSpan>, endState as LexicalState = null)
Constructs a line scan result from a list of spans and an end-of-line state.
Methods
Modifier and Type Member Description
public isCodePosition
isCodePosition(column as Long) as Boolean
Determines whether column lies in executable code (neither inside a comment nor inside a string/character/regex literal).
public tokenAt
tokenAt(column as Long) as TokenSpan
Finds the TokenSpan containing the given zero-based column using binary search.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml