klyn.code.CodeTokenizer.collectIdentifiers
method
public collectIdentifiers(source as String, minLength as Long = 2) as ArrayList<String>
Description

Collects all unique identifier tokens of length >= minLength occurring in code positions (outside comments and string/character/regex literals) in source.

Parameters
ParameterDescription
sourceFull document text.
minLengthMinimum identifier character length.
Returns

Ordered list of unique identifiers found in source.

Example
import klyn.code.klyn

t = KlynTokenizer()
ids = t.collectIdentifiers("alpha = beta + alpha # ignore_comment")
assert "alpha" in ids
assert "beta" in ids
assert "ignore_comment" not in ids