Signature
DValue yaml_decode(String s)
Parameters
Parses a practical YAML subset into a DValue.
yaml_decode() is designed for concise UCE config files. It supports a practical YAML subset and does not implement anchors, aliases, tags, directives, or complex inline collection syntax.
Try the live example in the YAML demo.
Example:
Supported syntax:
indentation-based maps
indentation-based lists
key: valuemap entrieslist entries with
- valuequoted strings with single or double quotes
booleans
trueandfalseempty/null-ish values as empty strings
comments beginning with
#outside quoted stringsliteral block strings with
|folded block strings with
>optional
---and...document markers
Numeric-looking values are stored as strings, matching json_decode()'s current behavior. Use to_s64(), to_u64(), or to_f64() when reading numeric config values.
Malformed input raises a request-visible yaml_decode(): ... runtime error.
Example
DValue value = yaml_decode("name: Ada\n");
print(value["name"].to_string(), "\n");
Ada