Add missing reserved tokens.
This commit is contained in:
parent
8c20801574
commit
689ed48235
@ -14,6 +14,7 @@ Bug fixes
|
|||||||
* Capturing an unknown variable in a closure no longer panics.
|
* Capturing an unknown variable in a closure no longer panics.
|
||||||
* Fixes panic in interpolated strings with constant expressions.
|
* Fixes panic in interpolated strings with constant expressions.
|
||||||
* Using `call_fn_raw` on a function without evaluating the AST no longer panics on namespace-qualified function calls due to `import` statements not run.
|
* Using `call_fn_raw` on a function without evaluating the AST no longer panics on namespace-qualified function calls due to `import` statements not run.
|
||||||
|
* Some reserved tokens (such as "?", "++") cannot be used in custom syntax; this is now fixed.
|
||||||
|
|
||||||
Breaking changes
|
Breaking changes
|
||||||
----------------
|
----------------
|
||||||
|
@ -873,6 +873,11 @@ impl Token {
|
|||||||
"**" => PowerOf,
|
"**" => PowerOf,
|
||||||
"**=" => PowerOfAssign,
|
"**=" => PowerOfAssign,
|
||||||
|
|
||||||
|
#[cfg(feature = "no_object")]
|
||||||
|
"?." => Reserved(syntax.into()),
|
||||||
|
#[cfg(feature = "no_index")]
|
||||||
|
"?[" => Reserved(syntax.into()),
|
||||||
|
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
"fn" => Fn,
|
"fn" => Fn,
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
@ -892,9 +897,8 @@ impl Token {
|
|||||||
"import" | "export" | "as" => Reserved(syntax.into()),
|
"import" | "export" | "as" => Reserved(syntax.into()),
|
||||||
|
|
||||||
// List of reserved operators
|
// List of reserved operators
|
||||||
"===" | "!==" | "->" | "<-" | ":=" | "~" | "::<" | "(*" | "*)" | "#" | "#!" => {
|
"===" | "!==" | "->" | "<-" | "?" | ":=" | ":;" | "~" | "!." | "::<" | "(*" | "*)"
|
||||||
Reserved(syntax.into())
|
| "#" | "#!" | "@" | "$" | "++" | "--" | "..." | "<|" | "|>" => Reserved(syntax.into()),
|
||||||
}
|
|
||||||
|
|
||||||
// List of reserved keywords
|
// List of reserved keywords
|
||||||
"public" | "protected" | "super" | "new" | "use" | "module" | "package" | "var"
|
"public" | "protected" | "super" | "new" | "use" | "module" | "package" | "var"
|
||||||
|
Loading…
Reference in New Issue
Block a user