| { |
| "name": "test.constants", |
| "library_dependencies": [], |
| "bits_declarations": [ |
| { |
| "name": "test.constants/Bits", |
| "naming_context": [ |
| "Bits" |
| ], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 38, |
| "column": 6, |
| "length": 4 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "mask": "8", |
| "members": [ |
| { |
| "name": "B", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 39, |
| "column": 5, |
| "length": 1 |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "8", |
| "expression": "0x8", |
| "literal": { |
| "kind": "numeric", |
| "value": "8", |
| "expression": "0x8" |
| } |
| } |
| } |
| ], |
| "strict": true |
| }, |
| { |
| "name": "test.constants/BitsType", |
| "naming_context": [ |
| "BitsType" |
| ], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 23, |
| "column": 6, |
| "length": 8 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "mask": "7", |
| "members": [ |
| { |
| "name": "VALUE", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 24, |
| "column": 5, |
| "length": 5 |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "1", |
| "expression": "0x00000001", |
| "literal": { |
| "kind": "numeric", |
| "value": "1", |
| "expression": "0x00000001" |
| } |
| } |
| }, |
| { |
| "name": "SECOND_VALUE", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 25, |
| "column": 5, |
| "length": 12 |
| }, |
| "value": { |
| "kind": "identifier", |
| "value": "4", |
| "expression": "UINT32", |
| "identifier": "test.constants/UINT32" |
| } |
| }, |
| { |
| "name": "THIRD_VALUE", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 26, |
| "column": 5, |
| "length": 11 |
| }, |
| "value": { |
| "kind": "binary_operator", |
| "value": "2", |
| "expression": "0x2 | 0" |
| } |
| } |
| ], |
| "strict": true |
| } |
| ], |
| "const_declarations": [ |
| { |
| "name": "test.constants/BOOL", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 13, |
| "column": 7, |
| "length": 4 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "bool", |
| "type_shape_v1": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "true", |
| "expression": "true", |
| "literal": { |
| "kind": "bool", |
| "value": "true", |
| "expression": "true" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/FLOAT32", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 11, |
| "column": 7, |
| "length": 7 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "float32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "3.14159", |
| "expression": "3.14159", |
| "literal": { |
| "kind": "numeric", |
| "value": "3.14159", |
| "expression": "3.14159" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/FLOAT64", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 12, |
| "column": 7, |
| "length": 7 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "float64", |
| "type_shape_v1": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "3.14159", |
| "expression": "3.14159", |
| "literal": { |
| "kind": "numeric", |
| "value": "3.14159", |
| "expression": "3.14159" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/INT16", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 8, |
| "column": 7, |
| "length": 5 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "int16", |
| "type_shape_v1": { |
| "inline_size": 2, |
| "alignment": 2, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 2, |
| "alignment": 2, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/INT32", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 9, |
| "column": 7, |
| "length": 5 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "int32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/INT64", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 10, |
| "column": 7, |
| "length": 5 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "int64", |
| "type_shape_v1": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/INT8", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 7, |
| "column": 7, |
| "length": 4 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "int8", |
| "type_shape_v1": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/STRING", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 14, |
| "column": 7, |
| "length": 6 |
| }, |
| "type": { |
| "kind": "string", |
| "nullable": false, |
| "type_shape_v1": { |
| "inline_size": 16, |
| "alignment": 8, |
| "depth": 1, |
| "max_handles": 0, |
| "max_out_of_line": 4294967295, |
| "has_padding": true, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 16, |
| "alignment": 8, |
| "depth": 1, |
| "max_handles": 0, |
| "max_out_of_line": 4294967295, |
| "has_padding": true, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "string", |
| "expression": "\"string\"", |
| "literal": { |
| "kind": "string", |
| "value": "string", |
| "expression": "\"string\"" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/UINT16", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 4, |
| "column": 7, |
| "length": 6 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint16", |
| "type_shape_v1": { |
| "inline_size": 2, |
| "alignment": 2, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 2, |
| "alignment": 2, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/UINT32", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 5, |
| "column": 7, |
| "length": 6 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/UINT64", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 6, |
| "column": 7, |
| "length": 6 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint64", |
| "type_shape_v1": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/UINT8", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 3, |
| "column": 7, |
| "length": 5 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint8", |
| "type_shape_v1": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "4", |
| "expression": "0b100", |
| "literal": { |
| "kind": "numeric", |
| "value": "4", |
| "expression": "0b100" |
| } |
| } |
| }, |
| { |
| "name": "test.constants/bitsPrimitiveVal", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 29, |
| "column": 7, |
| "length": 16 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "identifier", |
| "value": "1", |
| "expression": "BitsType.VALUE", |
| "identifier": "test.constants/BitsType.VALUE" |
| } |
| }, |
| { |
| "name": "test.constants/bitsVal", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 28, |
| "column": 7, |
| "length": 7 |
| }, |
| "type": { |
| "kind": "identifier", |
| "identifier": "test.constants/BitsType", |
| "nullable": false, |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "identifier", |
| "value": "1", |
| "expression": "BitsType.VALUE", |
| "identifier": "test.constants/BitsType.VALUE" |
| } |
| }, |
| { |
| "name": "test.constants/enumPrimitiveVal", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 21, |
| "column": 7, |
| "length": 16 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "int32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "identifier", |
| "value": "3", |
| "expression": "EnumType.VALUE", |
| "identifier": "test.constants/EnumType.VALUE" |
| } |
| }, |
| { |
| "name": "test.constants/enumVal", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 20, |
| "column": 7, |
| "length": 7 |
| }, |
| "type": { |
| "kind": "identifier", |
| "identifier": "test.constants/EnumType", |
| "nullable": false, |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "identifier", |
| "value": "3", |
| "expression": "EnumType.VALUE", |
| "identifier": "test.constants/EnumType.VALUE" |
| } |
| }, |
| { |
| "name": "test.constants/orResult", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 31, |
| "column": 7, |
| "length": 8 |
| }, |
| "type": { |
| "kind": "identifier", |
| "identifier": "test.constants/BitsType", |
| "nullable": false, |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "binary_operator", |
| "value": "7", |
| "expression": "BitsType.VALUE | BitsType.SECOND_VALUE | BitsType.THIRD_VALUE" |
| } |
| }, |
| { |
| "name": "test.constants/orResultPrimitiveVal", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 32, |
| "column": 7, |
| "length": 20 |
| }, |
| "type": { |
| "kind": "primitive", |
| "subtype": "uint32", |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "value": { |
| "kind": "binary_operator", |
| "value": "5", |
| "expression": "BitsType.VALUE | BitsType.SECOND_VALUE" |
| } |
| } |
| ], |
| "enum_declarations": [ |
| { |
| "name": "test.constants/Enum", |
| "naming_context": [ |
| "Enum" |
| ], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 34, |
| "column": 6, |
| "length": 4 |
| }, |
| "type": "uint32", |
| "members": [ |
| { |
| "name": "E", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 35, |
| "column": 5, |
| "length": 1 |
| }, |
| "value": { |
| "kind": "literal", |
| "value": "170", |
| "expression": "0b10101010", |
| "literal": { |
| "kind": "numeric", |
| "value": "170", |
| "expression": "0b10101010" |
| } |
| } |
| } |
| ], |
| "strict": true |
| }, |
| { |
| "name": "test.constants/EnumType", |
| "naming_context": [ |
| "EnumType" |
| ], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 16, |
| "column": 6, |
| "length": 8 |
| }, |
| "type": "int32", |
| "members": [ |
| { |
| "name": "VALUE", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 17, |
| "column": 5, |
| "length": 5 |
| }, |
| "value": { |
| "kind": "binary_operator", |
| "value": "3", |
| "expression": "1 | 2" |
| } |
| }, |
| { |
| "name": "SECOND_VALUE", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 18, |
| "column": 5, |
| "length": 12 |
| }, |
| "value": { |
| "kind": "identifier", |
| "value": "4", |
| "expression": "UINT32", |
| "identifier": "test.constants/UINT32" |
| } |
| } |
| ], |
| "strict": true |
| } |
| ], |
| "experimental_resource_declarations": [], |
| "protocol_declarations": [], |
| "service_declarations": [], |
| "struct_declarations": [ |
| { |
| "name": "test.constants/Struct", |
| "naming_context": [ |
| "Struct" |
| ], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 42, |
| "column": 6, |
| "length": 6 |
| }, |
| "members": [ |
| { |
| "type": { |
| "kind": "primitive", |
| "subtype": "int64", |
| "type_shape_v1": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 8, |
| "alignment": 8, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "name": "int64_with_default", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 44, |
| "column": 5, |
| "length": 18 |
| }, |
| "maybe_attributes": [ |
| { |
| "name": "allow_deprecated_struct_defaults", |
| "arguments": [], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 43, |
| "column": 5, |
| "length": 33 |
| } |
| } |
| ], |
| "maybe_default_value": { |
| "kind": "literal", |
| "value": "7", |
| "expression": "007", |
| "literal": { |
| "kind": "numeric", |
| "value": "7", |
| "expression": "007" |
| } |
| }, |
| "field_shape_v1": { |
| "offset": 0, |
| "padding": 0 |
| }, |
| "field_shape_v2": { |
| "offset": 0, |
| "padding": 0 |
| } |
| }, |
| { |
| "type": { |
| "kind": "string", |
| "nullable": false, |
| "type_shape_v1": { |
| "inline_size": 16, |
| "alignment": 8, |
| "depth": 1, |
| "max_handles": 0, |
| "max_out_of_line": 4294967295, |
| "has_padding": true, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 16, |
| "alignment": 8, |
| "depth": 1, |
| "max_handles": 0, |
| "max_out_of_line": 4294967295, |
| "has_padding": true, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "name": "string_with_default", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 46, |
| "column": 5, |
| "length": 19 |
| }, |
| "maybe_attributes": [ |
| { |
| "name": "allow_deprecated_struct_defaults", |
| "arguments": [], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 45, |
| "column": 5, |
| "length": 33 |
| } |
| } |
| ], |
| "maybe_default_value": { |
| "kind": "literal", |
| "value": "stuff", |
| "expression": "\"stuff\"", |
| "literal": { |
| "kind": "string", |
| "value": "stuff", |
| "expression": "\"stuff\"" |
| } |
| }, |
| "field_shape_v1": { |
| "offset": 8, |
| "padding": 0 |
| }, |
| "field_shape_v2": { |
| "offset": 8, |
| "padding": 0 |
| } |
| }, |
| { |
| "type": { |
| "kind": "primitive", |
| "subtype": "bool", |
| "type_shape_v1": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 1, |
| "alignment": 1, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "name": "bool_with_default", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 48, |
| "column": 5, |
| "length": 17 |
| }, |
| "maybe_attributes": [ |
| { |
| "name": "allow_deprecated_struct_defaults", |
| "arguments": [], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 47, |
| "column": 5, |
| "length": 33 |
| } |
| } |
| ], |
| "maybe_default_value": { |
| "kind": "literal", |
| "value": "true", |
| "expression": "true", |
| "literal": { |
| "kind": "bool", |
| "value": "true", |
| "expression": "true" |
| } |
| }, |
| "field_shape_v1": { |
| "offset": 24, |
| "padding": 3 |
| }, |
| "field_shape_v2": { |
| "offset": 24, |
| "padding": 3 |
| } |
| }, |
| { |
| "type": { |
| "kind": "identifier", |
| "identifier": "test.constants/Enum", |
| "nullable": false, |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "name": "enum_with_default", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 50, |
| "column": 5, |
| "length": 17 |
| }, |
| "maybe_attributes": [ |
| { |
| "name": "allow_deprecated_struct_defaults", |
| "arguments": [], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 49, |
| "column": 5, |
| "length": 33 |
| } |
| } |
| ], |
| "maybe_default_value": { |
| "kind": "identifier", |
| "value": "170", |
| "expression": "Enum.E", |
| "identifier": "test.constants/Enum.E" |
| }, |
| "field_shape_v1": { |
| "offset": 28, |
| "padding": 0 |
| }, |
| "field_shape_v2": { |
| "offset": 28, |
| "padding": 0 |
| } |
| }, |
| { |
| "type": { |
| "kind": "identifier", |
| "identifier": "test.constants/Bits", |
| "nullable": false, |
| "type_shape_v1": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 4, |
| "alignment": 4, |
| "depth": 0, |
| "max_handles": 0, |
| "max_out_of_line": 0, |
| "has_padding": false, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| }, |
| "name": "bits_with_default", |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 52, |
| "column": 5, |
| "length": 17 |
| }, |
| "maybe_attributes": [ |
| { |
| "name": "allow_deprecated_struct_defaults", |
| "arguments": [], |
| "location": { |
| "filename": "../../tools/fidl/fidlc/testdata/constants.test.fidl", |
| "line": 51, |
| "column": 5, |
| "length": 33 |
| } |
| } |
| ], |
| "maybe_default_value": { |
| "kind": "identifier", |
| "value": "8", |
| "expression": "Bits.B", |
| "identifier": "test.constants/Bits.B" |
| }, |
| "field_shape_v1": { |
| "offset": 32, |
| "padding": 4 |
| }, |
| "field_shape_v2": { |
| "offset": 32, |
| "padding": 4 |
| } |
| } |
| ], |
| "resource": false, |
| "type_shape_v1": { |
| "inline_size": 40, |
| "alignment": 8, |
| "depth": 1, |
| "max_handles": 0, |
| "max_out_of_line": 4294967295, |
| "has_padding": true, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| }, |
| "type_shape_v2": { |
| "inline_size": 40, |
| "alignment": 8, |
| "depth": 1, |
| "max_handles": 0, |
| "max_out_of_line": 4294967295, |
| "has_padding": true, |
| "has_envelope": false, |
| "has_flexible_envelope": false |
| } |
| } |
| ], |
| "external_struct_declarations": [], |
| "table_declarations": [], |
| "union_declarations": [], |
| "type_alias_declarations": [], |
| "declaration_order": [ |
| "test.constants/UINT8", |
| "test.constants/UINT64", |
| "test.constants/UINT32", |
| "test.constants/EnumType", |
| "test.constants/enumVal", |
| "test.constants/enumPrimitiveVal", |
| "test.constants/BitsType", |
| "test.constants/orResultPrimitiveVal", |
| "test.constants/orResult", |
| "test.constants/bitsVal", |
| "test.constants/bitsPrimitiveVal", |
| "test.constants/UINT16", |
| "test.constants/STRING", |
| "test.constants/INT8", |
| "test.constants/INT64", |
| "test.constants/INT32", |
| "test.constants/INT16", |
| "test.constants/FLOAT64", |
| "test.constants/FLOAT32", |
| "test.constants/Enum", |
| "test.constants/Bits", |
| "test.constants/Struct", |
| "test.constants/BOOL" |
| ], |
| "declarations": { |
| "test.constants/Bits": "bits", |
| "test.constants/BitsType": "bits", |
| "test.constants/BOOL": "const", |
| "test.constants/FLOAT32": "const", |
| "test.constants/FLOAT64": "const", |
| "test.constants/INT16": "const", |
| "test.constants/INT32": "const", |
| "test.constants/INT64": "const", |
| "test.constants/INT8": "const", |
| "test.constants/STRING": "const", |
| "test.constants/UINT16": "const", |
| "test.constants/UINT32": "const", |
| "test.constants/UINT64": "const", |
| "test.constants/UINT8": "const", |
| "test.constants/bitsPrimitiveVal": "const", |
| "test.constants/bitsVal": "const", |
| "test.constants/enumPrimitiveVal": "const", |
| "test.constants/enumVal": "const", |
| "test.constants/orResult": "const", |
| "test.constants/orResultPrimitiveVal": "const", |
| "test.constants/Enum": "enum", |
| "test.constants/EnumType": "enum", |
| "test.constants/Struct": "struct" |
| } |
| } |