Skip to content

Commit

Permalink
Fix
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 2198021 commit 807d231
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/dialect.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let decode =
field name ~default:Filter.No_filter
(map ~f (located Action_dune_lang.decode))
in
let+ extension = field "extension" string
let+ extension = field "extension" (map ~f:(fun s -> "." ^ s) string)
and+ preprocess = filter "preprocess"
and+ format = filter "format"
in
Expand Down Expand Up @@ -90,8 +90,8 @@ let ocaml =
; format = Filter.No_filter
}
in
let intf = file_kind Ml_kind.Intf "mli" in
let impl = file_kind Ml_kind.Impl "ml" in
let intf = file_kind Ml_kind.Intf ".mli" in
let impl = file_kind Ml_kind.Impl ".ml" in
{ name = "ocaml"
; file_kinds = Ml_kind.Dict.make ~intf ~impl
}
Expand All @@ -118,8 +118,8 @@ let reason =
; format = Filter.Action (Loc.none, format)
}
in
let intf = file_kind Ml_kind.Intf "rei" in
let impl = file_kind Ml_kind.Impl "re" in
let intf = file_kind Ml_kind.Intf ".rei" in
let impl = file_kind Ml_kind.Impl ".re" in
{ name = "reason"
; file_kinds = Ml_kind.Dict.make ~intf ~impl
}
Expand Down
1 change: 0 additions & 1 deletion src/dialect.mli
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ val to_dyn : t -> Dyn.t
val decode : t Dune_lang.Decoder.t

val extension : t -> Ml_kind.t -> string
(* The corresponding extension *without* the leading '.' *)

val preprocess : t -> Ml_kind.t -> Filter.t

Expand Down
2 changes: 1 addition & 1 deletion src/dir_contents.ml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ let modules_of_files ~dialects ~dir ~files =
filenames such as foo.cppo.ml *)
match String.lsplit2 fn ~on:'.' with
| Some (s, ext) ->
begin match Dialect.S.find_by_extension dialects ext with
begin match Dialect.S.find_by_extension dialects ("." ^ ext) with
| Some (dialect, Ml_kind.Impl) -> Left (make_module dialect s fn)
| Some (dialect, Ml_kind.Intf) -> Right (make_module dialect s fn)
| None -> Skip
Expand Down
2 changes: 1 addition & 1 deletion src/module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Name = struct
Lib_name.Local.of_string_exn s

let basename n ~(ml_kind : Ml_kind.t) ~(dialect : Dialect.t) =
String.lowercase n ^ "." ^ Dialect.extension dialect ml_kind
String.lowercase n ^ Dialect.extension dialect ml_kind
end

module File = struct
Expand Down

0 comments on commit 807d231

Please sign in to comment.