LustreDesugarMatchBlocksDesugars match blocks into chains of when blocks.
A match block is to a match expression what an if block is to an if-then-else: the arms hold equations rather than a value. Each arm becomes a when block guarded by the constructor testers its pattern imposes, with the pattern's variables replaced by projections out of the scrutinee. The resulting when blocks give the arms the lazy semantics of a match expression, and the existing when-block desugaring supplies the rest: every variable defined in one arm must be defined in all of them, unless the block sits in a frame block, where an uncovered case stutters instead.
Runs after LustreCheckADTDecreases and before LustreDesugarADTs, so the testers and projections it emits are still in surface form and LustreDesugarADTs rewrites them for non-recursive datatypes.
type error_kind = | MisplacedNodeItemInMatchArm of LustreAst.node_item| MisplacedMatchBlock of LustreAst.node_item| ShadowingPatternVariable of HString.tval error_message : error_kind -> stringval desugar_match_blocks :
TypeCheckerContext.tc_context ->
LustreAst.t ->
(LustreAst.t, [> error ]) Stdlib.resultReplaces every match block with the equivalent chain of when blocks.