This release brings many new features to jaq:
- Module & data import: You can now include and import modules like in jq with
include "path";orimport "path" as mod;, as well as import data (JSON) files withimport "path" as $data;. Each import/include directive can be followed by (optional) metadata, of which thesearchattribute is considered. - label...break expressions:
label $x | f | ., break $xreturns at most one output off. //=operator: thanks to @bb010g #142!- Nested definitions: You can now put definitions into any subterm, e.g.
1 + def a: 2; ais now valid. (l // r) |= fcan now be executed 2daf986.
Under the hood, the jaq compiler has been completely rewritten to allow for these changes.
Furthermore, the API has seen a complete overhaul, hopefully making it easier to use #188:
jaq-corenow handles parsing, compilation, and execution.jaq-stdnow includes all standard library filters, both implemented by definition and as native functions.jaq-jsonimplements JSON support for jaq.
As a result, jaq-core and jaq-std are completely agnostic towards their data format. This makes jaq a good choice also for processing non-JSON data.
In particular, feedback for the new API is solicited.
Full Changelog: v1.6.0...v2.0.0-alpha