#include "ryml.hpp"
#include <iostream>

void parseYAMLFile(const char* path)
{

}

void show_keyval(ryml::NodeRef n)
{
    //assert(n.has_keyval());
    std::cout << n.key() << ": " << n.val() << "\n";
}
void show_val(ryml::NodeRef n)
{
    //assert(n.has_val());
    std::cout << n.val() << "\n";
}

void generateYAML()
{
    ryml::Tree tree = ryml::parse("{foo: 1, bar: [a: 2, b: 3]}");

    // get a reference to the "foo" node
    ryml::NodeRef node = tree["foo"];

    show_keyval(node);  // "foo: 1"
    show_val(node["bar"][0]);  // "2"
    show_val(node["bar"][1]);  // "3"

    // deserializing:
    int foo;
    node >> foo; // now foo == 1
}