⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module syntax

Module syntax 

Source
Expand description

Syntax Highlighting Engine

Provides syntax highlighting for the text editor with support for Rust, C, and Shell languages. Uses a character-by-character state machine approach to tokenize lines into colored spans.

Structs§

CHighlighter
Syntax highlighter for C and C++ source code.
RustHighlighter
Syntax highlighter for the Rust programming language.
ShHighlighter
Syntax highlighter for shell (Bash) scripts.
SyntaxTheme
Color theme mapping each token type to a BGRA u32 color.
SyntaxToken
A single highlighted span within a line.

Enums§

Language
Supported source languages.
TokenType
Semantic token categories used by all highlighters.

Traits§

SyntaxHighlighter
Language-specific line tokenizer.

Functions§

create_highlighter
Create the appropriate highlighter for a language (returns None for languages without a highlighter implementation).
default_theme
Return a dark-theme color palette similar to VS Code Dark+.
detect_language
Detect the source language from a filename extension.
get_token_color
Map a TokenType to its display color within a theme.