blob: 2df24bd10722443c25a6fa24b1a5cf9829a3b25c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
module TomlReader = Read_conf.Make (Helpers.Toml.Decode)
let t_of_toml : Otoml.t -> (ImporterSyntax.t, string) result =
fun toml ->
let version =
Otoml.find_or ~default:ImporterSyntax.latest_version toml
(Otoml.get_integer ~strict:false)
[ "version" ]
in
match version with
| n when n = ImporterSyntax.latest_version -> TomlReader.read toml
| _ ->
Printf.eprintf "Unsuported version : %d\n" version;
exit 1
let expression_from_string s =
Read_conf.ExpressionParser.of_string Read_conf.ExpressionParser.path s
|