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
//! Match-mode lowering helpers.
//!
//! Per ISO/IEC 39075:2024 §16.4, a `<match mode>` prefixes the entire
//! comma-separated path-pattern list of one MATCH. It is orthogonal to the
//! per-path-pattern `<path mode>` ([`super::path_mode`]): DIFFERENT EDGES
//! (Feature G002) enforces pattern-wide edge uniqueness across every path
//! pattern jointly, while REPEATABLE ELEMENTS (Feature G003) and the
//! implementation-defined default install no filter.
use crate::;
use collect_path_contributors;
/// Wrap a fully-joined graph pattern in a pattern-wide match-mode filter.
///
/// `child` is the join of all comma-separated path patterns of one MATCH
/// clause, so its contributor union is the pattern-wide edge set ISO §16.4 GR4
/// describes. Only [`MatchMode::DifferentEdges`] installs a filter:
///
/// - **`DifferentEdges`** (§16.4 GR8(a)): wrap in [`JoinTree::MatchModeFilter`]
/// carrying every edge contributor across all path patterns. The runtime
/// drops any row that binds one graph edge to two positions.
/// - **`RepeatableElements`** (§16.4 GR8(b): `BINDINGS = INNER`): no filter;
/// return `child` unchanged.
/// - **`None`** (implementation-defined default ID086 = REPEATABLE ELEMENTS):
/// no filter, identical to an explicit REPEATABLE ELEMENTS.
pub