struct
type t = {
name: string;
sub_tree_arguments: (string * t) list;
string_arguments: (string * string) list;
json_arguments: (string * Yojson.Basic.json) list;
}
let rec to_yojson t : Yojson.Basic.json =
let fields =
List.concat [
List.map t.sub_tree_arguments ~f:(fun (k, v) -> k, to_yojson v);
List.map t.string_arguments ~f:(fun (k, v) -> k, `String v);
t.json_arguments;
]
in
`Assoc (("node-name", `String t.name) :: fields)
end