All files / types TValueBinding.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                                                         
import type IFunctionSymbol from "./symbols/IFunctionSymbol";
import type ILocalDeclaration from "./ILocalDeclaration";
import type IVariableSymbol from "./symbols/IVariableSymbol";
 
/**
 * What a value name means at a position (#1668): the one place a spelling
 * becomes a declaration, for typing and emission alike.
 */
type TValueBinding =
  | {
      readonly kind: "local";
      readonly declaration: ILocalDeclaration;
      readonly scopePath: string;
    }
  /** A file-scope global or a scope member, by C-name identity */
  | { readonly kind: "variable"; readonly symbol: IVariableSymbol }
  /**
   * A C-Next function named where a value is (#1760 review): it has no value
   * to fold or type, but it decides which function the name is, so a global
   * of the same name cannot answer instead (ADR-057)
   */
  | { readonly kind: "function"; readonly symbol: IFunctionSymbol }
  /** A C-Next scope name, as the root of `Scope.member` */
  | { readonly kind: "scope"; readonly scopePath: string }
  /** A name a C or C++ header declares */
  | { readonly kind: "foreign"; readonly name: string };
 
export default TValueBinding;