public lineCommentAt(line as String, index as Long) as String
Checks whether a single-line comment starts at index in line.
| Parameter | Description |
|---|---|
line | Source line text. |
index | Zero-based index in line. |
Matching comment marker, or "" if none matches at index.
import klyn.code
t = CodeTokenizer(LanguageProfile("klyn", "Klyn").withLineComments(["#"]))
assert t.lineCommentAt("x = 1 # note", 6) == "#"