diff options
| author | Jonas Maier <jonas@x77.dev> | 2026-06-01 21:55:53 +0200 |
|---|---|---|
| committer | Jonas Maier <jonas@x77.dev> | 2026-06-01 21:55:53 +0200 |
| commit | c73ed9310d8162b71183688de62bf8c1fc8420df (patch) | |
| tree | c49063954f665a072cb8e63b10c4e95e31769826 /src/syntax_highlighting.rs | |
| parent | c52169f535f89c0300ec06e13ddcaa7e0f459a0b (diff) | |
| download | pish-c73ed9310d8162b71183688de62bf8c1fc8420df.tar.gz | |
syntax highlighting for regex; syntax highlighting syntax errors
Diffstat (limited to 'src/syntax_highlighting.rs')
| -rw-r--r-- | src/syntax_highlighting.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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(); +} |
