History

Better diagnostic messages

malc committed 6 years ago

Commit 9665c231 parent 89f5bd81 file · +3 −2Browse files

Unified · Split

config.ml+3−2
@@ -712,14 +712,15 @@ let keys_of_string s = · 711 unmodified lines
712 712
713let validatehcs v =713let validatehcs v =
714 let l = String.length v in714 let l = String.length v in
715 if l < 2 then failwith "set is too small, must be greater than one char";715 if l < 2
716 then error "set must contain more than one char, but has %d" l;
716 let module S = Set.Make (struct type t = char let compare = compare end) in717 let module S = Set.Make (struct type t = char let compare = compare end) in
717 let rec check s i =718 let rec check s i =
718 if i < l719 if i < l
719 then720 then
720 let e = String.get v i in721 let e = String.get v i in
721 if S.mem e s722 if S.mem e s
722 then failwith "has duplicates"723 then error "set has duplicates (at least '%c')" e
723 else check (S.add e s) (i+1)724 else check (S.add e s) (i+1)
724 in725 in
725 check (S.singleton (String.get v 0)) 1726 check (S.singleton (String.get v 0)) 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t