Add new reserved symbols.

This commit is contained in:
Stephen Chung 2022-06-10 08:47:22 +08:00
parent 09e19790fe
commit 206318e14c
2 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,11 @@ Bug fixes
* _Strict Variables Mode_ now checks for module namespaces within functions as well.
* Module defined via `Engine::register_static_module` are now checked in _Strict Variables Mode_.
Reserved Symbols
----------------
* `?`, `?.` and `!.` are now reserved symbols.
Deprecated API's
----------------

View File

@ -1992,6 +1992,7 @@ fn get_next_token_inner(
return Some((Token::NotEqualsTo, start_pos));
}
('!', '.') => return Some((Token::Reserved("!.".into()), start_pos)),
('!', ..) => return Some((Token::Bang, start_pos)),
('|', '|') => {
@ -2032,6 +2033,9 @@ fn get_next_token_inner(
('$', ..) => return Some((Token::Reserved("$".into()), start_pos)),
('?', '.') => return Some((Token::Reserved("?.".into()), start_pos)),
('?', ..) => return Some((Token::Reserved("?".into()), start_pos)),
(ch, ..) if ch.is_whitespace() => (),
(ch, ..) => {