TOML 1.1 codecs for OCaml
at main 12 lines 403 B view raw
1(* TOML test decoder - reads TOML from stdin, outputs tagged JSON to stdout *) 2 3let () = 4 let input = In_channel.input_all In_channel.stdin in 5 match Tomlt_bytesrw.of_string input with 6 | Ok toml -> 7 let json = Tomlt_bytesrw.Tagged_json.encode toml in 8 print_string json; 9 print_newline () 10 | Error e -> 11 Printf.eprintf "Error: %s\n" (Tomlt.Toml.Error.to_string e); 12 exit 1