Removes the else branch from an if or with expression.
Per mutagen.mutators catalog entry 9.
AST shape
if cond do A else B end parses as
{:if, meta, [cond, [do: A, else: B]]}with C1 <- E1, do: A, else: (pattern -> B) parses as
{:with, meta, [c1_clause, [do: A, else: [{:->, _, [[pattern], B]}]]]}Removal
We drop the :else key from the keyword list at the tail.
Validation
:structurally_invalid—elseremoval would leave a call site that pattern-matches the originalif/withfor both branches. The catalog cannot prove this from a single node in isolation; in v1 we mark removal:okunconditionally and rely on the runner to surface a:compile_erroroutcome when the caller's pattern matching breaks. Scenariomutagen.mutators.s6documents the eventual goal of context- sensitive validation; the v1 behaviour is the conservative subset that still does the swap and lets the runtime be the judge.
The shape itself is validated: a non-if/non-with input is
:structurally_invalid, as is a form that has no else branch in the
first place (nothing to drop — the catalog should not have matched it).