From c73ed9310d8162b71183688de62bf8c1fc8420df Mon Sep 17 00:00:00 2001 From: Jonas Maier Date: Mon, 1 Jun 2026 21:55:53 +0200 Subject: syntax highlighting for regex; syntax highlighting syntax errors --- src/syntax_highlighting.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/syntax_highlighting.rs') diff --git a/src/syntax_highlighting.rs b/src/syntax_highlighting.rs index f58d4a0..e21ed17 100644 --- a/src/syntax_highlighting.rs +++ b/src/syntax_highlighting.rs @@ -25,11 +25,14 @@ impl Highlighter { }; let mut sc = |a: &str, b: &str| this.set_color(a.as_bytes(), b.as_bytes()).unwrap(); use ansi::colors::*; - sc("keywords", GREEN_FG); + sc("keywords", BLUE_FG); sc("braces", CYAN_FG); sc("string", MAGENTA_FG); sc("var", CYAN_FG); sc("escape", RED_FG); + sc("regex", GREEN_FG); + sc("regexsym", YELLOW_FG); + sc("syntax_error", RED_BG); this } @@ -161,3 +164,8 @@ impl Default for Highlighter { Self::new() } } + +#[test] +fn highlighter_does_not_use_nonexisting_keyword_names() { + Highlighter::new(); +} -- cgit v1.2.3