Fix no_function build.
This commit is contained in:
parent
d2cd70bf53
commit
d80555e204
@ -4,8 +4,8 @@ use super::{get_builtin_binary_op_fn, get_builtin_op_assignment_fn, CallableFunc
|
|||||||
use crate::api::default_limits::MAX_DYNAMIC_PARAMETERS;
|
use crate::api::default_limits::MAX_DYNAMIC_PARAMETERS;
|
||||||
use crate::ast::{Expr, FnCallExpr, FnCallHashes};
|
use crate::ast::{Expr, FnCallExpr, FnCallHashes};
|
||||||
use crate::engine::{
|
use crate::engine::{
|
||||||
FN_ANONYMOUS, KEYWORD_DEBUG, KEYWORD_EVAL, KEYWORD_FN_PTR, KEYWORD_FN_PTR_CALL,
|
KEYWORD_DEBUG, KEYWORD_EVAL, KEYWORD_FN_PTR, KEYWORD_FN_PTR_CALL, KEYWORD_FN_PTR_CURRY,
|
||||||
KEYWORD_FN_PTR_CURRY, KEYWORD_IS_DEF_VAR, KEYWORD_PRINT, KEYWORD_TYPE_OF,
|
KEYWORD_IS_DEF_VAR, KEYWORD_PRINT, KEYWORD_TYPE_OF,
|
||||||
};
|
};
|
||||||
use crate::eval::{Caches, FnResolutionCacheEntry, GlobalRuntimeState};
|
use crate::eval::{Caches, FnResolutionCacheEntry, GlobalRuntimeState};
|
||||||
use crate::tokenizer::{is_valid_function_name, Token};
|
use crate::tokenizer::{is_valid_function_name, Token};
|
||||||
@ -132,7 +132,7 @@ pub fn ensure_no_data_race(fn_name: &str, args: &FnCallArgs, is_ref_mut: bool) -
|
|||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn is_anonymous_fn(name: &str) -> bool {
|
pub fn is_anonymous_fn(name: &str) -> bool {
|
||||||
name.starts_with(FN_ANONYMOUS)
|
name.starts_with(crate::engine::FN_ANONYMOUS)
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Engine {
|
impl Engine {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
use super::call::FnCallArgs;
|
use super::call::FnCallArgs;
|
||||||
use crate::ast::FnCallHashes;
|
use crate::ast::FnCallHashes;
|
||||||
use crate::eval::{Caches, GlobalRuntimeState};
|
use crate::eval::{Caches, GlobalRuntimeState};
|
||||||
use crate::parser::is_anonymous_fn;
|
|
||||||
use crate::plugin::PluginFunction;
|
use crate::plugin::PluginFunction;
|
||||||
use crate::tokenizer::{is_valid_function_name, Token, TokenizeState};
|
use crate::tokenizer::{is_valid_function_name, Token, TokenizeState};
|
||||||
use crate::types::dynamic::Variant;
|
use crate::types::dynamic::Variant;
|
||||||
@ -331,7 +330,7 @@ impl<'a> NativeCallContext<'a> {
|
|||||||
args: &mut [&mut Dynamic],
|
args: &mut [&mut Dynamic],
|
||||||
) -> RhaiResult {
|
) -> RhaiResult {
|
||||||
let name = fn_name.as_ref();
|
let name = fn_name.as_ref();
|
||||||
let native_only = !is_valid_function_name(name) && !is_anonymous_fn(name);
|
let native_only = !is_valid_function_name(name) && !crate::parser::is_anonymous_fn(name);
|
||||||
|
|
||||||
self._call_fn_raw(fn_name, native_only, is_ref_mut, is_method_call, args)
|
self._call_fn_raw(fn_name, native_only, is_ref_mut, is_method_call, args)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user