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`. * 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. * `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`. * All `Module::set_fn_XXX` methods are removed, in favor of `Module::set_native_fn`.
* `protected`, `super` are now reserved keywords.
Enhancements Enhancements
------------ ------------

View File

@ -576,10 +576,10 @@ impl Token {
"import" | "export" | "as" => Reserved(syntax.into()), "import" | "export" | "as" => Reserved(syntax.into()),
"===" | "!==" | "->" | "<-" | ":=" | "~" | "::<" | "(*" | "*)" | "#" | "public" "===" | "!==" | "->" | "<-" | ":=" | "~" | "::<" | "(*" | "*)" | "#" | "public"
| "new" | "use" | "module" | "package" | "var" | "static" | "begin" | "end" | "protected" | "super" | "new" | "use" | "module" | "package" | "var" | "static"
| "shared" | "with" | "each" | "then" | "goto" | "unless" | "exit" | "match" | "begin" | "end" | "shared" | "with" | "each" | "then" | "goto" | "unless"
| "case" | "default" | "void" | "null" | "nil" | "spawn" | "thread" | "go" | "sync" | "exit" | "match" | "case" | "default" | "void" | "null" | "nil" | "spawn"
| "async" | "await" | "yield" => Reserved(syntax.into()), | "thread" | "go" | "sync" | "async" | "await" | "yield" => 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 => {