/** * Pattern lowering pass. * * Walks the AST and transforms all destructuring/pattern-matching syntax into * existing Agency constructs (Assignments, IfElse, BinOpExpressions, ValueAccess, * FunctionCalls). After this pass, the AST contains NO pattern-specific nodes, * so the rest of the pipeline (typechecker, TypeScriptBuilder, preprocessor, LSP) * needs zero changes. * * Runs after parsing, before SymbolTable.build / typechecking. */ import type { AgencyNode, Expression, FunctionCall } from "../types.js"; import type { SourceLocation } from "../types/base.js"; export declare function lowerPatterns(nodes: AgencyNode[]): AgencyNode[]; /** `isSuccess(source)` or `isFailure(source)`, the call an `is success` or * `is failure` pattern lowers to. The hoist pass emits the same call for * the `?` operator. */ export declare function resultCheckCall(kind: "success" | "failure", source: Expression, loc: SourceLocation | undefined): FunctionCall; export declare class PatternLoweringError extends Error { loc?: SourceLocation | undefined; constructor(message: string, loc?: SourceLocation | undefined); }