public enum TokenKind
Classifies lexical tokens produced by Klyn code tokenizers.
TokenKind provides a rendering-independent vocabulary shared by syntax highlighters (terminal ANSI, GUI canvas, HTML documentation), source-code navigation tools, refactoring services, and code metrics scanners.
import klyn.code kind = TokenKind.KEYWORD assert kind.isKeywordLike() assert not kind.isTrivia()
| Modifier and Type | Member | Description |
|---|---|---|
| public | isCommentisComment() as Boolean |
Returns true when this token represents a line, block, or documentation comment. |
| public | isIdentifierLikeisIdentifierLike() as Boolean |
Returns true when this token represents a symbolic identifier (variable, type, declaration name, function call, property name, or built-in symbol). |
| public | isKeywordLikeisKeywordLike() as Boolean |
Returns true when this token is a language keyword, contextual query keyword, built-in type, or language constant. |
| public | isLiteralisLiteral() as Boolean |
Returns true when this token belongs to a string, character, regex, numeric, or constant literal. |
| public | isStringOrCharisStringOrChar() as Boolean |
Returns true when this token belongs to a string, character, escape, interpolation delimiter, or regular expression literal. |
| public | isTriviaisTrivia() as Boolean |
Returns true when this token represents non-code trivia (whitespace or comments). |