public static styleToken(text as String, kind as TokenKind) as StyledSpan
Maps a TokenKind and token slice to its corresponding StyledSpan.
| Parameter | Description |
|---|---|
text | Slice of source text for the token. |
kind | Lexical TokenKind classification. |
Styled span.
import klyn.code
import klyn.code.highlighters
span = CodeHighlighter.styleToken("Int", TokenKind.TYPE)