diff --git a/main.ml b/main.ml
@@ -34,19 +34,20 @@ let parse_regs (regs : string list) : (int * int) list * int list =
usage ();
exit 1
and f reg (acc_vals, acc_prints) =
- if not (String.starts_with ~prefix:"-R" reg) then fail reg
- else let reg' = String.sub reg 2 (String.length reg - 2) in
- match String.split_on_char '=' reg' with
- | [reg_n] ->
- (match int_of_string_opt reg_n with
- | Some reg_n -> (acc_vals, reg_n :: acc_prints)
- | None -> fail reg)
- | [ reg_n ; reg_val ] ->
- (match (int_of_string_opt reg_n, int_of_string_opt reg_val) with
- | (Some reg_n, Some reg_val) ->
+ if String.starts_with ~prefix:"-R" reg then
+ let reg' = String.sub reg 2 (String.length reg - 2) in
+ match String.split_on_char '=' reg' with
+ | [reg_n] ->
+ (match int_of_string_opt reg_n with
+ | Some reg_n -> (acc_vals, reg_n :: acc_prints)
+ | None -> fail reg)
+ | [ reg_n ; reg_val ] ->
+ (match (int_of_string_opt reg_n, int_of_string_opt reg_val) with
+ | (Some reg_n, Some reg_val) ->
((reg_n, reg_val) :: acc_vals, acc_prints)
- | _ -> fail reg)
- | _ -> fail reg
+ | _ -> fail reg)
+ | _ -> fail reg
+ else fail reg
in List.fold_right f regs ([], [])
(** Parses the [-i] command line argument *)