{
  "schemaVersion": 1,
  "contractRevision": 2,
  "profile": "Portable",
  "featurePairs": [
    {
      "id": "fixed-primitives",
      "featureId": "fixed-primitives",
      "manual": "docs/language/primitive-types.md#fixed-primitives",
      "valid": {
        "definition": "struct root { uint16< value; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 2,
        "bytes": "3412",
        "offsets": {
          "root.value": 0
        },
        "values": {
          "root.value": "4660"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "unrecognized-integer-spelling",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "boolean-primitive",
      "featureId": "boolean-primitive",
      "manual": "docs/language/primitive-types.md#fixed-primitives",
      "valid": {
        "definition": "struct root { bool flag; uint8 tail; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 1,
        "bytes": "01AA",
        "offsets": {
          "root.flag": 0,
          "root.tail": 1
        },
        "values": {
          "root.flag": "true",
          "root.tail": "170"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "unrecognized-integer-spelling",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "floating-point-primitives",
      "featureId": "floating-point-primitives",
      "manual": "docs/language/primitive-types.md#floating-point-primitives",
      "valid": {
        "definition": "struct root { float32 a; float64 b; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 12,
        "alignment": 8,
        "bytes": "0000C03F0000000000000440",
        "offsets": {
          "root.a": 0,
          "root.b": 4
        },
        "values": {
          "root.a": "1.5",
          "root.b": "2.5"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "floating-point-field",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "portable-c-integer-spellings",
      "featureId": "portable-c-integer-spellings",
      "manual": "docs/language/primitive-types.md#fixed-primitives",
      "valid": {
        "definition": "struct root { uint32_t value; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 4,
        "alignment": 4,
        "bytes": "78563412",
        "offsets": {
          "root.value": 0
        },
        "values": {
          "root.value": "305419896"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "unrecognized-integer-spelling",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "character-buffers",
      "featureId": "character-buffers",
      "manual": "docs/language/arrays-and-strings.md#fixed-character-buffers",
      "valid": {
        "definition": "struct root { char value[2]; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 1,
        "bytes": "41427E",
        "offsets": {
          "root.value": 0,
          "root.value[1]": 1,
          "root.tail": 2
        },
        "values": {
          "root.value[0]": "A",
          "root.value[1]": "B",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "qualifier-not-in-closed-set",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "terminated-strings",
      "featureId": "terminated-strings",
      "manual": "docs/language/arrays-and-strings.md#terminated-strings",
      "valid": {
        "definition": "struct root { utf8_string_zero value; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "alignment": 1,
        "bytes": "41007E",
        "offsets": {
          "root.value": 0,
          "root.tail": 2
        },
        "values": {
          "root.value": "A",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "data-sized-array-of-dynamic-element",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "enums",
      "featureId": "enums",
      "manual": "docs/language/structs-unions-enums-typedefs.md#enums",
      "valid": {
        "definition": "enum mode : uint8 { One=1, Two=2 }; struct root { mode value; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 1,
        "bytes": "027E",
        "offsets": {
          "root.value": 0,
          "root.tail": 1
        },
        "values": {
          "root.value.name": "Two",
          "root.value.value": "2",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "tag-kind-mismatch",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "portable-bitfields",
      "featureId": "portable-bitfields",
      "manual": "docs/language/bitfields.md#portable-bitfields",
      "valid": {
        "definition": "struct root { uint8 low:4; uint8 high:4; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 1,
        "bytes": "A57E",
        "offsets": {
          "root.low": 0,
          "root.high": 0,
          "root.tail": 1
        },
        "values": {
          "root.low": "5",
          "root.high": "10",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "zero-width-bitfield",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "fixed-arrays",
      "featureId": "fixed-arrays",
      "manual": "docs/language/arrays-and-strings.md#fixed-arrays",
      "valid": {
        "definition": "struct root { uint8 values[2]; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 1,
        "bytes": "11227E",
        "offsets": {
          "root.values": 0,
          "root.values[1]": 1,
          "root.tail": 2
        },
        "values": {
          "root.values[0]": "17",
          "root.values[1]": "34",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "runtime-sized-multidimensional-array",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "runtime-expression-arrays",
      "featureId": "runtime-expression-arrays",
      "manual": "docs/language/arrays-and-strings.md#runtime-expression-arrays",
      "valid": {
        "definition": "struct root { uint8 values[N]; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "alignment": 1,
        "bytes": "11227E",
        "variables": {
          "N": 2
        },
        "offsets": {
          "root.values": 0,
          "root.values[1]": 1,
          "root.tail": 2
        },
        "values": {
          "root.values[0]": "17",
          "root.values[1]": "34",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "data-sized-array-of-dynamic-element",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "nested-structs",
      "featureId": "nested-structs",
      "manual": "docs/language/structs-unions-enums-typedefs.md#named-structs",
      "valid": {
        "definition": "struct child { uint8 value; }; struct root { child item; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 1,
        "bytes": "117E",
        "offsets": {
          "root.item": 0,
          "root.item.value": 0,
          "root.tail": 1
        },
        "values": {
          "root.item.value": "17",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "duplicate-typedef-tag",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "inline-structs",
      "featureId": "inline-structs",
      "manual": "docs/language/structs-unions-enums-typedefs.md#inline-structs",
      "valid": {
        "definition": "struct root { struct { uint8 value; } item; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 1,
        "bytes": "117E",
        "offsets": {
          "root.item": 0,
          "root.item.value": 0,
          "root.tail": 1
        },
        "values": {
          "root.item.value": "17",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "dynamic-union-member",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "anonymous-promoted-member",
      "featureId": "anonymous-promoted-member",
      "manual": "docs/language/structs-unions-enums-typedefs.md#anonymous-promoted-members",
      "valid": {
        "definition": "struct root { uint8 a; struct { uint8 x; uint8 y; }; uint8 b; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 4,
        "alignment": 1,
        "bytes": "01020304",
        "offsets": {
          "root.a": 0,
          "root.x": 1,
          "root.y": 2,
          "root.b": 3
        },
        "values": {
          "root.a": "1",
          "root.x": "2",
          "root.y": "3",
          "root.b": "4"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "dynamic-union-member",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "multiple-declarators",
      "featureId": "multiple-declarators",
      "manual": "docs/language/grammar.md#complete-portable-grammar",
      "valid": {
        "definition": "struct root { uint8 first, second; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 1,
        "bytes": "0102",
        "offsets": {
          "root.first": 0,
          "root.second": 1
        },
        "values": {
          "root.first": "1",
          "root.second": "2"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "qualifier-not-in-closed-set",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "qualifiers",
      "featureId": "qualifiers",
      "manual": "docs/language/grammar.md#complete-portable-grammar",
      "valid": {
        "definition": "struct root { const uint8 value; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": 1,
        "alignment": 1,
        "bytes": "2A",
        "offsets": {
          "root.value": 0
        },
        "values": {
          "root.value": "42"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "trailing-qualifier-position",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "field-alignment-override",
      "featureId": "field-alignment-override",
      "manual": "docs/language/layout-alignment-and-padding.md#explicit-field-alignment-override",
      "valid": {
        "definition": "struct root { uint8 a; uint8 value @align(4); };",
        "root": "root",
        "pointerSize": 4,
        "aligned": true,
        "littleEndian": true,
        "size": 8,
        "alignment": 4,
        "bytes": "0100000002000000",
        "offsets": {
          "root.a": 0,
          "root.value": 4
        },
        "values": {
          "root.a": "1",
          "root.value": "2"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "non-power-of-two-alignment",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "offset-assertion",
      "featureId": "field-offset-assertion",
      "manual": "docs/language/layout-alignment-and-padding.md#explicit-byte-offset-assertion",
      "valid": {
        "definition": "struct root { uint8 a; uint8 b; uint8 value @2; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 1,
        "bytes": "010203",
        "offsets": {
          "root.a": 0,
          "root.b": 1,
          "root.value": 2
        },
        "values": {
          "root.a": "1",
          "root.b": "2",
          "root.value": "3"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "offset-assertion-mismatch",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "composite-alignment-override",
      "featureId": "composite-alignment-override",
      "manual": "docs/language/layout-alignment-and-padding.md#explicit-composite-alignment-override",
      "valid": {
        "definition": "struct root @align(1) { uint8 a; uint32 b; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": true,
        "littleEndian": true,
        "size": 5,
        "alignment": 1,
        "bytes": "0101020304",
        "offsets": {
          "root.a": 0,
          "root.b": 1
        },
        "values": {
          "root.a": "1",
          "root.b": "67305985"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "non-power-of-two-composite-alignment",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "anonymous-bitfield-padding",
      "featureId": "unnamed-nonzero-width-bitfield",
      "manual": "docs/language/bitfields.md#unnamed-padding-fields",
      "valid": {
        "definition": "struct root { uint8 flag:1, :3, other:4; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 1,
        "alignment": 1,
        "bytes": "51",
        "offsets": {
          "root.flag": 0,
          "root.other": 0
        },
        "values": {
          "root.flag": "1",
          "root.other": "5"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "zero-width-bitfield",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "typedefs",
      "featureId": "typedefs",
      "manual": "docs/language/structs-unions-enums-typedefs.md#typedefs",
      "valid": {
        "definition": "typedef uint16 word; struct root { word value; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 2,
        "bytes": "34127E",
        "offsets": {
          "root.value": 0,
          "root.tail": 2
        },
        "values": {
          "root.value": "4660",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "pointer-to-typedef-array",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "unions",
      "featureId": "unions",
      "manual": "docs/language/structs-unions-enums-typedefs.md#unions",
      "valid": {
        "definition": "union choice { uint8 narrow; uint16 wide; };",
        "root": "choice",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 2,
        "bytes": "A512",
        "offsets": {
          "choice.narrow": 0,
          "choice.wide": 0
        },
        "values": {
          "choice.narrow": "165",
          "choice.wide": "4773"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "dynamic-union-member",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "tag-keywords",
      "featureId": "tag-keywords",
      "manual": "docs/language/grammar.md#complete-portable-grammar",
      "valid": {
        "definition": "struct child { uint8 value; }; struct root { struct child value; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": 1,
        "alignment": 1,
        "bytes": "2A",
        "offsets": {
          "root.value.value": 0
        },
        "values": {
          "root.value.value": "42"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "tag-kind-mismatch",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "pointers",
      "featureId": "pointers",
      "manual": "docs/language/pointers-and-addressing.md#pointers",
      "valid": {
        "definition": "struct root { uint16 *target; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 2,
        "bytes": "00007E",
        "offsets": {
          "root.target.address": 0,
          "root.tail": 2
        },
        "values": {
          "root.target.address": "0",
          "root.target.depth": "1",
          "root.target.isNull": "true",
          "root.target.isDereferenced": "false",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "void-value-field",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "multi-pointers",
      "featureId": "multi-pointers",
      "manual": "docs/language/pointers-and-addressing.md#multi-level-pointers",
      "valid": {
        "definition": "struct root { uint8 **target; byte tail; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 2,
        "bytes": "00007E",
        "offsets": {
          "root.target.address": 0,
          "root.tail": 2
        },
        "values": {
          "root.target.address": "0",
          "root.target.depth": "2",
          "root.target.isNull": "true",
          "root.target.isDereferenced": "false",
          "root.tail": "126"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "tag-alias-kind-mismatch",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "alignment-and-endian-overrides",
      "featureId": "alignment-and-endian-overrides",
      "manual": "docs/language/layout-alignment-and-padding.md#alignment-and-endian",
      "valid": {
        "definition": "struct root { uint8 head; uint16> big; uint16< little; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": true,
        "littleEndian": true,
        "size": 6,
        "alignment": 2,
        "bytes": "110012347856",
        "offsets": {
          "root.head": 0,
          "root.big": 2,
          "root.little": 4
        },
        "values": {
          "root.head": "17",
          "root.big": "4660",
          "root.little": "22136"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "non-power-of-two-pack-pragma",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "bounded-failures",
      "featureId": "bounded-failures",
      "manual": "docs/language/limits-and-diagnostics.md#bounded-failures",
      "valid": {
        "definition": "struct root { utf8_string_zero text; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "alignment": 1,
        "bytes": "414200",
        "offsets": {
          "root.text": 0
        },
        "values": {
          "root.text": "AB"
        }
      },
      "invalid": {
        "stage": "read",
        "definition": "struct root { utf8_string_zero text; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "bytes": "414200",
        "maxStringBytes": 2,
        "errorCode": "ReadLimitExceeded"
      }
    },
    {
      "id": "invalid-layouts",
      "featureId": "invalid-layouts",
      "manual": "docs/language/limits-and-diagnostics.md#invalid-layouts",
      "valid": {
        "definition": "struct root { uint8 value; };",
        "root": "root",
        "pointerSize": 2,
        "aligned": false,
        "littleEndian": true,
        "size": 1,
        "alignment": 1,
        "bytes": "2A",
        "offsets": {
          "root.value": 0
        },
        "values": {
          "root.value": "42"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "unknown-preprocessor-directive",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "integers-24",
      "featureId": "integers-24",
      "manual": "docs/language/primitive-types.md#fixed-primitives",
      "valid": {
        "definition": "struct root { int24< values[2]; uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": 7,
        "alignment": 1,
        "bytes": "010000FEFFFF63",
        "offsets": {
          "root.values[1]": 3,
          "root.tail": 6
        },
        "values": {
          "root.values[1]": "-2",
          "root.tail": "99"
        }
      },
      "invalid": {
        "stage": "read",
        "definition": "struct root { int24< values[2]; uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "bytes": "01",
        "errorCode": "ReadFailed",
        "maxStringBytes": 1024
      }
    },
    {
      "id": "bounded-encodings",
      "featureId": "bounded-encodings",
      "manual": "docs/language/arrays-and-strings.md#other-byte-bounded-encodings",
      "valid": {
        "definition": "struct root { utf8 label[2]; uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 1,
        "bytes": "C3A963",
        "offsets": {
          "root.label": 0,
          "root.tail": 2
        },
        "values": {
          "root.label": "\u00e9",
          "root.tail": "99"
        }
      },
      "invalid": {
        "stage": "read",
        "definition": "struct root { utf8 label[2]; uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "bytes": "C363",
        "errorCode": "ReadFailed",
        "maxStringBytes": 1024
      }
    },
    {
      "id": "leb128-integers",
      "featureId": "leb128-integers",
      "manual": "docs/language/primitive-types.md#variable-length-integers",
      "valid": {
        "definition": "struct root { uleb128_32 value; uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": null,
        "alignment": 1,
        "bytes": "800163",
        "offsets": {
          "root.value": 0,
          "root.tail": 2
        },
        "values": {
          "root.value": "128",
          "root.tail": "99"
        }
      },
      "invalid": {
        "stage": "read",
        "definition": "struct root { uleb128_32 value; uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "bytes": "808080808000",
        "errorCode": "ReadFailed",
        "maxStringBytes": 1024
      }
    },
    {
      "id": "fixed-point-values",
      "featureId": "fixed-point-values",
      "manual": "docs/language/primitive-types.md#fixed-point-values",
      "valid": {
        "definition": "struct root { fixed16_16> value; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": 4,
        "alignment": 4,
        "bytes": "FFFE8000",
        "offsets": {
          "root.value": 0
        },
        "values": {
          "root.value": "-1.5"
        }
      },
      "invalid": {
        "stage": "read",
        "definition": "struct root { fixed16_16> value; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "bytes": "FF",
        "errorCode": "ReadFailed",
        "maxStringBytes": 1024
      }
    },
    {
      "id": "identifier-values",
      "featureId": "identifier-values",
      "manual": "docs/language/primitive-types.md#uuid-and-guid-identifiers",
      "valid": {
        "definition": "struct root { uuid network; guid windows; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": 32,
        "alignment": 1,
        "bytes": "00112233445566778899AABBCCDDEEFF33221100554477668899AABBCCDDEEFF",
        "offsets": {
          "root.network": 0,
          "root.windows": 16
        },
        "values": {
          "root.network": "00112233-4455-6677-8899-aabbccddeeff",
          "root.windows": "00112233-4455-6677-8899-aabbccddeeff"
        }
      },
      "invalid": {
        "stage": "read",
        "definition": "struct root { uuid network; guid windows; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "bytes": "0011",
        "errorCode": "ReadFailed",
        "maxStringBytes": 1024
      }
    },
    {
      "id": "conditional-fields",
      "featureId": "conditional-fields",
      "manual": "docs/language/grammar.md#conditional-field-groups",
      "valid": {
        "definition": "struct root { uint8 tag; if(tag == 1) { uint24< number; } else { utf8 label[3]; } uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "size": null,
        "alignment": 1,
        "bytes": "012A000063",
        "offsets": {
          "root.number": 1,
          "root.tail": 4
        },
        "values": {
          "root.number": "42",
          "root.tail": "99"
        }
      },
      "invalid": {
        "stage": "read",
        "definition": "struct root { uint8 tag; if(tag == 1) { uint24< number; } else { utf8 label[3]; } uint8 tail; };",
        "root": "root",
        "pointerSize": 1,
        "aligned": false,
        "littleEndian": true,
        "bytes": "01",
        "errorCode": "ReadFailed",
        "maxStringBytes": 1024
      }
    },
    {
      "id": "alias-spellings",
      "featureId": "alias-spellings",
      "manual": "docs/language/primitive-types.md#alias-spellings",
      "valid": {
        "definition": "struct root { BYTE kind; WORD count; DWORD length; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 7,
        "alignment": 4,
        "bytes": "02030004000000",
        "offsets": {
          "root.kind": 0,
          "root.count": 1,
          "root.length": 3
        },
        "values": {
          "root.kind": "2",
          "root.count": "3",
          "root.length": "4"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "unrecognized-integer-spelling",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "typedef-forms",
      "featureId": "typedef-forms",
      "manual": "docs/language/structs-unions-enums-typedefs.md#typedefs",
      "valid": {
        "definition": "typedef struct _X { uint8 a; uint16 b; } X, *PX; typedef uint8 pair[2]; struct root { X x; _X y; pair p; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 8,
        "alignment": 2,
        "bytes": "0102000304000506",
        "offsets": {
          "root.x": 0,
          "root.x.a": 0,
          "root.x.b": 1,
          "root.y": 3,
          "root.p": 6
        },
        "values": {
          "root.x.a": "1",
          "root.x.b": "2",
          "root.y.a": "3",
          "root.y.b": "4",
          "root.p[1]": "6"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "pointer-to-typedef-array",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "top-level-declarations",
      "featureId": "top-level-declarations",
      "manual": "docs/language/structs-unions-enums-typedefs.md#top-level-declaration-forms",
      "valid": {
        "definition": "struct { uint16 sec; uint16 usec; } timeval; struct root { timeval stamp; uint8 tail; } header;",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 5,
        "alignment": 2,
        "bytes": "0100020003",
        "offsets": {
          "root.stamp": 0,
          "root.stamp.sec": 0,
          "root.stamp.usec": 2,
          "root.tail": 4
        },
        "values": {
          "root.stamp.sec": "1",
          "root.stamp.usec": "2",
          "root.tail": "3"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "duplicate-typedef-tag",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "preprocessor-lines",
      "featureId": "preprocessor-lines",
      "manual": "docs/language/lexical-rules.md#preprocessor-lines",
      "valid": {
        "definition": "#define LABEL 2 \\\r\nwords\r\n#define\u00a0N 2\n#pragma pack(1)\n#ifdef N\nstruct root { uint8 a; uint32 b; uint8 v[N]; };\n#else\nstruct root { uint8 a; };\n#endif",
        "root": "root",
        "pointerSize": 4,
        "aligned": true,
        "littleEndian": true,
        "size": 7,
        "alignment": 1,
        "bytes": "01020000000304",
        "offsets": {
          "root.a": 0,
          "root.b": 1,
          "root.v": 5
        },
        "values": {
          "root.a": "1",
          "root.b": "2",
          "root.v[0]": "3",
          "root.v[1]": "4"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "unknown-preprocessor-directive",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "inline-unions",
      "featureId": "inline-unions",
      "manual": "docs/language/structs-unions-enums-typedefs.md#anonymous-promoted-members",
      "valid": {
        "definition": "struct root { uint32 attributes; union { struct { uint16 ea_size; uint16 reserved; }; uint32 reparse_tag; }; uint8 name_length; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 9,
        "alignment": 4,
        "bytes": "200000003412785603",
        "offsets": {
          "root.attributes": 0,
          "root.ea_size": 4,
          "root.reserved": 6,
          "root.reparse_tag": 4,
          "root.name_length": 8
        },
        "values": {
          "root.attributes": "32",
          "root.ea_size": "4660",
          "root.reserved": "22136",
          "root.reparse_tag": "1450709556",
          "root.name_length": "3"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "dynamic-union-member",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "data-sized-arrays",
      "featureId": "data-sized-arrays",
      "manual": "docs/language/arrays-and-strings.md#data-sized-arrays",
      "valid": {
        "definition": "struct entry { uint8 kind; uint8 size; }; struct root { entry entries[]; uint16 values[EOF]; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "alignment": 2,
        "bytes": "010A02140000050006000700",
        "offsets": {
          "root.entries": 0,
          "root.values": 6
        },
        "values": {
          "root.entries[1].size": "20",
          "root.values[2]": "7"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "data-sized-array-of-dynamic-element",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "flags",
      "featureId": "flags",
      "manual": "docs/language/structs-unions-enums-typedefs.md#flags",
      "valid": {
        "definition": "flag access : uint16 { READ, WRITE, EXEC, HIDDEN = 0x100 }; struct root { access mode; uint8 tail; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 3,
        "alignment": 2,
        "bytes": "050107",
        "offsets": {
          "root.mode": 0,
          "root.tail": 2
        },
        "values": {
          "root.mode": "READ|EXEC|HIDDEN",
          "root.tail": "7"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "anonymous-flag-expression-member",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "enum-bitfields",
      "featureId": "enum-bitfields",
      "manual": "docs/language/structs-unions-enums-typedefs.md#enums",
      "valid": {
        "definition": "enum kind : uint16 { NONE, CODE, DATA, CONST }; struct root { kind type : 2; kind name_type : 3; uint16 rest : 11; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 2,
        "bytes": "AE5A",
        "offsets": {
          "root.type": 0,
          "root.name_type": 0,
          "root.rest": 0
        },
        "values": {
          "root.type.name": "DATA",
          "root.type.value": "2",
          "root.name_type.name": "CONST",
          "root.name_type.value": "3",
          "root.rest": "725"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "zero-width-bitfield",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "expression-extensions",
      "featureId": "expression-extensions",
      "manual": "docs/language/expressions-defines-and-variables.md#operators-and-precedence",
      "valid": {
        "definition": "enum kind : uint8 { A = 1, B = 6 ^ 3 }; struct head { uint32 a; uint16 b; }; struct root { uint8 x[kind.B % 4]; uint8 y[sizeof(head) ? offsetof(head, b) : 9]; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 5,
        "alignment": 1,
        "bytes": "0102030405",
        "offsets": {
          "root.x": 0,
          "root.y": 1
        },
        "values": {
          "root.x[0]": "1",
          "root.y[3]": "5"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "sizeof-of-dynamic-type",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "wide-primitives",
      "featureId": "wide-primitives",
      "manual": "docs/language/primitive-types.md#fixed-primitives",
      "valid": {
        "definition": "struct root { uint48 a; float16 b; void *p; };",
        "root": "root",
        "pointerSize": 4,
        "aligned": false,
        "littleEndian": true,
        "size": 12,
        "alignment": 4,
        "bytes": "010203040506003C08000000",
        "offsets": {
          "root.a": 0,
          "root.b": 6,
          "root.p": 8
        },
        "values": {
          "root.a": "6618611909121",
          "root.b": "1"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "void-value-field",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "bitfield-allocation",
      "featureId": "bitfield-allocation",
      "manual": "docs/language/bitfields.md#allocating-from-the-high-bit",
      "valid": {
        "definition": "struct root { uint16 a : 4; uint16 b : 12; uint8 c : 3; uint8 d : 5; };",
        "root": "root",
        "pointerSize": 8,
        "aligned": false,
        "littleEndian": false,
        "size": 3,
        "alignment": 2,
        "bytes": "123426",
        "offsets": {
          "root.a": 0,
          "root.b": 0,
          "root.c": 2,
          "root.d": 2
        },
        "values": {
          "root.a": "1",
          "root.b": "564",
          "root.c": "1",
          "root.d": "6"
        },
        "compilation": {
          "bitfieldAllocation": "HighBitFirst"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "zero-width-bitfield",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "c-long-width",
      "featureId": "c-long-width",
      "manual": "docs/language/primitive-types.md#alias-spellings",
      "valid": {
        "definition": "struct root { long a; unsigned long b; uint8 tail; };",
        "root": "root",
        "pointerSize": 8,
        "aligned": false,
        "littleEndian": true,
        "size": 9,
        "alignment": 4,
        "bytes": "FFFFFFFF0200000007",
        "offsets": {
          "root.a": 0,
          "root.b": 4,
          "root.tail": 8
        },
        "values": {
          "root.a": "-1",
          "root.b": "2",
          "root.tail": "7"
        },
        "compilation": {
          "cLongWidth": 32
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "unrecognized-integer-spelling",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "default-enum-storage",
      "featureId": "default-enum-storage",
      "manual": "docs/language/structs-unions-enums-typedefs.md#enums",
      "valid": {
        "definition": "enum kind { NONE, DATA = 2 }; struct root { kind type; uint8 tail; };",
        "root": "root",
        "pointerSize": 8,
        "aligned": false,
        "littleEndian": true,
        "size": 2,
        "alignment": 1,
        "bytes": "0207",
        "offsets": {
          "root.type": 0,
          "root.tail": 1
        },
        "values": {
          "root.type.name": "DATA",
          "root.type.value": "2",
          "root.tail": "7"
        },
        "compilation": {
          "defaultEnumStorage": "uint8"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "enum-value-outside-storage",
        "errorCode": "InvalidLayout"
      }
    },
    {
      "id": "nested-references",
      "featureId": "nested-references",
      "manual": "docs/language/expressions-defines-and-variables.md#a-nested-fields-value",
      "valid": {
        "definition": "struct h { uint8 n; uint8 pad; }; struct root { h hdr; uint8 v[hdr.n]; uint8 tail; };",
        "root": "root",
        "pointerSize": 8,
        "aligned": false,
        "littleEndian": true,
        "size": null,
        "alignment": 1,
        "bytes": "0200070809",
        "offsets": {
          "root.hdr.n": 0,
          "root.v": 2,
          "root.tail": 4
        },
        "values": {
          "root.hdr.n": "2",
          "root.tail": "9"
        }
      },
      "invalid": {
        "stage": "compile",
        "unsupportedId": "indexed-nested-reference",
        "errorCode": "InvalidLayout"
      }
    }
  ]
}
