KlynHighlighter
classin packageklyn.gui.terminal.syntax
public class KlynHighlighter extends Object implements SyntaxHighlighter:
└ KlynHighlighter
All Implemented Interfaces: SyntaxHighlighter

Syntax highlighter for the complete Klyn lexical surface.

The scanner mirrors the language tokenizer for comments, string prefixes, triple strings, Char and CodeUnit literals, regular expressions, numeric suffixes, annotations and word operators. Query keywords are contextual and are enabled by the owning editor only while rendering a KQL block.

Example
highlighter = KlynHighlighter()
spans = highlighter.highlight("unit as CodeUnit = `K`")
Fields
Modifier and Type Member Description
public queryMode
queryMode as Boolean = false
Enables contextual KQL keywords for the current line.
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public KlynHighlighter Creates a highlighter initialized with the syntax supported by Klyn.
Methods
Modifier and Type Member Description
public highlight
highlight(line as String) as List<StyledSpan>:
Highlights one Klyn source line without changing its text.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toString, toXml
methodInherited Methods from SyntaxHighlighter: highlight