Wrap file module functions in ErrorInModule.

This commit is contained in:
Stephen Chung
2020-09-25 20:24:03 +08:00
parent 39bbff878c
commit da9aa60256
3 changed files with 22 additions and 9 deletions

View File

@@ -182,9 +182,12 @@ impl fmt::Display for EvalAltResult {
Self::ErrorParsing(p, _) => write!(f, "Syntax error: {}", p)?,
Self::ErrorInFunctionCall(s, err, _) => {
write!(f, "Error in call to function '{}' : {}", s, err)?
write!(f, "Error in call to function '{}': {}", s, err)?
}
Self::ErrorInModule(s, err, _) => write!(f, "Error in module '{}' : {}", s, err)?,
Self::ErrorInModule(s, err, _) if s.is_empty() => {
write!(f, "Error in module: {}", err)?
}
Self::ErrorInModule(s, err, _) => write!(f, "Error in module '{}': {}", s, err)?,
Self::ErrorFunctionNotFound(s, _)
| Self::ErrorVariableNotFound(s, _)