This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -4434,12 +4434,7 @@ and printCases (cases: Parsetree.case list) cmtTbl =
4434
4434
Doc. concat [
4435
4435
Doc. line;
4436
4436
printList
4437
- ~get Loc:(fun n -> {n.Parsetree. pc_lhs.ppat_loc with
4438
- loc_end =
4439
- match ParsetreeViewer. processBracesAttr n.Parsetree. pc_rhs with
4440
- | (None, _ ) -> n.pc_rhs.pexp_loc.loc_end
4441
- | (Some ({loc} , _ ), _ ) -> loc.Location. loc_end
4442
- })
4437
+ ~get Loc:(fun n -> {n.Parsetree. pc_lhs.ppat_loc with loc_end = n.pc_rhs.pexp_loc.loc_end})
4443
4438
~print: printCase
4444
4439
~nodes: cases
4445
4440
cmtTbl
Original file line number Diff line number Diff line change @@ -22,6 +22,21 @@ let x =
22
22
| Universe => ()
23
23
}
24
24
25
+ // #441 rescript format sometimes deletes comments
25
26
switch count {
27
+ // String in braces
26
28
| 1 => "one"
29
+ // Int in braces
30
+ | 2 => 2
31
+ // Float in braces
32
+ | 3 => 3.
33
+ // Bool in braces
34
+ | 4 => true
35
+ // Expression in braces
36
+ | 5 => expr
37
+ // Block
38
+ | 6 => {
39
+ let _ = 123
40
+ Js.Console.log("Must be block")
41
+ }
27
42
}
Original file line number Diff line number Diff line change @@ -20,6 +20,21 @@ let x = @attr switch x {
20
20
| Universe => ()
21
21
}
22
22
23
+ // #441 rescript format sometimes deletes comments
23
24
switch count {
25
+ // String in braces
24
26
| 1 => { "one" }
27
+ // Int in braces
28
+ | 2 => {2 }
29
+ // Float in braces
30
+ | 3 => {3 .}
31
+ // Bool in braces
32
+ | 4 => { true }
33
+ // Expression in braces
34
+ | 5 => { expr }
35
+ // Block
36
+ | 6 => {
37
+ let _ = 123
38
+ Js .Console .log ("Must be block" )
39
+ }
25
40
}
You can’t perform that action at this time.
0 commit comments