TokenizedHighlighter

A QSyntaxHighlighter that shows the tokens of a libsyntax language.

Declared in src/libs/libwidgets/widgets/TokenizedHighlighter.hpp.

Detailed description

The widget renderer of log-color §LGC-D-10. highlightBlock() runs the language's tokenizer over the block, with the state of the block before, and sets the format of each token from its role and emphasis. The colors are the syntax colors of the current SemanticPalette, read once when the highlighter is made, as the highlighters that it replaces read them.

A highlighter of the tree keeps its class name and becomes a TokenizedHighlighter of its language, so its users do not change. The terminal renderer in liblog shows the same tokens with SGR codes.

See also syntax::tokenizerOf().

Member function documentation

formatFor

[static] QTextCharFormat TokenizedHighlighter::formatFor(const SyntaxColors &colors, syntax::Role role, quint8 emphasis)

The format that a token of role with emphasis gets from colors.

language

syntax::Language TokenizedHighlighter::language() const

The language that this highlighter shows.

In this section