yaml
YAML configuration parser. Load YAML files into key-value dictionaries, read typed values and emit YAML output.
Install
ppm install yaml
Usage Example
uses yaml;
// Load from file
var cfg := LoadFile('config.yaml');
// Read values
var host := Get(cfg, 'server.host');
var port := GetInt(cfg, 'server.port');
WriteLn('Connecting to ' + host + ':' + IntToStr(port));
// Parse from string
var doc := Parse('name: myapp' + #10 + 'version: 1.0.0');
WriteLn(Get(doc, 'name'));
// Write back to YAML
var out := Emit(cfg);
file_utils.WriteFile('config.bak.yaml', out);
Features
Key-value and nested structure parsing
Comment lines (#) are skipped
Integer, boolean and string values
File loading with LoadFile()
YAML emitter for writing configs