add: handling when add: None is matched

This commit is contained in:
GreasySlug 2023-01-15 08:37:07 +09:00
parent 1e072835c3
commit 35db8c5565
2 changed files with 93 additions and 30 deletions

View file

@ -72,6 +72,13 @@ impl LexError {
);
Self::new(ErrorCore::new(
vec![SubMessage::only_loc(loc)],
pub fn invalid_none_match(errno: usize, loc: Location, fn_name: &str, line: u32) -> Self {
let mut err = Self::new(ErrorCore::bug(errno, loc, fn_name, line));
err.set_hint("None is got");
err
}
switch_lang!(
"japanese" => format!("これはErg compilerのバグです、開発者に報告して下さい ({URL})\n{fn_name}:{line}より発生"),
"simplified_chinese" => format!("这是Erg编译器的一个错误请报告给{URL}\n原因来自: {fn_name}:{line}"),