Expand description
yqr — a jq-style query/transform tool for YAML.
This crate is split into small, independently testable layers:
lexerturns a filter string into tokens,parserturns tokens into anast::Ast,evalapplies anAstto aValue, producing a stream of output values,fidelityprovides byte-preserving execution over noyalib’s lossless CST (untouched nodes are emitted as their original source bytes),validatechecks inputs for YAML correctness and renders compiler-style diagnostics.
The two convenience entry points most callers want are eval_str (parse a
filter and run it over a YAML string, returning values) and
render (turn output values back into a YAML/raw string). For
byte-preserving output, see fidelity::run.
Re-exports§
Modules§
- ast
- Abstract syntax tree for the
yqrfilter language. - edit
- The typed edit API: compose edits as data, apply them through the fidelity write tier.
- error
- Error type and exit-code mapping for
yqr. - eval
- The evaluation engine: applies an
Astto aValue, producing a stream (Vec<Value>) of results, mirroring jq’s model where any filter can yield zero or more outputs. - fidelity
- The fidelity engine seam: byte-preserving reads over YAML sources.
- lexer
- Tokenizer for the
yqrfilter language. - parser
- Recursive-descent parser:
Tokens →Program. - validate
- YAML correctness checking with compiler-style diagnostics.
- value
- yqr’s native value model — decoupled from any YAML backend library.
Functions§
- eval_
ast_ str - Like
eval_str, but over an already-compiledast::Ast, so a caller that has already parsed the filter does not lex and parse it again. - eval_
str - Parse
filter, load the first YAML document frominput, and evaluate the filter against it, returning the output stream. - render
- Render a stream of output values to a string.