Separate op-assignment with other function calls.

This commit is contained in:
Stephen Chung
2021-02-25 10:59:22 +08:00
parent 49e5382ab0
commit 9495d3f733
4 changed files with 13 additions and 13 deletions

View File

@@ -1681,7 +1681,9 @@ impl Engine {
let pos = rhs.position();
if self
.call_native_fn(mods, state, lib, OP_EQUALS, hash_fn, args, false, pos)?
.call_native_fn(
mods, state, lib, OP_EQUALS, hash_fn, args, false, false, pos,
)?
.0
.as_bool()
.unwrap_or(false)
@@ -1961,7 +1963,7 @@ impl Engine {
let hash_fn =
calc_native_fn_hash(empty(), op, args.iter().map(|a| a.type_id())).unwrap();
match self.call_native_fn(mods, state, lib, op, hash_fn, args, true, op_pos) {
match self.call_native_fn(mods, state, lib, op, hash_fn, args, true, true, op_pos) {
Ok(_) => (),
Err(err) if matches!(err.as_ref(), EvalAltResult::ErrorFunctionNotFound(f, _) if f.starts_with(op)) =>
{
@@ -1971,8 +1973,8 @@ impl Engine {
calc_native_fn_hash(empty(), op, args.iter().map(|a| a.type_id())).unwrap();
// Run function
let (value, _) =
self.call_native_fn(mods, state, lib, op, hash_fn, args, true, op_pos)?;
let (value, _) = self
.call_native_fn(mods, state, lib, op, hash_fn, args, true, false, op_pos)?;
*args[0] = value.flatten();
}