Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix jq #1044

Merged
merged 2 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to eww will be listed here, starting at changes since versio
### Fixes
- The `shell-completions` subcommand is now run before anything is set up
- Fix nix flake
- Fix `jq` (By: w-lfchen)

## [0.5.0] (17.02.2024)

Expand Down
2 changes: 2 additions & 0 deletions crates/simplexpr/src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ fn prepare_jaq_filter(code: String) -> Result<Arc<jaq_interpret::Filter>, EvalEr
None => return Err(EvalError::JaqParseError(Box::new(JaqParseError(errors.pop())))),
};
let mut defs = jaq_interpret::ParseCtx::new(Vec::new());
defs.insert_natives(jaq_core::core());
defs.insert_defs(jaq_std::std());

let filter = defs.compile(filter);
Expand Down Expand Up @@ -544,5 +545,6 @@ mod tests {
lazy_evaluation_and(r#"false && "null".test"#) => Ok(DynVal::from(false)),
lazy_evaluation_or(r#"true || "null".test"#) => Ok(DynVal::from(true)),
lazy_evaluation_elvis(r#""test"?: "null".test"#) => Ok(DynVal::from("test")),
jq_basic_index(r#"jq("[7,8,9]", ".[0]")"#) => Ok(DynVal::from(7)),
}
}
Loading