@@ -158,17 +158,17 @@ module T = struct
158
158
let iter sub ({ptyp_desc = desc ; ptyp_loc = loc ; ptyp_attributes = attrs }
159
159
as typ ) =
160
160
sub.location sub loc;
161
- match Jane_syntax.Core_type. of_ast typ with
162
- | Some (jtyp , attrs ) ->
163
- sub.attributes sub attrs;
164
- sub.typ_jane_syntax sub jtyp
165
- | None ->
166
161
let modes, ptyp_attributes = Jane_syntax.Mode_expr. maybe_of_attrs attrs in
167
162
match modes with
168
163
| Some modes ->
169
164
let typ = {typ with ptyp_attributes} in
170
165
sub.typ_mode_syntax sub modes typ
171
166
| None ->
167
+ match Jane_syntax.Core_type. of_ast typ with
168
+ | Some (jtyp , attrs ) ->
169
+ sub.attributes sub attrs;
170
+ sub.typ_jane_syntax sub jtyp
171
+ | None ->
172
172
sub.attributes sub attrs;
173
173
match desc with
174
174
| Ptyp_any
@@ -557,11 +557,6 @@ module E = struct
557
557
let iter sub
558
558
({pexp_loc = loc ; pexp_desc = desc ; pexp_attributes = attrs } as expr )=
559
559
sub.location sub loc;
560
- match Jane_syntax.Expression. of_ast expr with
561
- | Some (jexp , attrs ) ->
562
- sub.attributes sub attrs;
563
- sub.expr_jane_syntax sub jexp
564
- | None ->
565
560
match desc with
566
561
| Pexp_apply
567
562
({ pexp_desc = Pexp_extension (
@@ -570,6 +565,11 @@ module E = struct
570
565
let modes = Jane_syntax.Mode_expr. of_payload ~loc: pexp_loc payload in
571
566
sub.expr_mode_syntax sub modes e
572
567
| _ ->
568
+ match Jane_syntax.Expression. of_ast expr with
569
+ | Some (jexp , attrs ) ->
570
+ sub.attributes sub attrs;
571
+ sub.expr_jane_syntax sub jexp
572
+ | None ->
573
573
sub.attributes sub attrs;
574
574
match desc with
575
575
| Pexp_ident x -> iter_loc sub x
@@ -678,17 +678,17 @@ module P = struct
678
678
let iter sub
679
679
({ppat_desc = desc ; ppat_loc = loc ; ppat_attributes = attrs } as pat ) =
680
680
sub.location sub loc;
681
- match Jane_syntax.Pattern. of_ast pat with
682
- | Some (jpat , attrs ) ->
683
- sub.attributes sub attrs;
684
- sub.pat_jane_syntax sub jpat
685
- | None ->
686
681
let modes, ppat_attributes = Jane_syntax.Mode_expr. maybe_of_attrs attrs in
687
682
match modes with
688
683
| Some modes ->
689
684
let pat = {pat with ppat_attributes} in
690
685
sub.pat_mode_syntax sub modes pat
691
686
| None ->
687
+ match Jane_syntax.Pattern. of_ast pat with
688
+ | Some (jpat , attrs ) ->
689
+ sub.attributes sub attrs;
690
+ sub.pat_jane_syntax sub jpat
691
+ | None ->
692
692
sub.attributes sub attrs;
693
693
match desc with
694
694
| Ppat_any -> ()
0 commit comments