File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1555,17 +1555,19 @@ let parse_exn (speclist : t) anonfun errmsg =
1555
1555
incr current;
1556
1556
| Int f when ! current + 1 < l ->
1557
1557
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" )))
1561
1563
end ;
1562
1564
incr current;
1563
1565
| Set_int r when ! current + 1 < l ->
1564
1566
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
+ ) ;
1569
1571
incr current;
1570
1572
| _ -> raise (Stop (Missing s))
1571
1573
in
You can’t perform that action at this time.
0 commit comments