klyn.code.CodeTokenizer.isCodePositionInSource
method
public isCodePositionInSource(source as String, targetLine as Long, targetColumn as Long) as Boolean
Description

Checks whether (targetLine, targetColumn) in a multi-line source document is a code position (outside comments and string/character/regex literals).

Parameters
ParameterDescription
sourceFull document text.
targetLineZero-based line index.
targetColumnZero-based column offset.
Returns

true when (targetLine, targetColumn) is in executable code.

Example
import klyn.code.klyn

t = KlynTokenizer()
assert t.isCodePositionInSource("x = 1\ny = \"str\"", 0, 2)
assert not t.isCodePositionInSource("x = 1\ny = \"str\"", 1, 6)