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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! High-level intermediate representation (HIR) for Cypher queries.
//!
//! The HIR is a scope-resolved, normalised representation that sits between
//! the typed AST ([`crate::ast`]) and a hypothetical execution engine. It is
//! produced by the [`lower`] module.
//!
//! # Structure
//!
//! | Sub-module | Contents |
//! |---|---|
//! | [`arena`] | Arena allocators and interners for HIR IDs |
//! | [`binding`] | Scope and binding (variable) types |
//! | [`diagnostic`] | Semantic diagnostics produced during lowering |
//! | [`expr`] | HIR expression nodes (`HirExpr`, `ExprKind`, …) |
//! | [`lower`] | The AST → HIR lowering pass |
//! | [`ops`] | Pipeline operation types (`MatchOp`, `ProjectOp`, …) |
//! | [`pattern`] | Normalised graph pattern types |
//!
//! # Relationship to the AST
//!
//! The HIR differs from the AST in the following ways:
//! - Variables are replaced by compact arena [`BindingId`]s.
//! - Scopes are explicit and allocated in [`HirArenas`].
//! - Graph patterns are flattened into node/relationship lists.
//! - Queries are decomposed into a sequence of [`QueryPart`] pipelines.
pub use AggregateRegistry;
pub use LowerConfig;
pub use ;
pub use ;
pub use HirDiagnostic;
pub use ;
pub use ;
pub use ;
/// A fully lowered and scope-resolved HIR query.
///
/// Produced by [`lower::lower`] from a parsed [`crate::ast::query::Query`].
/// Contains all arenas and the pipeline of query parts.
///
/// > **Note:** `lower()` currently returns `Err(Diagnostics)` whenever any
/// > diagnostic is produced, so successful `HirQuery` values always have an
/// > empty `diagnostics` vector. Non-fatal warning support may be added in a
/// > future release.