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

@@ -30,7 +30,7 @@ fn test_loop() -> Result<(), Box<EvalAltResult>> {
*engine
.compile("let x = 0; break;")
.expect_err("should error")
.0,
.err_type(),
ParseErrorType::LoopBreak
);
@@ -38,7 +38,7 @@ fn test_loop() -> Result<(), Box<EvalAltResult>> {
*engine
.compile("let x = 0; if x > 0 { continue; }")
.expect_err("should error")
.0,
.err_type(),
ParseErrorType::LoopBreak
);