Korml v0 Examples¶
v0 examples are complete source files. They do not start with a version directive and they do not use document boundary markers.
First document¶
This represents a mapping with three scalar keys and three scalar values.
At the language level, all three values are text.
A later schema or decoder may interpret true as a boolean and 3 as an integer.
Nested mappings¶
The value of runtime is a nested mapping.
Sequences¶
Each sequence item is a scalar value.
Sequences of mappings¶
This is useful for structured lists.
Flow style¶
Flow style is useful for compact values. Block style is usually better for larger documents.
Comments¶
Comments are not part of the document model, but they are preserved by the concrete syntax tree.
Block scalars¶
A block scalar is still a scalar value in the document model.
Invalid v0 stream syntax¶
v0 has no stream wrapper, so this is not v0:
Use v1 for versioned streams and multiple documents.