Do not box ModuleRef.
This commit is contained in:
parent
42eac410b7
commit
abbee80e5d
@ -866,7 +866,7 @@ pub struct FnCallInfo {
|
||||
/// and the function names are predictable, so no need to allocate a new `String`.
|
||||
pub name: Cow<'static, str>,
|
||||
/// Namespace of the function, if any.
|
||||
pub namespace: Option<Box<ModuleRef>>,
|
||||
pub namespace: Option<ModuleRef>,
|
||||
/// Call native functions only? Set to `true` to skip searching for script-defined function overrides
|
||||
/// when it is certain that the function must be native (e.g. an operator).
|
||||
pub native_only: bool,
|
||||
@ -904,7 +904,7 @@ pub enum Expr {
|
||||
/// FnPtr constant.
|
||||
FnPointer(Box<IdentX>),
|
||||
/// Variable access - ((variable name, position), optional modules, hash, optional index)
|
||||
Variable(Box<(Ident, Option<Box<ModuleRef>>, u64, Option<NonZeroUsize>)>),
|
||||
Variable(Box<(Ident, Option<ModuleRef>, u64, Option<NonZeroUsize>)>),
|
||||
/// Property access.
|
||||
Property(Box<(IdentX, (String, String))>),
|
||||
/// { stmt }
|
||||
|
@ -589,7 +589,7 @@ fn default_print(_s: &str) {
|
||||
pub fn search_imports<'s>(
|
||||
mods: &'s Imports,
|
||||
state: &mut State,
|
||||
modules: &Box<ModuleRef>,
|
||||
modules: &ModuleRef,
|
||||
) -> Result<&'s Module, Box<EvalAltResult>> {
|
||||
let (root, root_pos) = &modules[0];
|
||||
|
||||
@ -617,7 +617,7 @@ pub fn search_imports<'s>(
|
||||
pub fn search_imports_mut<'s>(
|
||||
mods: &'s mut Imports,
|
||||
state: &mut State,
|
||||
modules: &Box<ModuleRef>,
|
||||
modules: &ModuleRef,
|
||||
) -> Result<&'s mut Module, Box<EvalAltResult>> {
|
||||
let (root, root_pos) = &modules[0];
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ impl Engine {
|
||||
state: &mut State,
|
||||
lib: &[&Module],
|
||||
this_ptr: &mut Option<&mut Dynamic>,
|
||||
modules: &Option<Box<ModuleRef>>,
|
||||
modules: &Option<ModuleRef>,
|
||||
name: &str,
|
||||
args_expr: impl AsRef<[Expr]>,
|
||||
def_val: Option<bool>,
|
||||
|
@ -265,7 +265,7 @@ fn parse_fn_call(
|
||||
lib: &mut FunctionsLib,
|
||||
id: String,
|
||||
capture: bool,
|
||||
mut namespace: Option<Box<ModuleRef>>,
|
||||
mut namespace: Option<ModuleRef>,
|
||||
settings: ParseSettings,
|
||||
) -> Result<Expr, ParseError> {
|
||||
let (token, token_pos) = input.peek().unwrap();
|
||||
@ -898,7 +898,7 @@ fn parse_primary(
|
||||
} else {
|
||||
let mut m: ModuleRef = Default::default();
|
||||
m.push((name, pos));
|
||||
modules = Some(Box::new(m));
|
||||
modules = Some(m);
|
||||
}
|
||||
|
||||
Expr::Variable(Box::new((Ident::new(id2, pos2), modules, 0, index)))
|
||||
|
Loading…
Reference in New Issue
Block a user