Skip to content

Commit

Permalink
Show how to include standard library.
Browse files Browse the repository at this point in the history
  • Loading branch information
01mf02 committed Dec 23, 2024
1 parent 398922f commit 8eb49d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions jaq-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 4 additions & 6 deletions jaq-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
//!
Expand All @@ -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();
//!
Expand Down

0 comments on commit 8eb49d8

Please sign in to comment.