Fix no_object builds.

This commit is contained in:
Stephen Chung
2020-09-20 14:52:38 +08:00
parent 1ae6af5289
commit c7a675e18a
4 changed files with 13 additions and 12 deletions

View File

@@ -12,17 +12,18 @@ use crate::scope::Scope;
use crate::token::{lex, Position};
#[cfg(not(feature = "no_index"))]
#[cfg(not(feature = "no_object"))]
use crate::engine::{FN_IDX_GET, FN_IDX_SET};
#[cfg(not(feature = "no_object"))]
use crate::{
engine::{make_getter, make_setter, Map},
error::ParseErrorType,
fn_register::{RegisterFn, RegisterResultFn},
token::Token,
};
#[cfg(any(not(feature = "no_index"), not(feature = "no_object")))]
use crate::fn_register::{RegisterFn, RegisterResultFn};
#[cfg(not(feature = "no_function"))]
use crate::{
engine::get_script_function_by_signature, fn_args::FuncArgs, fn_call::ensure_no_data_race,
@@ -375,7 +376,7 @@ impl Engine {
self.register_result_fn(&make_setter(name), callback)
}
/// Shorthand for registering both getter and setter functions
/// Short-hand for registering both getter and setter functions
/// of a registered type with the `Engine`.
///
/// All function signatures must start with `&mut self` and not `&self`.
@@ -427,7 +428,7 @@ impl Engine {
self.register_get(name, get_fn).register_set(name, set_fn)
}
/// Register an index getter for a registered type with the `Engine`.
/// Register an index getter for a custom type with the `Engine`.
///
/// The function signature must start with `&mut self` and not `&self`.
///
@@ -476,7 +477,7 @@ impl Engine {
self.register_fn(FN_IDX_GET, callback)
}
/// Register an index getter for a registered type with the `Engine`.
/// Register an index getter for a custom type with the `Engine`.
/// Returns `Result<Dynamic, Box<EvalAltResult>>`.
///
/// The function signature must start with `&mut self` and not `&self`.
@@ -527,7 +528,7 @@ impl Engine {
self.register_result_fn(FN_IDX_GET, callback)
}
/// Register an index setter for a registered type with the `Engine`.
/// Register an index setter for a custom type with the `Engine`.
///
/// # Example
///
@@ -575,7 +576,7 @@ impl Engine {
self.register_fn(FN_IDX_SET, callback)
}
/// Register an index setter for a registered type with the `Engine`.
/// Register an index setter for a custom type with the `Engine`.
/// Returns `Result<Dynamic, Box<EvalAltResult>>`.
///
/// # Example
@@ -627,7 +628,7 @@ impl Engine {
self.register_result_fn(FN_IDX_SET, callback)
}
/// Shorthand for register both index getter and setter functions for a registered type with the `Engine`.
/// Short-hand for register both index getter and setter functions for a custom type with the `Engine`.
///
/// # Example
///

View File

@@ -808,7 +808,7 @@ impl Module {
}
/// Set a pair of Rust index getter and setter functions, returning both hash keys.
/// This is a shorthand for `set_indexer_get_fn` and `set_indexer_set_fn`.
/// This is a short-hand for `set_indexer_get_fn` and `set_indexer_set_fn`.
///
/// If there are similar existing Rust functions, they are replaced.
///