Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <[email protected]>
  • Loading branch information
nojb committed Jul 11, 2019
1 parent f5db143 commit 5f9a111
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
21 changes: 5 additions & 16 deletions src/dialect.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
6 changes: 2 additions & 4 deletions src/dialect.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5f9a111

Please sign in to comment.