This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -1656,7 +1656,11 @@ and walkExprArgument (_argLabel, expr) t comments =
1656
1656
| Ppat_construct (constr , Some pat ) ->
1657
1657
let (leading, trailing) = partitionLeadingTrailing comments constr.loc in
1658
1658
attach t.leading constr.loc leading;
1659
- let (leading, inside, trailing) = partitionByLoc trailing pat.ppat_loc in
1659
+ let (afterConstructor, rest) =
1660
+ partitionAdjacentTrailing constr.loc trailing
1661
+ in
1662
+ attach t.trailing constr.loc afterConstructor;
1663
+ let (leading, inside, trailing) = partitionByLoc rest pat.ppat_loc in
1660
1664
attach t.leading pat.ppat_loc leading;
1661
1665
walkPattern pat t inside;
1662
1666
attach t.trailing pat.ppat_loc trailing
Original file line number Diff line number Diff line change @@ -2138,7 +2138,7 @@ and printPattern (p : Parsetree.pattern) cmtTbl =
2138
2138
])
2139
2139
)
2140
2140
| Ppat_construct (constrName , constructorArgs ) ->
2141
- let constrName = printLongident constrName.txt in
2141
+ let constrName = printLongidentLocation constrName cmtTbl in
2142
2142
let argsDoc = match constructorArgs with
2143
2143
| None -> Doc. nil
2144
2144
| Some ({ppat_loc; ppat_desc = Ppat_construct ({txt = Longident. Lident "()" } , _ )} ) ->
Original file line number Diff line number Diff line change @@ -28,12 +28,17 @@ let Black(// singleLineComment
28
28
29
29
let module(/* c0 */ X /* c1 */: /* c2 */ X_int /* c3 */) /* c4 */ = x
30
30
31
- let /* before */ Rgb(
31
+ let /* before */ Rgb /* after constr */ (
32
32
/* red */ r /* red2 */,
33
33
/* green */ g /* green2 */,
34
34
/* blue */ b /* blue2 */,
35
35
) /* after */ = color
36
36
37
+ switch a {
38
+ | Constr /* after constr */
39
+ | Constr /* after constr */(a, _) => a
40
+ }
41
+
37
42
let () = ()
38
43
let [/* inside */] = []
39
44
let list{/* inside */} = list{}
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ let module(/* c0 */ X /* c1 */ : /* c2 */ X_int /* c3 */) /* c4 */ = x
31
31
32
32
let /* before */ Rgb /* after constr */ (/* red */ r /* red2 */ , /* green */ g /* green2 */ , /* blue */ b /* blue2 */ ) /* after */ = color
33
33
34
+ switch a {
35
+ | Constr /* after constr */
36
+ | Constr /* after constr */ (a , _ ) => a
37
+ }
38
+
34
39
let () = ()
35
40
let [/* inside */ ] = []
36
41
let list {/* inside */ } = list {}
You can’t perform that action at this time.
0 commit comments