diff options
author | metamuffin <metamuffin@disroot.org> | 2022-08-30 16:54:57 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-08-30 16:54:57 +0200 |
commit | 802efbca25cb92d8567761361b6513fd57e05578 (patch) | |
tree | 62eb0139143cc343d83d92091eee8efaf0888001 /code/src/syntax_highlight/grammar.rs | |
parent | ed6186a764701e702032156c9632ac19305652be (diff) | |
download | metamuffin-blog-802efbca25cb92d8567761361b6513fd57e05578.tar metamuffin-blog-802efbca25cb92d8567761361b6513fd57e05578.tar.bz2 metamuffin-blog-802efbca25cb92d8567761361b6513fd57e05578.tar.zst |
basic syntax highlighting
Diffstat (limited to 'code/src/syntax_highlight/grammar.rs')
-rw-r--r-- | code/src/syntax_highlight/grammar.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/code/src/syntax_highlight/grammar.rs b/code/src/syntax_highlight/grammar.rs new file mode 100644 index 0000000..95417ab --- /dev/null +++ b/code/src/syntax_highlight/grammar.rs @@ -0,0 +1,6 @@ +pub fn grammar_for(syntax: &str) -> &'static [(&'static [&'static str], &'static str)] { + match syntax { + "rs" => &[(&["fn", "pub", "async"], "keyword")], + _ => unreachable!(), + } +} |