diff --git a/CHANGELOG.md b/CHANGELOG.md index 9457c558..bbdbf134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Breaking changes * All deprecated API's (e.g. the `RegisterFn` and `RegisterResultFn` traits) are removed. * `Module::set_id` is split into `Module::set_id` and `Module::clear_id` pair. +* `begin`, `end`, `each`, `then`, `unless` are no longer reserved keywords. Enhancements ------------ diff --git a/src/ast.rs b/src/ast.rs index 3bd1d9b9..eb992f6a 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -1421,8 +1421,11 @@ pub struct BinaryExpr { /// This type is volatile and may change. #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] pub struct OpAssignment<'a> { + /// Hash of the op-assignment call. pub hash_op_assign: u64, + /// Hash of the underlying operator call. pub hash_op: u64, + /// Op-assignment operator. pub op: &'a str, } diff --git a/src/token.rs b/src/token.rs index 0e8878fb..86ad18fc 100644 --- a/src/token.rs +++ b/src/token.rs @@ -752,11 +752,9 @@ impl Token { "===" | "!==" | "->" | "<-" | ":=" | "~" | "::<" | "(*" | "*)" | "#" | "#!" | "public" | "protected" | "super" | "new" | "use" | "module" | "package" | "var" - | "static" | "begin" | "end" | "shared" | "with" | "each" | "then" | "goto" - | "unless" | "exit" | "match" | "case" | "default" | "void" | "null" | "nil" - | "spawn" | "thread" | "go" | "sync" | "async" | "await" | "yield" => { - Reserved(syntax.into()) - } + | "static" | "shared" | "with" | "goto" | "exit" | "match" | "case" | "default" + | "void" | "null" | "nil" | "spawn" | "thread" | "go" | "sync" | "async" | "await" + | "yield" => Reserved(syntax.into()), KEYWORD_PRINT | KEYWORD_DEBUG | KEYWORD_TYPE_OF | KEYWORD_EVAL | KEYWORD_FN_PTR | KEYWORD_FN_PTR_CALL | KEYWORD_FN_PTR_CURRY | KEYWORD_THIS | KEYWORD_IS_DEF_VAR => { @@ -2173,7 +2171,7 @@ impl<'a> Iterator for TokenIterator<'a> { ("::<", false) => Token::LexError(LERR::ImproperSymbol(s, "'::<>' is not a valid symbol. This is not Rust! Should it be '::'?".to_string(), )), - ("(*", false) | ("*)", false) | ("begin", false) | ("end", false) => Token::LexError(LERR::ImproperSymbol(s, + ("(*", false) | ("*)", false) => Token::LexError(LERR::ImproperSymbol(s, "'(* .. *)' is not a valid comment format. This is not Pascal! Should it be '/* .. */'?".to_string(), )), ("#", false) => Token::LexError(LERR::ImproperSymbol(s,