Add ParseError:err_type and ParseError::position.

This commit is contained in:
Stephen Chung
2022-07-29 09:42:30 +08:00
parent 6fab9f5b63
commit ea38185cac
19 changed files with 147 additions and 104 deletions

View File

@@ -233,7 +233,7 @@ fn test_var_def_filter() -> Result<(), Box<EvalAltResult>> {
);
assert!(matches!(
*engine.compile("let x = 42;").expect_err("should error").0,
engine.compile("let x = 42;").expect_err("should error").err_type(),
ParseErrorType::ForbiddenVariable(s) if s == "x"
));
assert!(matches!(