klyn.code.highlighters.CodeHighlighter.styleToken
method
public static styleToken(text as String, kind as TokenKind) as StyledSpan
Description

Maps a TokenKind and token slice to its corresponding StyledSpan.

Parameters
ParameterDescription
textSlice of source text for the token.
kindLexical TokenKind classification.
Returns

Styled span.

Example
import klyn.code
import klyn.code.highlighters

span = CodeHighlighter.styleToken("Int", TokenKind.TYPE)