Use Option<Token> instead of Token::NONE.

This commit is contained in:
Stephen Chung
2022-12-27 22:51:38 +08:00
parent bb1136e8ad
commit 00c434eb71
9 changed files with 77 additions and 83 deletions

View File

@@ -159,7 +159,7 @@ impl Engine {
let op_assign = op_assign_token.literal_syntax();
let op = op_token.literal_syntax();
let token = op_assign_token.clone();
let token = Some(op_assign_token.clone());
match self
.exec_native_fn_call(global, caches, op_assign, token, hash, args, true, *op_pos)
@@ -168,7 +168,7 @@ impl Engine {
Err(err) if matches!(*err, ERR::ErrorFunctionNotFound(ref f, ..) if f.starts_with(op_assign)) =>
{
// Expand to `var = var op rhs`
let token = op_token.clone();
let token = Some(op_token.clone());
*args[0] = self
.exec_native_fn_call(