Use bitflag options for chains parsing.

This commit is contained in:
Stephen Chung
2023-01-30 12:31:33 +08:00
parent 9f966f6473
commit 6400b33b1b
2 changed files with 48 additions and 57 deletions

View File

@@ -11,7 +11,7 @@ use crate::eval::{Caches, FnResolutionCacheEntry, GlobalRuntimeState};
use crate::tokenizer::{is_valid_function_name, Token};
use crate::{
calc_fn_hash, calc_fn_hash_full, Dynamic, Engine, FnArgsVec, FnPtr, ImmutableString,
OptimizationLevel, Position, RhaiError, RhaiResult, RhaiResultOf, Scope, Shared, ERR,
OptimizationLevel, Position, RhaiResult, RhaiResultOf, Scope, Shared, ERR,
};
#[cfg(feature = "no_std")]
use hashbrown::hash_map::Entry;
@@ -1053,7 +1053,7 @@ impl Engine {
let mut arg_values = curry
.into_iter()
.map(Ok)
.chain(a_expr.iter().map(|expr| -> Result<_, RhaiError> {
.chain(a_expr.iter().map(|expr| -> Result<_, crate::RhaiError> {
let this_ptr = this_ptr.as_deref_mut();
self.get_arg_value(global, caches, scope, this_ptr, expr)
.map(|(v, ..)| v)