Merge pull request #424 from schungx/master

Unreserve begin, end, then, each, unless
This commit is contained in:
Stephen Chung 2021-07-06 10:17:24 +08:00 committed by GitHub
commit a7dc824dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -20,6 +20,7 @@ Breaking changes
* All deprecated API's (e.g. the `RegisterFn` and `RegisterResultFn` traits) are removed. * 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. * `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 Enhancements
------------ ------------

View File

@ -1421,8 +1421,11 @@ pub struct BinaryExpr {
/// This type is volatile and may change. /// This type is volatile and may change.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct OpAssignment<'a> { pub struct OpAssignment<'a> {
/// Hash of the op-assignment call.
pub hash_op_assign: u64, pub hash_op_assign: u64,
/// Hash of the underlying operator call.
pub hash_op: u64, pub hash_op: u64,
/// Op-assignment operator.
pub op: &'a str, pub op: &'a str,
} }

View File

@ -752,11 +752,9 @@ impl Token {
"===" | "!==" | "->" | "<-" | ":=" | "~" | "::<" | "(*" | "*)" | "#" | "#!" "===" | "!==" | "->" | "<-" | ":=" | "~" | "::<" | "(*" | "*)" | "#" | "#!"
| "public" | "protected" | "super" | "new" | "use" | "module" | "package" | "var" | "public" | "protected" | "super" | "new" | "use" | "module" | "package" | "var"
| "static" | "begin" | "end" | "shared" | "with" | "each" | "then" | "goto" | "static" | "shared" | "with" | "goto" | "exit" | "match" | "case" | "default"
| "unless" | "exit" | "match" | "case" | "default" | "void" | "null" | "nil" | "void" | "null" | "nil" | "spawn" | "thread" | "go" | "sync" | "async" | "await"
| "spawn" | "thread" | "go" | "sync" | "async" | "await" | "yield" => { | "yield" => Reserved(syntax.into()),
Reserved(syntax.into())
}
KEYWORD_PRINT | KEYWORD_DEBUG | KEYWORD_TYPE_OF | KEYWORD_EVAL | KEYWORD_FN_PTR 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 => { | 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, ("::<", false) => Token::LexError(LERR::ImproperSymbol(s,
"'::<>' is not a valid symbol. This is not Rust! Should it be '::'?".to_string(), "'::<>' 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(), "'(* .. *)' is not a valid comment format. This is not Pascal! Should it be '/* .. */'?".to_string(),
)), )),
("#", false) => Token::LexError(LERR::ImproperSymbol(s, ("#", false) => Token::LexError(LERR::ImproperSymbol(s,