Skip to content

Commit

Permalink
Invert if clause in module name
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
  • Loading branch information
rgrinberg authored and voodoos committed Aug 5, 2020
1 parent 058d7c1 commit 1a307bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dune/module_name.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ include Stringlike.Make (struct
(fun name ->
String.to_seq name
|> Seq.filter_map ~f:(fun c ->
if not (valid_char c) then
if valid_char c then
Some c
else
match c with
| '.'
| '-' ->
Some '_'
| _ -> None
else
Some c)
)
|> String.of_seq)

let is_valid_module_name name =
Expand Down

0 comments on commit 1a307bf

Please sign in to comment.