1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! QQL language frontend: lexer, parser, typed AST, explain, and formatting.
//!
//! `qql-core` is the single owner of the QQL language surface. It performs no
//! I/O: no networking, no file access, and no knowledge of Qdrant REST JSON or
//! gRPC protobuf shapes. Lowering to transports lives in `qql-plan`
//! (transport-neutral plans plus an optional REST projection) and the executor
//! crate `qql` (REST / gRPC / edge execution).
//!
//! With default features the crate builds without third-party dependencies;
//! `serde` and `json` are opt-in for AST serialization and dynamic-value
//! conversion. Parser-only consumers — formatters, linters, language servers,
//! code generators — therefore embed it cheaply.
//!
//! # Entry points
//!
//! - [`parser::Parser`] — source text → typed [`Stmt`](ast::Stmt) AST with
//! strict validation (`Parser::parse_all` for multi-statement scripts)
//! - [`ast::inject_filter`] — inject a typed comparison into an existing AST
//! - [`explain`] — tree-formatted statement dumps for humans
//! - [`fmt`] — canonical formatter; output re-parses to an identical AST
//! - [`params`] — `:name` / `?` placeholder binding and substitution
//!
//! # Errors
//!
//! Every failure is a structured [`error::QqlError`] carrying a stable `code`,
//! an explicit [`ErrorKind`](error::ErrorKind), and a byte-offset
//! [`Span`](error::Span).
extern crate alloc;
/// Typed abstract syntax tree: statements, filter and formula expressions,
/// values, and AST transforms.
/// Structured errors: stable codes, explicit [`ErrorKind`](error::ErrorKind),
/// byte-offset spans.
/// Tree-formatted statement explanations.
/// Canonical QQL formatter with parse → format → parse round-trip guarantees.
/// Byte-offset lexer: source text → [`Token`](token::Token) stream.
/// Parameter binding for `:name` / `?` placeholders with type-checked
/// substitution.
/// Host-language parameter binding over JSON-shaped `params` values: the
/// single batch-dispatch contract shared by every SDK binding.
/// Recursive-descent parser: token stream → validated typed AST.
/// Lexical token kinds, spans, and keyword lookup tables.