aboutsummaryrefslogtreecommitdiff
path: root/code/src/syntax_highlight/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-08-30 18:54:52 +0200
committermetamuffin <metamuffin@disroot.org>2022-08-30 18:54:52 +0200
commit4b1f352dbaf50ff60c434a5888048768820a3ff2 (patch)
tree540a5a3e7575a5002d9c05120cf55922a4ac5044 /code/src/syntax_highlight/mod.rs
parent7f84570e65be168a8e0a6e7029f52ca692885cd8 (diff)
downloadmetamuffin-blog-4b1f352dbaf50ff60c434a5888048768820a3ff2.tar
metamuffin-blog-4b1f352dbaf50ff60c434a5888048768820a3ff2.tar.bz2
metamuffin-blog-4b1f352dbaf50ff60c434a5888048768820a3ff2.tar.zst
tree grammar + flip tuple
Diffstat (limited to 'code/src/syntax_highlight/mod.rs')
-rw-r--r--code/src/syntax_highlight/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/code/src/syntax_highlight/mod.rs b/code/src/syntax_highlight/mod.rs
index 515de28..46bf2a0 100644
--- a/code/src/syntax_highlight/mod.rs
+++ b/code/src/syntax_highlight/mod.rs
@@ -7,7 +7,7 @@ use synoptic::{Highlighter, Token};
pub fn syntax_highlight(lang: &str, source: &str) -> String {
let mut h = Highlighter::new();
- for (regex, kind) in grammar_for(lang) {
+ for (kind, regex) in grammar_for(lang) {
h.join(regex, kind).unwrap();
}
let highlighting = h.run(source);