mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 04:24:43 +00:00
Fix constant evaluation methods to return EvalResult
This commit is contained in:
parent
e2bd64ebe5
commit
e1eebb252f
7 changed files with 217 additions and 100 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue