pub struct LetStatement {
pub identifier: String,
pub value_expr: String,
pub value_kind: String,
pub type_annotation: Option<TypeExpr>,
pub value_ast: Option<Expr>,
pub loc: Loc,
pub leading_trivia: Vec<Trivia>,
pub trailing_trivia: Vec<Trivia>,
}Fields§
§identifier: String§value_expr: String§value_kind: Stringv1.12.0 — preserves the parser’s tokenization intent so the runtime dispatcher can distinguish a quoted literal from a dotted-identifier reference. One of “literal”, “reference”, “expression”. Defaults to “literal” so any pre-cycle-17 caller that constructs a LetStatement directly behaves as a literal.
type_annotation: Option<TypeExpr>v2.4.0 — optional type annotation let x: <TypeExpr> = ….
None for the bare let x = … form (all pre-51.c.3 lets). Inside a
quant block the Continuous Type Invariant inspects this to enforce the
continuous-carrier discipline (DensityMatrix[D] D=2ⁿ; reject discrete
conversational types). Carries the typed encoder-boundary contract.
value_ast: Option<Expr>v2.26.0 — the parsed expression form of the value, present only when
value_kind == "expression" (let total = price * qty + tax). The
runtime evaluates it via the pure expression evaluator instead of the
pre-v2.26.0 behaviour (which treated an expression as an opaque literal
string). None for literal / reference / list values (byte-identical to
pre-v2.26.0).
loc: Loc§leading_trivia: Vec<Trivia>v1.5.2 — leading comment trivia attached to this declaration (comments preceding the declaration’s first token, since the previous declaration or file start). Empty by default.
trailing_trivia: Vec<Trivia>v1.5.2 — trailing comment trivia (same line as the declaration’s last effective token). Empty by default.