File tree Expand file tree Collapse file tree 2 files changed +2
-32
lines changed Expand file tree Collapse file tree 2 files changed +2
-32
lines changed Original file line number Diff line number Diff line change @@ -4957,7 +4957,6 @@ and parse_type_constructor_declarations ?first p =
4957
4957
let first_constr_decl =
4958
4958
match first with
4959
4959
| None ->
4960
- (* bar *)
4961
4960
let doc_comment_attrs =
4962
4961
match p.Parser. token with
4963
4962
| DocComment (loc , s ) ->
@@ -5565,9 +5564,6 @@ and parse_type_equation_and_representation ?current_type_name_path
5565
5564
p
5566
5565
| Private -> parse_private_eq_or_repr p
5567
5566
| Bar | DotDot | DocComment _ ->
5568
- (* DOCCOMMENT: Reached here if the first variant starts with |.
5569
- It is possible that the first variant may not have | (with multiple variants)
5570
- *)
5571
5567
let priv, kind = parse_type_representation p in
5572
5568
(None , priv, kind)
5573
5569
| _ -> (
Original file line number Diff line number Diff line change @@ -1549,37 +1549,11 @@ and print_constructor_declarations ~state ~private_flag
1549
1549
1550
1550
and print_constructor_declaration2 ~state i
1551
1551
(cd : Parsetree.constructor_declaration ) cmt_tbl =
1552
- let comment_attrs, attrs =
1553
- List. partition
1554
- (fun ((id , payload ) : Parsetree. attribute ) ->
1555
- match (id, payload) with
1556
- | ( {txt = " res.doc" },
1557
- PStr
1558
- [
1559
- {
1560
- pstr_desc =
1561
- Pstr_eval
1562
- ({pexp_desc = Pexp_constant (Pconst_string (_, _))}, _);
1563
- };
1564
- ] ) ->
1565
- true
1566
- | _ -> false )
1567
- cd.pcd_attributes
1568
- in
1552
+ let comment_attrs, attrs = ParsetreeViewer. partition_doc_comment_attributes cd.pcd_attributes in
1569
1553
let comment_doc =
1570
1554
match comment_attrs with
1571
1555
| [] -> Doc. nil
1572
- | comment_attrs ->
1573
- Doc. concat
1574
- [
1575
- Doc. group
1576
- (Doc. join_with_sep
1577
- (List. map
1578
- (fun attr -> print_attribute ~state attr cmt_tbl)
1579
- comment_attrs));
1580
- Doc. hard_line;
1581
- ]
1582
- in
1556
+ | comment_attrs -> print_doc_comments ~sep: Doc. hard_line ~state cmt_tbl comment_attrs in
1583
1557
let attrs = print_attributes ~state attrs cmt_tbl in
1584
1558
let is_dot_dot_dot = cd.pcd_name.txt = " ..." in
1585
1559
let bar =
You can’t perform that action at this time.
0 commit comments