import type { AgencyNode } from "../types.js"; /** * Rewrite every `comprehension` node into ordinary `map` / `filter` / * `fork` calls carrying block arguments - the exact shape those calls * have when written by hand. After this pass the rest of the compiler * cannot tell the construct existed, so typing, codegen, interrupts, * and fork branch semantics are inherited rather than reimplemented. * * Runs inside parseAgency's `if (lower)` block, BEFORE lowerPatterns, so * a destructuring binder becomes an ordinary pattern assignment that * lowerPatterns then handles with its existing machinery. * * MUTATES IN PLACE, for the same reason guardDesugar does: consumers * hold references to the same node objects, so a copying rewrite would * leave half the pipeline looking at stale bodies. Idempotent - a second * run finds no comprehension nodes. * * The `fork` case emits a real `fork` functionCall node rather than * calling a helper. `fork` is NOT a function: the builder intercepts it * at typescriptBuilder.ts processFunctionCall and compiles the block body * differently, supplying the branch stack and per-branch frames. A helper * receiving an ordinary lifted block would get none of that. * parallelDesugar.ts synthesizes the same shape for `parallel { }`, which * proves it compiles. */ export declare function desugarComprehensionsInBody(body: AgencyNode[]): AgencyNode[];