@@ -235,12 +235,7 @@ and pattern : type k . _ -> _ -> k general_pattern -> unit = fun i ppf x ->
235
235
line i ppf " pattern %a\n " fmt_location x.pat_loc;
236
236
attributes i ppf x.pat_attributes;
237
237
let i = i+ 1 in
238
- begin match x.pat_extra with
239
- | [] -> ()
240
- | extra ->
241
- line i ppf " extra\n " ;
242
- List. iter (pattern_extra (i+ 1 ) ppf) extra;
243
- end ;
238
+ List. iter (pattern_extra i ppf) x.pat_extra;
244
239
match x.pat_desc with
245
240
| Tpat_any -> line i ppf " Tpat_any\n " ;
246
241
| Tpat_var (s ,_ ,_ ) -> line i ppf " Tpat_var \" %a\"\n " fmt_ident s;
@@ -289,7 +284,9 @@ and labeled_pattern
289
284
tuple_component_label i ppf label;
290
285
pattern i ppf x
291
286
292
- and pattern_extra i ppf (extra_pat , _ , attrs ) =
287
+ and pattern_extra i ppf (extra_pat , loc , attrs ) =
288
+ line i ppf " extra %a\n " fmt_location loc;
289
+ let i = i + 1 in
293
290
match extra_pat with
294
291
| Tpat_unpack ->
295
292
line i ppf " Tpat_extra_unpack\n " ;
@@ -316,12 +313,15 @@ and function_body i ppf (body : function_body) =
316
313
line i ppf " Tfunction_cases%a %a\n "
317
314
fmt_partiality partial
318
315
fmt_location loc;
319
- attributes (i+ 1 ) ppf attrs;
320
- Option. iter (fun e -> expression_extra (i+ 1 ) ppf e [] ) exp_extra;
321
- list (i+ 1 ) case ppf cases
316
+ let i = i+ 1 in
317
+ attributes i ppf attrs;
318
+ Option. iter (fun e -> expression_extra i ppf (e, loc, [] )) exp_extra;
319
+ list i case ppf cases
322
320
323
- and expression_extra i ppf x attrs =
324
- match x with
321
+ and expression_extra i ppf (extra , loc , attrs ) =
322
+ line i ppf " extra %a\n " fmt_location loc;
323
+ let i = i + 1 in
324
+ match extra with
325
325
| Texp_constraint ct ->
326
326
line i ppf " Texp_constraint\n " ;
327
327
attributes i ppf attrs;
@@ -343,12 +343,7 @@ and expression i ppf x =
343
343
line i ppf " expression %a\n " fmt_location x.exp_loc;
344
344
attributes i ppf x.exp_attributes;
345
345
let i = i+ 1 in
346
- begin match x.exp_extra with
347
- | [] -> ()
348
- | extra ->
349
- line i ppf " extra\n " ;
350
- List. iter (fun (x , _ , attrs ) -> expression_extra (i+ 1 ) ppf x attrs) extra;
351
- end ;
346
+ List. iter (expression_extra i ppf) x.exp_extra;
352
347
match x.exp_desc with
353
348
| Texp_ident (li ,_ ,_ ) -> line i ppf " Texp_ident %a\n " fmt_path li;
354
349
| Texp_instvar (_ , li ,_ ) -> line i ppf " Texp_instvar %a\n " fmt_path li;
0 commit comments