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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//! The L2 expression reference (P2-5b): [`ExprRef`] and its payload family.
//!
//! An expression position in the op family holds an [`ExprRef`] - a shared
//! arena reference to one of the payloads below, and the enum is **total
//! over everything the parser actually produces**:
//!
//! - [`ExprRef::Js`] - the retained oxc AST (the P1-5 parse-once contract):
//! text that parses as one complete TS-dialect expression covering the
//! whole content, carried beside that exact text and its authored span.
//! - [`ExprRef::Foreign`] - a non-JS expression dialect (charter #28).
//! **Type-only until phase 6**: the type and its folio spelling exist so
//! the contract is closed, but no dialect implementation ships and no
//! lowering constructs one.
//! - [`ExprRef::Filter`] - Vue 2 pipe filters (`{{ msg | capitalize }}`).
//! A dialect expression, not an escape: `|` here is not bitwise-OR.
//! Constructed only when a Vue 2 dialect lowering admits a chain
//! (P2-9 installment 7); never produced by [`ExprRef::parse_js_in`].
//! - [`ExprRef::Opaque`] - the escape variant for the retained-`None`
//! classes P1-5/P1-9 measured, with **pessimal documented semantics from
//! day one** (the imported LLVM `undef`/`poison` rule - see
//! [`opaque`]'s module docs for the laws, and
//! `docs/davinci/plan/phase-2-records/p2-5b.md` for the decision record
//! and the measurement that picked this resolution).
//!
//! # No equality, on purpose
//!
//! `ExprRef` implements neither `PartialEq` nor `Eq`. For [`OpaqueExpr`]
//! textual equality must never imply semantic equality (pessimal law 4:
//! an opaque expression is not even equal to itself), and offering
//! structural equality on the other variants would make the unsound
//! comparison one `match` arm away. Consumers that need identity compare
//! the owned folio mirror, which is explicit about what it carries.
//!
//! # Capability resolution
//!
//! How a consumer asks questions about an expression (enumerate
//! referenced bindings, classify const-ness, map spans, emit for a
//! target) is the [`capability`] contract, resolved **once per file and
//! never dyn-dispatched per node** (performance guardrail 1).
pub use ExprDialect;
pub use ;
pub use ;
pub use JsExpr;
pub use ;
use ;
/// One expression position's reference: retained JS AST, foreign dialect,
/// or the classified escape.
///
/// A *reference*, deliberately: payloads are shared `&'a` borrows of the
/// compile arena, so two positions may name the same payload (`ui.model`'s
/// `read`/`write` typically do), and the enum stays two words. Nothing
/// here survives `Allocator::reset` - the folio carries the owned form
/// (P1-11's contract; see `crate::dump`).
/// The reference family is `Drop`-free like every L2 type (see
/// [`crate::op`]).
const _: = assert!;
/// Two words: a tag plus a shared payload pointer (see [`crate::op`] for
/// the guard rationale).
const _: = assert!;