let rec save formatter = function
| String s -> fprintf formatter "%s" (safe_string s)
| Int i -> fprintf formatter "%d" i
| Float f -> fprintf formatter "%g" f
| List l ->
fprintf formatter "[@[<b0>";
list_iter_between
(fun v -> fprintf formatter "@[<b2>"; save formatter v; fprintf formatter "@]")
(fun () -> fprintf formatter ";@ ")
l;
fprintf formatter "@]]"
| Tuple l ->
fprintf formatter "(@[<b0>";
list_iter_between
(fun v -> fprintf formatter "@[<b2>"; save formatter v; fprintf formatter "@]")
(fun () -> fprintf formatter ",@ ")
l;
fprintf formatter "@])"
| Section l ->
fprintf formatter "{@;<0 2>@[<hv0>";
list_iter_between
(fun (name,value) ->
fprintf formatter "@[<hov2>%s =@ @[<b2>" name;
save formatter value;
fprintf formatter "@]@]";)
(fun () -> fprintf formatter "@;<2 0>")
l;
fprintf formatter "@]}"