pub struct OpChain {
pub head: AppExpr,
pub tail: Vec<OpRhs>,
pub before: Option<BeforeTail>,
}Expand description
A flattened binary-operator chain: head (op rhs)*, left-folded
(with correct per-operator precedence/associativity) during
elaboration. before is nxbfr’s postfix (e1 before e2), attached
here rather than modeled at its own precedence level: nxbfr sits
between nxif and nxlambda, i.e. above nxlor/OpChain’s own
level, so parser.mly’s left operand is actually nxlambda (which
also covers Fun/Overwrite) — attaching to OpChain alone misses
(fun x -> e1) before e2/(x <- e1) before e2 as the left operand;
such input is rejected here (a documented simplification, not a
silent misparse). body is threaded through ExprErased (not
boxed directly) to keep Expr a singleton SCC: a direct Box<Expr>
field on OpChain would make OpChain itself part of Expr’s SCC
(a second, non-Expr-variant self-loop edge), which is exactly the
multi-type-cycle shape the module doc warns about.
Fields§
§head: AppExpr§tail: Vec<OpRhs>§before: Option<BeforeTail>Trait Implementations§
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for OpChain
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for OpChain
Source§type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
<FieldTy as Parse<Atom>>::Error: Into<…> predicate re-creates a projection cycle on a
recursive field (E0275), which decycle’s bound-peeling does not break.