Skip to content

Commit

Permalink
Generalize forcable flag module and constructors names
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Barbin <[email protected]>
  • Loading branch information
mbarbin committed Jul 15, 2024
1 parent 022c671 commit bed8100
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/deriving.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ let () =
(Symbol
( [ "true"; "false"; "force" ],
function
| "true" -> allow_unused_code_warnings := Enabled
| "false" -> allow_unused_code_warnings := Disabled
| "true" -> allow_unused_code_warnings := True
| "false" -> allow_unused_code_warnings := False
| "force" -> allow_unused_code_warnings := Force
| _ -> assert false ))
~doc:" Allow ppx derivers to enable unused code warnings (default: false)"

let allow_unused_code_warnings ~ppx_allows_unused_code_warnings =
match !allow_unused_code_warnings with
| Force -> true
| Disabled -> false
| Enabled -> ppx_allows_unused_code_warnings
| False -> false
| True -> ppx_allows_unused_code_warnings

let allow_unused_type_warnings = ref Options.default_allow_unused_type_warnings

Expand Down
6 changes: 3 additions & 3 deletions src/options.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Allow_unused_code_warnings = struct
type t = Enabled | Disabled | Force
module Forcable_bool = struct
type t = True | False | Force
end

let default_allow_unused_code_warnings : Allow_unused_code_warnings.t = Disabled
let default_allow_unused_code_warnings : Forcable_bool.t = False
let default_allow_unused_type_warnings = false
let perform_checks = false

Expand Down

0 comments on commit bed8100

Please sign in to comment.