/** * Evaluator for the `compute` declarative computation layer (spec §7). * * Walks a `` element's parse subtree directly (no separate IR — this * matches the rest of the codebase, which operates on ANTLR contexts) and * produces a `Value`. The tree IS the AST: every runtime (TS/Python/Java) walks * the same shape, so there is no expression grammar to re-implement. * * Pure: no RNG, clock, or I/O. The only inputs are the values reachable through * the `fields` resolver (the same visibility as `${{name}}` — spec §3.1). */ import type { OpenCloseElementContext } from '../generated/TDCParser.js'; import { type Value } from './value.js'; /** * Evaluation scope. `fields` resolves ``; `vars` holds `` bindings; * `current`/`currentIndex`/`acc` are the contextual iteration values, present * only inside a `` body. */ export interface EvalScope { readonly fields: (name: string) => string | undefined; readonly vars: ReadonlyMap; readonly current?: Value; readonly currentIndex?: bigint; readonly acc?: Value; } /** * Evaluate a `` element to its output string. `fields` resolves * `` references to their in-scope values. */ export declare function evaluateCompute(computeEl: OpenCloseElementContext, fields: (name: string) => string | undefined): string; /** * Evaluate a `` element's single predicate child to a boolean. Used by * pack generators for reject-and-retry (migration spec §4.2). */ export declare function evaluateComputePredicate(validEl: OpenCloseElementContext, fields: (name: string) => string | undefined): boolean; //# sourceMappingURL=evaluate.d.ts.map