@@ -108,20 +108,21 @@ let transform_cases ~loc e cases =
108
108
if case.pc_guard <> None then
109
109
error ~loc " Guards are not implemented for match%pcre." else
110
110
(match case.pc_lhs with
111
- | {ppat_desc = Ppat_constant (Const_string (re_src ,_ )); ppat_loc = loc } ->
111
+ | { ppat_desc = Ppat_constant (Const_string (re_src,_));
112
+ ppat_loc = loc; _} ->
112
113
let re_str, bs, nG = extract_bindings ~loc re_src in
113
114
(try ignore (Re_pcre. regexp re_str) with
114
115
| Re_perl. Not_supported -> error ~loc " Unsupported regular expression."
115
116
| Re_perl. Parse_error -> error ~loc " Invalid regular expression." );
116
117
(Exp. constant (Const_string (re_str, None )), nG, bs, case.pc_rhs)
117
- | {ppat_desc = Ppat_any } ->
118
+ | {ppat_desc = Ppat_any ; _ } ->
118
119
error ~loc " Universal wildcard must be the last pattern."
119
- | {ppat_loc = loc } ->
120
+ | {ppat_loc = loc ; _ } ->
120
121
error ~loc " Regular expression pattern should be a string." )
121
122
in
122
123
let cases, default_rhs =
123
124
(match List. rev cases with
124
- | {pc_lhs = {ppat_desc = Ppat_any } ; pc_rhs} :: cases ->
125
+ | {pc_lhs = {ppat_desc = Ppat_any ; _ } ; pc_rhs; _ } :: cases ->
125
126
(cases, pc_rhs)
126
127
| cases ->
127
128
let open Lexing in
@@ -175,7 +176,8 @@ let transform_cases ~loc e cases =
175
176
176
177
let rewrite_expr mapper e_ext =
177
178
(match e_ext.pexp_desc with
178
- | Pexp_extension ({txt = "pcre" } , PStr [{pstr_desc = Pstr_eval (e , _ )} ]) ->
179
+ | Pexp_extension ({txt = " pcre" ; _},
180
+ PStr [{pstr_desc = Pstr_eval (e, _); _}]) ->
179
181
let loc = e.pexp_loc in
180
182
(match e.pexp_desc with
181
183
| Pexp_match (e , cases ) ->
@@ -186,7 +188,7 @@ let rewrite_expr mapper e_ext =
186
188
error ~loc " [%pcre] only applies to match an function." )
187
189
| _ -> default_mapper.expr mapper e_ext)
188
190
189
- let rewrite_structure mapper sis =
191
+ let rewrite_structure _mapper sis =
190
192
let sis' =
191
193
default_mapper.structure {default_mapper with expr = rewrite_expr} sis
192
194
in
0 commit comments