Fix constant evaluation methods to return EvalResult

This commit is contained in:
Shunsuke Shibayama 2022-09-03 11:59:18 +09:00
parent e2bd64ebe5
commit e1eebb252f
7 changed files with 217 additions and 100 deletions

View file

@ -1019,6 +1019,24 @@ passed keyword args: {RED}{kw_args_len}{RESET}"
caused_by,
)
}
pub fn not_const_expr(errno: usize, loc: Location, caused_by: Str) -> Self {
Self::new(
ErrorCore::new(
errno,
NotConstExpr,
loc,
switch_lang!(
"japanese" => "定数式ではありません",
"simplified_chinese" => "不是常量表达式",
"traditional_chinese" => "不是常量表達式",
"english" => "not a constant expression",
),
None,
),
caused_by,
)
}
}
#[derive(Debug)]