All files / PARSE/4-Resolve TARGET_DESCRIPTION_FIELDS.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

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                        129x                                                        
/**
 * ADR-049: the target description schema, version 1.
 *
 * Typed over every key of `ITargetDescription`, so tsc refuses a field this
 * table forgets, and the validator refuses a catalog whose `struct
 * TargetDescription` disagrees with it. The allowed values are the ADR's.
 */
import type ITargetDescription from "../../types/ITargetDescription";
import type ITargetFieldSpec from "./types/ITargetFieldSpec";
 
const TARGET_DESCRIPTION_FIELDS: {
  readonly [K in keyof ITargetDescription]-?: ITargetFieldSpec;
} = {
  name: { kind: "string", optional: false },
  word_size: { kind: "unsigned", optional: false, allowed: [8, 16, 32, 64] },
  ldrex_strex: { kind: "boolean", optional: false },
  basepri: { kind: "boolean", optional: false },
  char_bits: { kind: "unsigned", optional: false, allowed: [8] },
  char_signed: { kind: "boolean", optional: false },
  short_bits: { kind: "unsigned", optional: false, allowed: [16] },
  int_bits: { kind: "unsigned", optional: false, allowed: [16, 32] },
  long_bits: { kind: "unsigned", optional: false, allowed: [32, 64] },
  long_long_bits: { kind: "unsigned", optional: false, allowed: [64] },
  size_t_bits: { kind: "unsigned", optional: false, allowed: [16, 32, 64] },
  pointer_bits: { kind: "unsigned", optional: false, allowed: [16, 32, 64] },
  float_bits: { kind: "unsigned", optional: false, allowed: [32] },
  double_bits: { kind: "unsigned", optional: false, allowed: [32, 64] },
  long_double_bits: {
    kind: "unsigned",
    optional: false,
    allowed: [32, 64, 96, 128],
  },
  big_endian: { kind: "boolean", optional: false },
  external_identifier_chars: { kind: "unsigned", optional: false, min: 6 },
  internal_identifier_chars: { kind: "unsigned", optional: false, min: 31 },
  toolchain_triple: { kind: "string", optional: true },
  toolchain_cpu: { kind: "string", optional: true },
};
 
export default TARGET_DESCRIPTION_FIELDS;