Refine position display in error messages.

This commit is contained in:
Stephen Chung
2020-06-12 18:04:16 +08:00
parent 6cc27eb9f4
commit 9d91349513
12 changed files with 256 additions and 238 deletions

View File

@@ -871,9 +871,7 @@ impl Engine {
// If new functions are defined within the eval string, it is an error
if ast.lib().num_fn() != 0 {
return Err(Box::new(EvalAltResult::ErrorParsing(
ParseErrorType::WrongFnDefinition.into_err(Position::none()),
)));
return Err(ParseErrorType::WrongFnDefinition.into());
}
let statements = mem::take(ast.statements_mut());