klyn.code.LanguageProfile.isKeyword
method
public isKeyword(word as String) as Boolean
Description

Checks in $O(1)$ whether word is a registered keyword of this language.

Parameters
ParameterDescription
wordToken text to test.
Returns

true if word is a keyword.

Example
import klyn.code

p = LanguageProfile("klyn", "Klyn").withKeywords(["def", "return"])
assert p.isKeyword("def")
assert not p.isKeyword("other")