Structured Values
Structured values are used to represent complex data structures in a hierarchical manner. They are Accelerate's counterpart to JSON or YAML, enhanced with the ability to include expressions and bodies of code.
They are used in user written configuration files like definitions for CPUs and targets, as well as internal files like libraries.
Each type of structured value begins with a specific character, allowing for easy identification of the type of value being represented.
Scalar
Scalar values are single tokens or a list of tokens. They begin with :.
Array
Arrays begin with [, followed by a list of elements, each on its own line, and end with ]. The elements begin with their own structured value type character, allowing for nested structures.
Elements can be any structured value.
Dictionary
Dictionaries begin with {, followed by a list of key-value pairs, each on its own line, and end with }. Keys and values are separated by whitespace. Keys are tokens, and values can be any structured value.
Body
Bodies begin with <, followed by the body content, and end with >. The body content uses the same syntax as a body in an object. Depending on the context, the availability of directives may vary.
Example
This provides a hypothetical example of a structured value representing an object.