All files / transpiler/types/symbols TSymbol.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                                                                 
import type IFunctionSymbol from "./IFunctionSymbol";
import type IScopeSymbol from "./IScopeSymbol";
import type IStructSymbol from "./IStructSymbol";
import type IEnumSymbol from "./IEnumSymbol";
import type IVariableSymbol from "./IVariableSymbol";
import type IBitmapSymbol from "./IBitmapSymbol";
import type IRegisterSymbol from "./IRegisterSymbol";
 
/**
 * Discriminated union of all C-Next symbol types.
 *
 * Use the `kind` field to narrow to a specific symbol type:
 * ```typescript
 * if (symbol.kind === "struct") {
 *   // TypeScript knows symbol is IStructSymbol here
 * }
 * ```
 *
 * Note: For C and C++ symbols, use TCSymbol and TCppSymbol respectively.
 * These are kept separate because C/C++ symbols have different properties
 * (e.g., no scope reference, string types instead of TType).
 */
type TSymbol =
  | IFunctionSymbol
  | IScopeSymbol
  | IStructSymbol
  | IEnumSymbol
  | IVariableSymbol
  | IBitmapSymbol
  | IRegisterSymbol;
 
export default TSymbol;