Skip to content

Commit

Permalink
Make empty disjunction fail instead of crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusf committed Nov 21, 2023
1 parent 54b1c46 commit dd2bf83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion parsing/search.ml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ let any : name:string -> to_s:('a -> string) -> 'a list -> ('a -> 'b t) -> 'b t
match vs with
| [] ->
(* Error (rule ~name "choice empty") *)
failwith (Format.asprintf "choice empty: %s" name)
(* failwith (Format.asprintf "choice empty: %s" name) *)
fail
| _ :: _ ->
let rec loop vs undone =
match (vs, undone) with
Expand Down

0 comments on commit dd2bf83

Please sign in to comment.