From 44a48f1affcb0a1ce6355498d81eb65e268a6f74 Mon Sep 17 00:00:00 2001 From: ltabis Date: Mon, 26 Sep 2022 13:36:16 +0200 Subject: [PATCH 1/4] feat: add `base_std` feature to enable dynamic libraries. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 1034f923..ff411847 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,7 @@ serde_json = { version = "1.0", default-features = false, features = ["alloc"] } [features] default = ["std"] std = ["ahash/std", "ahash/runtime-rng", "num-traits/std", "smartstring/std"] +base_std = ["ahash/std", "num-traits/std", "smartstring/std"] # Prevent ahash random seed, enabling dynamic libraries to be used. unchecked = [] # unchecked arithmetic sync = [] # restrict to only types that implement Send + Sync no_position = [] # do not track position in the parser From ae860ab4fbdf555aec1a372e4b79bcacc93e2b1f Mon Sep 17 00:00:00 2001 From: ltabis Date: Thu, 10 Nov 2022 21:08:53 +0100 Subject: [PATCH 2/4] chore: change visibility to pub for `native` module. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index bb26d72b..8a83e879 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -95,6 +95,9 @@ mod tests; mod tokenizer; mod types; +/// Export to create module resolvers. +pub use func::native; + /// Error encountered when parsing a script. type PERR = ParseErrorType; /// Evaluation result. From 0790e5bc96c1868aa9e8a72b319496df47456b85 Mon Sep 17 00:00:00 2001 From: ltabis Date: Fri, 11 Nov 2022 12:10:19 +0100 Subject: [PATCH 3/4] chore: gate func::native export under the `internals` flag. --- src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4991287d..9fe84989 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -96,9 +96,6 @@ mod tests; mod tokenizer; mod types; -/// Export to create module resolvers. -pub use func::native; - /// Error encountered when parsing a script. type PERR = ParseErrorType; /// Evaluation result. @@ -204,6 +201,8 @@ pub use api::{eval::eval, events::VarDefInfo, run::run}; pub use ast::{FnAccess, AST}; pub use engine::{Engine, OP_CONTAINS, OP_EQUALS}; pub use eval::EvalContext; +#[cfg(feature = "internals")] +pub use func::native; pub use func::{NativeCallContext, RegisterNativeFunction}; pub use module::{FnNamespace, Module}; pub use tokenizer::Position; From c41db6dde51ddbd2c690424cf777901e002125a0 Mon Sep 17 00:00:00 2001 From: ltabis Date: Mon, 14 Nov 2022 15:17:37 +0100 Subject: [PATCH 4/4] chore: only export locked_read & locked_write. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 14223a95..c81ac01e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -202,7 +202,7 @@ pub use ast::{FnAccess, AST}; pub use engine::{Engine, OP_CONTAINS, OP_EQUALS}; pub use eval::EvalContext; #[cfg(feature = "internals")] -pub use func::native; +pub use func::native::{locked_read, locked_write}; pub use func::{NativeCallContext, RegisterNativeFunction}; pub use module::{FnNamespace, Module}; pub use tokenizer::Position;