Skip to content

Commit

Permalink
Use assert false for impossible cases.
Browse files Browse the repository at this point in the history
Co-authored-by: Damien Doligez <[email protected]>
Signed-off-by: Karolis Petrauskas <[email protected]>
  • Loading branch information
kape1395 and damiendoligez committed Jun 8, 2024
1 parent 8b8ce33 commit 933a762
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lsp/lib/prover/toolbox.ml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ let match_line line =
let re = Re2.create_exn {|^@!!([a-z]*):(.*)$|} in
match Re2.find_submatches re line with
| Ok [| _all_match; Some k; Some v |] -> Some (k, v)
| Ok _ -> failwith "impossible"
| Ok _ -> assert false
| Error _ -> None

let rec guess_notif_loc' str = function
Expand All @@ -145,7 +145,7 @@ let rec guess_notif_loc' str = function
~cf:(int_of_string char_from) ~lt:(int_of_string line_till)
~ct:(int_of_string char_till),
String.trim rest_msg )
| Ok _ -> failwith "impossible"
| Ok _ -> assert false
| Error _ -> guess_notif_loc' str others)
| `B :: others -> (
let re_opts = { Re2.Options.default with dot_nl = true } in
Expand Down Expand Up @@ -183,7 +183,7 @@ let rec guess_notif_loc' str = function
~lt:(int_of_string line)
~ct:(int_of_string char + 4),
String.trim rest_msg )
| Ok _ -> failwith "impossible"
| Ok _ -> assert false
| Error _ -> guess_notif_loc' str others)

let guess_notif_loc str = guess_notif_loc' str [ `A; `B; `C ]
Expand Down

0 comments on commit 933a762

Please sign in to comment.