All files / TRANSPILE/3-Render/codegen/types IPlannedDimension.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                           
/**
 * One array dimension written on a TYPE -- the `[16]` of `u8[16] data`.
 *
 * #1445 box 3: `ArrayDimensionUtils` read an `ArrayTypeContext` for the list of
 * dimensions and, for each, whether it carries a size expression. That is two
 * facts per dimension, and both are here.
 *
 * `renderSize` is a thunk, not a string, because a dimension that does not
 * fold to a constant goes through expression generation, which registers
 * effects on `CodeGenState` -- and the caller that asks for the dimensions may
 * not emit them. Null is the unsized `[]`, which renders without asking.
 */
interface IPlannedDimension {
  /**
   * The size, rendered: a folded constant where one could be evaluated, and
   * the generated expression otherwise. Null for an unsized `[]`.
   */
  readonly renderSize: (() => string) | null;
}
 
export default IPlannedDimension;