Skip to content

Commit

Permalink
refactor: remove dead code in OSL decoder (ocaml#7886)
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
  • Loading branch information
anmonteiro authored Jun 5, 2023
1 parent a2d22f8 commit bbe3d1f
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/dune_rules/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -539,20 +539,11 @@ module Library = struct
else
(* Old behavior: if old parser succeeds, return that. Otherwise, if
parsing the ordered set language succeeds, ask the user to upgrade to
a supported version. Otherwise, fail with the first error. *)
try_
(Mode_conf.Lib.Set.decode >>| fun modes -> `Modes modes)
(fun exn ->
try_
( Mode_conf.Lib.Set.decode_osl ~stanza_loc project >>| fun modes ->
if dune_version >= expected_version then `Modes modes
else `Upgrade )
(fun _ -> raise exn))
>>| function
| `Modes modes -> modes
| `Upgrade ->
Syntax.Error.since stanza_loc Stanza.syntax expected_version
~what:"Ordered set language for modes"
a supported version *)
try_ Mode_conf.Lib.Set.decode (fun _exn ->
Mode_conf.Lib.Set.decode_osl ~stanza_loc project >>| fun _modes ->
Syntax.Error.since stanza_loc Stanza.syntax expected_version
~what:"Ordered set language for modes")
end

type visibility =
Expand Down

0 comments on commit bbe3d1f

Please sign in to comment.