2022-04-16 16:36:53 +08:00
|
|
|
mod cache;
|
2022-01-07 11:43:47 +08:00
|
|
|
mod chaining;
|
|
|
|
mod data_check;
|
2022-01-24 17:04:40 +08:00
|
|
|
mod debugger;
|
2022-01-07 11:43:47 +08:00
|
|
|
mod eval_context;
|
|
|
|
mod expr;
|
|
|
|
mod global_state;
|
|
|
|
mod stmt;
|
|
|
|
mod target;
|
|
|
|
|
2022-04-16 16:36:53 +08:00
|
|
|
pub use cache::{Caches, FnResolutionCache, FnResolutionCacheEntry};
|
2022-01-07 11:43:47 +08:00
|
|
|
#[cfg(any(not(feature = "no_index"), not(feature = "no_object")))]
|
2022-06-08 09:19:21 +08:00
|
|
|
pub use chaining::ChainType;
|
2022-01-24 17:04:40 +08:00
|
|
|
#[cfg(feature = "debugging")]
|
2022-02-01 22:30:05 +08:00
|
|
|
pub use debugger::{
|
2022-02-02 15:07:22 +08:00
|
|
|
BreakPoint, CallStackFrame, Debugger, DebuggerCommand, DebuggerEvent, DebuggerStatus,
|
|
|
|
OnDebuggerCallback, OnDebuggingInit,
|
2022-02-01 22:30:05 +08:00
|
|
|
};
|
2022-01-07 11:43:47 +08:00
|
|
|
pub use eval_context::EvalContext;
|
2022-01-30 17:27:13 +08:00
|
|
|
#[cfg(not(feature = "no_module"))]
|
|
|
|
#[cfg(not(feature = "no_function"))]
|
|
|
|
pub use global_state::GlobalConstants;
|
2022-01-07 11:43:47 +08:00
|
|
|
pub use global_state::GlobalRuntimeState;
|
2022-01-13 18:13:27 +08:00
|
|
|
pub use target::{calc_index, calc_offset_len, Target};
|
2022-10-16 11:35:21 +08:00
|
|
|
|
|
|
|
#[cfg(feature = "unchecked")]
|
|
|
|
mod unchecked {
|
2022-11-19 18:57:15 +08:00
|
|
|
use crate::{eval::GlobalRuntimeState, Dynamic, Engine, Position, RhaiResultOf};
|
2022-11-19 18:41:51 +08:00
|
|
|
use std::borrow::Borrow;
|
|
|
|
#[cfg(feature = "no_std")]
|
|
|
|
use std::prelude::v1::*;
|
2022-10-16 11:35:21 +08:00
|
|
|
|
|
|
|
impl Engine {
|
|
|
|
/// Check if the number of operations stay within limit.
|
|
|
|
#[inline(always)]
|
|
|
|
pub(crate) const fn track_operation(
|
|
|
|
&self,
|
|
|
|
_: &GlobalRuntimeState,
|
|
|
|
_: Position,
|
|
|
|
) -> RhaiResultOf<()> {
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Check whether the size of a [`Dynamic`] is within limits.
|
|
|
|
#[inline(always)]
|
2022-11-19 18:41:51 +08:00
|
|
|
pub(crate) const fn check_data_size<T: Borrow<Dynamic>>(
|
2022-10-16 11:35:21 +08:00
|
|
|
&self,
|
2022-11-19 18:41:51 +08:00
|
|
|
value: T,
|
2022-10-16 11:35:21 +08:00
|
|
|
_: Position,
|
2022-11-19 18:41:51 +08:00
|
|
|
) -> RhaiResultOf<T> {
|
|
|
|
Ok(value)
|
2022-10-16 11:35:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|