/** * `match` pattern emission: the lines that attempt one `case` pattern against a * value and the bindings it produces when it matches. */ import type { Expression, MatchPattern } from "../ast.ts"; import { type ValueType } from "../types.ts"; import { type LoweringHints } from "../contracts.ts"; export interface MatchEmitterHost { emitMappedExpression(expression: Expression, normalizeNull?: boolean): string; emitTypeCheck(type: ValueType, value: string, state?: string): string; readonly hints: LoweringHints; needsCollectionHelpers: boolean; needsDirectCollectionInfrastructure: boolean; } export declare class MatchEmitter { private readonly host; constructor(host: MatchEmitterHost); emitMatchPatternAttempt(pattern: MatchPattern, valueName: string, indentation: string): { readonly lines: readonly string[]; readonly bindings: readonly { readonly name: string; readonly value: string; }[]; }; /** * One pattern against one value. `context` carries the four things every * branch needs — the lines emitted so far, the two ways a branch can end * (bind a name, reject the attempt), a fresh temporary name, and the * recursion — so a nested pattern is emitted by the same rules as a top one. */ private emitPatternMatch; } //# sourceMappingURL=matching.d.ts.map