From 50485b9ade676899146d58ecf89e0407b22564f4 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 30 Aug 2022 17:31:36 +0200 Subject: dont crash if grammar missing --- code/src/syntax_highlight/grammar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'code/src/syntax_highlight') diff --git a/code/src/syntax_highlight/grammar.rs b/code/src/syntax_highlight/grammar.rs index 9e6caae..ba703e7 100644 --- a/code/src/syntax_highlight/grammar.rs +++ b/code/src/syntax_highlight/grammar.rs @@ -34,6 +34,6 @@ pub fn grammar_for(syntax: &str) -> &'static [(&'static [&'static str], &'static (&["([a-z_][A-Za-z0-9_]*)\\s*\\("], "identifier"), (&["\".*?\"", "\\d", "true", "false"], "literal"), ], - _ => unreachable!(), + _ => &[], } } -- cgit v1.2.3-70-g09d2