Skip to content

Commit 2089561

Browse files
committed
snapshot changes
1 parent 5fcc3de commit 2089561

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/4.02.3/bsb_helper.ml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,17 +1555,19 @@ let parse_exn (speclist : t) anonfun errmsg =
15551555
incr current;
15561556
| Int f when !current + 1 < l ->
15571557
let arg = argv.(!current + 1) in
1558-
begin try f (int_of_string arg)
1559-
with Failure "int_of_string" ->
1560-
raise (Stop (Wrong (s, arg, "an integer")))
1558+
begin match int_of_string arg with
1559+
| i -> f i
1560+
| exception _
1561+
->
1562+
raise (Stop (Wrong (s, arg, "an integer")))
15611563
end;
15621564
incr current;
15631565
| Set_int r when !current + 1 < l ->
15641566
let arg = argv.(!current + 1) in
1565-
begin try r := (int_of_string arg)
1566-
with Failure "int_of_string" ->
1567-
raise (Stop (Wrong (s, arg, "an integer")))
1568-
end;
1567+
r := (try int_of_string arg
1568+
with _ ->
1569+
raise (Stop (Wrong (s, arg, "an integer")))
1570+
);
15691571
incr current;
15701572
| _ -> raise (Stop (Missing s))
15711573
in

0 commit comments

Comments
 (0)