diff --git a/Cargo.lock b/Cargo.lock index 417953f6..48178ff9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,6 +207,7 @@ version = "2.0.0" dependencies = [ "dyn-clone", "jaq-json", + "jaq-std", "once_cell", "serde_json", "typed-arena", diff --git a/jaq-core/Cargo.toml b/jaq-core/Cargo.toml index 48cb8c33..7dec2df6 100644 --- a/jaq-core/Cargo.toml +++ b/jaq-core/Cargo.toml @@ -21,5 +21,6 @@ once_cell = "1.16.0" typed-arena = "2.0.2" [dev-dependencies] +jaq-std = { path = "../jaq-std" } jaq-json = { path = "../jaq-json", features = ["serde_json"] } serde_json = "1.0" diff --git a/jaq-core/src/lib.rs b/jaq-core/src/lib.rs index 8514b3fc..e93968de 100644 --- a/jaq-core/src/lib.rs +++ b/jaq-core/src/lib.rs @@ -10,7 +10,7 @@ //! * handle errors etc. //! //! ~~~ -//! use jaq_core::{load, Compiler, Ctx, Error, FilterT, Native, RcIter}; +//! use jaq_core::{load, Compiler, Ctx, Error, FilterT, RcIter}; //! use jaq_json::Val; //! use serde_json::{json, Value}; //! @@ -19,17 +19,15 @@ //! //! use load::{Arena, File, Loader}; //! -//! // start out only from core filters, -//! // which do not include filters in the standard library -//! // such as `map`, `select` etc. -//! let loader = Loader::new([]); +//! let loader = Loader::new(jaq_std::defs().chain(jaq_json::defs())); //! let arena = Arena::default(); //! //! // parse the filter //! let modules = loader.load(&arena, program).unwrap(); //! //! // compile the filter -//! let filter = jaq_core::Compiler::<_, Native<_>>::default() +//! let filter = jaq_core::Compiler::default() +//! .with_funs(jaq_std::funs().chain(jaq_json::funs())) //! .compile(modules) //! .unwrap(); //!