diff options
Diffstat (limited to 'lib/configuration/importConf.ml')
-rw-r--r-- | lib/configuration/importConf.ml | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/configuration/importConf.ml b/lib/configuration/importConf.ml index aa0e2f3..47f4ea4 100644 --- a/lib/configuration/importConf.ml +++ b/lib/configuration/importConf.ml @@ -7,34 +7,12 @@ module Expression = ImportExpression.T external set_locale : string -> unit = "set_locale" -let current_syntax = 1 - -let t_of_yojson : Yojson.Safe.t -> Syntax.t = - fun json -> - let keys = Yojson.Safe.Util.keys json in - let version = - match List.find_opt keys ~f:(String.equal "version") with - | None -> - Printf.printf - "No version given. Your setup may break in the future.\n\ - Please add « \"version\":%d » in your configuration.\n\n" - current_syntax; - `Int 1 - | Some _ -> Yojson.Safe.Util.member "version" json - in - - match version with - | `Int 1 -> Of_json.t_of_yojson json - | other -> - Printf.eprintf "Unsuported version : %s\n" (Yojson.Safe.to_string other); - exit 1 +let latest_version = 1 module TomlReader = Read_conf.Make (Helpers.Toml.Decode) let t_of_toml : Otoml.t -> (Syntax.t, string) result = fun toml -> - let latest_version = 1 in - let version = Otoml.find_or ~default:latest_version toml (Otoml.get_integer ~strict:false) @@ -57,7 +35,7 @@ let dummy_conf = Syntax. { source = { file = ""; tab = 0; name = "" }; - version = 1; + version = latest_version; locale = Some "C"; externals = []; columns = []; |