New reserved keywords.

This commit is contained in:
Stephen Chung 2021-03-17 10:31:50 +08:00
parent 4581943435
commit 699131be58
2 changed files with 5 additions and 4 deletions

View File

@ -10,6 +10,7 @@ Breaking changes
* The traits `RegisterFn` and `RegisterResultFn` are removed. `Engine::register_fn` and `Engine::register_result_fn` are now implemented directly on `Engine`.
* `FnPtr::call_dynamic` now takes `&NativeCallContext` instead of consuming it.
* All `Module::set_fn_XXX` methods are removed, in favor of `Module::set_native_fn`.
* `protected`, `super` are now reserved keywords.
Enhancements
------------

View File

@ -576,10 +576,10 @@ impl Token {
"import" | "export" | "as" => Reserved(syntax.into()),
"===" | "!==" | "->" | "<-" | ":=" | "~" | "::<" | "(*" | "*)" | "#" | "public"
| "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()),
| "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()),
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 => {