klyn.code.CodeTokenizer.lineCommentAt
method
public lineCommentAt(line as String, index as Long) as String
Description

Checks whether a single-line comment starts at index in line.

Parameters
ParameterDescription
lineSource line text.
indexZero-based index in line.
Returns

Matching comment marker, or "" if none matches at index.

Example
import klyn.code

t = CodeTokenizer(LanguageProfile("klyn", "Klyn").withLineComments(["#"]))
assert t.lineCommentAt("x = 1 # note", 6) == "#"