From 5f9a1114e9cfa0629c4925b5e8243ccb83e7c4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= Date: Thu, 11 Jul 2019 08:28:57 +0200 Subject: [PATCH] Cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolás Ojeda Bär --- src/dialect.ml | 21 +++++---------------- src/dialect.mli | 6 ++---- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/dialect.ml b/src/dialect.ml index 1b3e517d384..2bcfd8187a7 100644 --- a/src/dialect.ml +++ b/src/dialect.ml @@ -57,22 +57,6 @@ let preprocess { file_kinds = { Ml_kind.Dict.intf ; impl } ; _ } = function | Ml_kind.Intf -> intf.preprocess | Impl -> impl.preprocess -let ml_suffix { file_kinds = { Ml_kind.Dict.intf ; impl } ; _ } ml_kind = - match intf.extension, impl.extension, ml_kind with - | ".mli", _, Ml_kind.Intf | _, ".ml", Impl -> None - | _, _, Intf -> Some ".mli" - | _, _, Impl -> Some ".ml" - -module Key = struct - type nonrec t = t - let compare t1 t2 = String.compare t1.name t2.name - let to_dyn = to_dyn -end - -module Map = Map.Make (Key) - -module Set = Set.Make (Key) (Map) - let ocaml = let file_kind kind extension = { File_kind. @@ -115,3 +99,8 @@ let reason = { name = "reason" ; file_kinds = Ml_kind.Dict.make ~intf ~impl } + +let ml_suffix dialect ml_kind = + match dialect.name with + | "ocaml" -> None + | _ -> Some (extension ocaml ml_kind) diff --git a/src/dialect.mli b/src/dialect.mli index 252e8efd762..1c15a836e56 100644 --- a/src/dialect.mli +++ b/src/dialect.mli @@ -18,10 +18,8 @@ val extension : t -> Ml_kind.t -> string val preprocess : t -> Ml_kind.t -> Filter.t -val ml_suffix : t -> Ml_kind.t -> string option - -module Set : Set.S with type elt = t - val ocaml : t val reason : t + +val ml_suffix : t -> Ml_kind.t -> string option