TOML 1.1 codecs for OCaml

dead code

-52
-52
lib/tomlt.ml
··· 434 434 enc = (fun i -> Toml.String (Int64.to_string i)); 435 435 } 436 436 437 - (* ---- Internal datetime codecs (for structured datetime types) ---- *) 438 - (* These are used internally but not exposed in the mli - only ptime codecs are public *) 439 - 440 - let datetime_ = { 441 - kind = "datetime"; 442 - doc = ""; 443 - dec = (function 444 - | Toml.Datetime s -> 445 - Result.map_error (fun msg -> Value_error msg) (Datetime.of_string s) 446 - | v -> type_error ~expected:"datetime" v); 447 - enc = (fun dt -> Toml.Datetime (Datetime.to_string dt)); 448 - } 449 - 450 - let datetime_local_ = { 451 - kind = "datetime-local"; 452 - doc = ""; 453 - dec = (function 454 - | Toml.Datetime_local s -> 455 - Result.map_error (fun msg -> Value_error msg) (Datetime_local.of_string s) 456 - | v -> type_error ~expected:"datetime-local" v); 457 - enc = (fun dt -> Toml.Datetime_local (Datetime_local.to_string dt)); 458 - } 459 - 460 - let date_local_ = { 461 - kind = "date-local"; 462 - doc = ""; 463 - dec = (function 464 - | Toml.Date_local s -> 465 - Result.map_error (fun msg -> Value_error msg) (Date.of_string s) 466 - | v -> type_error ~expected:"date-local" v); 467 - enc = (fun d -> Toml.Date_local (Date.to_string d)); 468 - } 469 - 470 - let time_local_ = { 471 - kind = "time-local"; 472 - doc = ""; 473 - dec = (function 474 - | Toml.Time_local s -> 475 - Result.map_error (fun msg -> Value_error msg) (Time.of_string s) 476 - | v -> type_error ~expected:"time-local" v); 477 - enc = (fun t -> Toml.Time_local (Time.to_string t)); 478 - } 479 - 480 - (* Silence unused warnings for internal codecs *) 481 - let _ = datetime_ 482 - let _ = datetime_local_ 483 - let _ = date_local_ 484 - let _ = time_local_ 485 - 486 437 (* ---- Ptime codecs ---- *) 487 438 488 439 (* Helper to get current timezone offset from explicit value or function *) ··· 1297 1248 | None -> failwith "any: enc not provided"); 1298 1249 } 1299 1250 1300 - (* ---- Encoding and decoding ---- *) 1301 - 1302 1251 let to_tomlt_error e = 1303 1252 Toml.Error.make (Toml.Error.Semantic (Toml.Error.Duplicate_key (codec_error_to_string e))) 1304 1253 ··· 1311 1260 1312 1261 let encode c v = c.enc v 1313 1262 1314 - (* Re-export the Toml module for accessing raw TOML values *) 1315 1263 module Toml = Toml 1316 1264 module Error = Toml.Error