1use simple_yaml_parser::parse as parse_yaml;
2
3fn main() {
4 let example = r#"
5person:
6 name: John Doe
7 description: |
8 something here
9 that spans multiple lines
10 age: 30
11 something:
12 x: true
13 address:
14 street: 123 Main St
15 city: Example City
16places:
17 list: ["something", "here"]
18 inner:
19 x: string
20"#
21 .trim_start();
22
23 let source = if let Some(path) = std::env::args().nth(1) {
24 std::fs::read_to_string(path).unwrap()
25 } else {
26 example.to_owned()
27 };
28
29 parse_yaml(&source, |keys, value| {
37 eprintln!("{keys:?} -> {value:?}");
38 })
39 .unwrap();
40}