/** * The named-argument plan: how `f(b=2, a=1)` becomes positions, and the two * words every arity report is written with. * * D115 §三: this was one method and two helpers of `CallInference`. Every other * file of this directory reaches it — an ordinary call, a generic call, an * intrinsic and a collection member all plan their named arguments the same way * — so it is the leaf of the directory, and the one instance the facade builds * is handed to the two files that need it rather than rebuilt in each. */ import { type Expression } from "../../ast.ts"; import { type DiagnosticFix } from "../../diagnostic.ts"; import { type Span } from "../../source.ts"; import { type ValueType } from "../../types.ts"; export declare function argumentNoun(expected: string): "argument" | "arguments"; export declare function trimTrailingOmittedArguments(sources: readonly number[]): readonly number[]; /** Consume the planner's parameter positions without reinterpreting source labels. */ export declare function orderedArgumentValues(arguments_: readonly Expression[], sources: readonly number[] | undefined, callSpan: Span): readonly Expression[]; export interface NamedArgumentPlan { readonly ordered: readonly Expression[]; readonly targets: readonly (number | null)[]; readonly valid: boolean; } /** * The one lowering table a plan writes: the source position each parameter * slot was filled from, so the emitter can rebuild the positional call. */ interface NamedArgumentLoweringFacts { readonly namedArgumentOrders: Map; } /** What the planner asks of the analyzer that hosts it, and nothing more. */ export interface NamedArgumentsHost { readonly lowering: NamedArgumentLoweringFacts; typeError(message: string, errorSpan: Span, fix?: DiagnosticFix): void; } export declare class NamedArguments { private readonly host; private readonly labelSpans; constructor(host: NamedArgumentsHost); /** Parser-owned token spans survive comments, multiline values and nesting. */ registerCall(expression: Extract): void; planNamedArguments(arguments_: readonly Expression[], argumentNames: readonly (string | null)[] | undefined, parameters: readonly ValueType[], parameterNames: readonly string[] | undefined, requiredParameters: number, callSpan: Span, rest?: ValueType): NamedArgumentPlan | null; } export {}; //# sourceMappingURL=named-arguments.d.ts.map