/** * Every tag of the compute language, and the attributes each one reads. * * ONE list, with two readers: the evaluator reads an attribute only through * `attrOf`, whose type admits the names listed here and no other, and the * validator refuses any name that is not listed. A tag cannot learn to read an * attribute without this table knowing — the build fails first — so the * validator's idea of what a tag accepts cannot drift from what it reads. * * It exists because nothing checked these names at all. `` refuses an * attribute it does not have (TDC015); a compute tag took any name, and an * attribute it does not read changed the output without a word: * * -> a-b-c * -> abc * * Measured by the Studio agent over sixteen attributes: nine misspellings * passed `check`, and eight of those produced a different file. The seven that * were refused were refused for the wrong reason — the value the attribute * carried had gone missing, and the complaint pointed at whatever needed it, * one tag further down. * * The keys are also the tag vocabulary: `COMPUTE_TAGS` is read off this table * rather than kept beside it. */ import type { AttrMap } from '../processor/attrs.js'; export declare const COMPUTE_ATTRIBUTES: { readonly int: readonly ["v"]; readonly str: readonly ["v"]; readonly list: readonly ["v"]; readonly field: readonly ["name"]; readonly use: readonly ["name"]; readonly current: readonly []; readonly current_index: readonly []; readonly acc: readonly []; readonly let: readonly ["name"]; readonly each: readonly []; readonly reduce: readonly []; readonly join: readonly ["sep"]; readonly split: readonly ["sep"]; readonly at: readonly ["default"]; readonly length: readonly []; readonly add: readonly []; readonly subtract: readonly []; readonly multiply: readonly []; readonly divide: readonly []; readonly mod: readonly []; readonly encode: readonly ["as"]; readonly to_number: readonly []; readonly pad: readonly ["width", "fill"]; readonly concat: readonly []; readonly upper: readonly []; readonly lower: readonly []; readonly capitalize: readonly []; readonly title: readonly []; readonly mask: readonly ["pattern"]; readonly slice: readonly ["from", "to"]; readonly replace: readonly ["from", "to"]; readonly trim: readonly []; readonly group: readonly ["size", "sep"]; readonly choose: readonly []; readonly when: readonly []; readonly otherwise: readonly []; readonly test: readonly []; readonly then: readonly []; readonly result: readonly []; readonly over: readonly []; readonly do: readonly []; readonly init: readonly []; readonly in: readonly []; readonly index: readonly []; readonly equals: readonly []; readonly greater_than: readonly []; readonly less_than: readonly []; readonly is_digit: readonly []; }; export type ComputeTag = keyof typeof COMPUTE_ATTRIBUTES; /** The attributes `T` reads. */ export type ComputeAttr = (typeof COMPUTE_ATTRIBUTES)[T][number]; /** * Accepted on every compute tag and read by none: a note for the reader, the * same as on every other tag. Refusing it on the one tag that happens not to * list it would be a pointless trap. */ export declare const ANY_COMPUTE_TAG_ATTRIBUTE = "comment"; /** The attributes a compute tag accepts, or `undefined` for a tag the language does not have. */ export declare function computeAttributesOf(tag: string): readonly string[] | undefined; /** * Read attribute `name` of a `` node. `tag` is there for the type only: * it is what makes reading an unlisted attribute a compile error. */ export declare function attrOf(attrs: AttrMap, _tag: T, name: ComputeAttr): string | undefined; //# sourceMappingURL=attributes.d.ts.map