Merge pull request #232 from erg-lang/split-err-msg

Split error messages
This commit is contained in:
Shunsuke Shibayama 2022-11-23 15:55:19 +09:00 committed by GitHub
commit 2caa6b6ec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1652 additions and 1006 deletions

View file

@ -241,7 +241,8 @@ impl Context {
match subr {
ConstSubr::User(_user) => todo!(),
ConstSubr::Builtin(builtin) => builtin.call(args, self).map_err(|mut e| {
e.0.loc = loc;
// TODO: Is it possible to get 0?
e.0.sub_messages.get_mut(0).unwrap().loc = loc;
EvalErrors::from(EvalError::new(
*e.0,
self.cfg.input.clone(),