Allow non-custom reserved symbols in custom syntax.

This commit is contained in:
Stephen Chung
2021-12-16 18:01:49 +08:00
parent f92cbe1f6d
commit fbc2b1f13d
8 changed files with 77 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
use rhai::{Engine, EvalAltResult, LexError, ParseErrorType, INT};
use rhai::{Engine, EvalAltResult, ParseErrorType, INT};
#[test]
fn test_tokens_disabled() {
@@ -26,7 +26,7 @@ fn test_tokens_disabled() {
assert!(matches!(
*engine.compile("let x = += 0;").expect_err("should error").0,
ParseErrorType::BadInput(LexError::UnexpectedInput(err)) if err == "+="
ParseErrorType::Reserved(err) if err == "+="
));
}