All files / types/symbols IStructFieldSymbol.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 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45                                                                                         
import type IBaseSymbol from "./IBaseSymbol";
import type TType from "../TType";
import type TConstExpr from "../TConstExpr";
 
/**
 * Symbol representing one field of a struct.
 *
 * Was `IFieldInfo`, a plain record with no position and no identity (#1318).
 * Every field of a struct declared across twenty lines reported the struct's
 * line, or reported nothing at all, because there was nowhere to put one.
 *
 * `fullyQualifiedCName` here is an INDEX KEY, not an emitted identifier -- see
 * the note on `IBaseSymbol`. A struct field is emitted `p.x`; `SPoint__x` is
 * what distinguishes this field from `SOther__x` in the symbol table, and
 * nothing generated ever contains it.
 */
interface IStructFieldSymbol extends IBaseSymbol {
  /** Discriminator narrowed to "struct_field" */
  readonly kind: "struct_field";
 
  /** Field type */
  readonly type: TType;
 
  /** Whether this field is const */
  readonly isConst: boolean;
 
  /** Whether this field is atomic (volatile in C) */
  readonly isAtomic: boolean;
 
  /** Whether this field is an array */
  readonly isArray: boolean;
 
  /** Array dimensions if isArray is true */
  readonly dimensions?: ReadonlyArray<number | string>;
  /**
   * #1175: each dimension as written, index-aligned with the dimensions --
   * null where 1.3 already knew the size (a literal, `sizeof` of a primitive,
   * an unsized `[]`). 1.4 Resolve settles the rest from this, never from
   * source text.
   */
  readonly dimensionExprs?: ReadonlyArray<TConstExpr | null>;
}
 
export default IStructFieldSymbol;