From the collection

vir-search

Rust · complete · v1.4.3

One search grammar serves three applications, and this is the library that parses it: Calibre-style search expressions in, a typed Abstract Syntax Tree (AST) out.

Extracted from atrium-search and conservatory-search, it carries the lexer, the generic recursive-descent parser, the ranking heuristics, and the date-range resolvers used by Atrium, Conservatory, and Viaduct.

The AST is parameterized over each consumer’s Field, State, and SortKey types, so the grammar stays shared while every application compiles it against its own domain.

← Return to the codex