-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix comments around underscore in record patterns (#2540)
Remove the added empty line and the extraneous space with `break-separator=after`. Fix unstable comment with `break-separator=before`.
- Loading branch information
Showing
16 changed files
with
323 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Warning: tests/break_collection_expressions.ml:3 exceeds the margin | ||
Warning: tests/break_collection_expressions.ml:50 exceeds the margin | ||
Warning: tests/break_collection_expressions.ml:49 exceeds the margin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/passing/tests/comments_in_record-break_separator-after.ml.err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Warning: tests/comments_in_record.ml:21 exceeds the margin | ||
Warning: tests/comments_in_record.ml:27 exceeds the margin |
1 change: 1 addition & 0 deletions
1
test/passing/tests/comments_in_record-break_separator-after.ml.opts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--break-separator=after |
115 changes: 115 additions & 0 deletions
115
test/passing/tests/comments_in_record-break_separator-after.ml.ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
type t = | ||
{ a: int; (* some comment *) | ||
b: float; | ||
c: string; | ||
d: [`something_looooooooooooooooooooooooooooooooong] } | ||
|
||
type t = | ||
{ a: int; (** some comment *) | ||
b: float; | ||
c: string; | ||
d: [`something_looooooooooooooooooooooooooooooooong] } | ||
|
||
type t = {a: int; (* Comment *) b: int (* Comment *)} | ||
|
||
type t = | ||
{ a: int; (* Comment *) | ||
b: int (* Comment *) } | ||
[@@ocamlformat "type-decl=sparse"] | ||
|
||
let { (* cmts *) | ||
pat; | ||
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; | ||
a; | ||
(* b *) b; | ||
(* c *) c; | ||
d= | ||
(* d *) | ||
(D : loooooooooooooooooooooooooooooooooooooooooooooooooooooooong_int); | ||
(* e *) | ||
e: loooooooooooooooooooooooooooooooooooooooooooooooooooooooong_int } = | ||
exp | ||
|
||
let x = | ||
{ (* Xxxx xxxxxxxx xxxxx xx xx xx xxxx xxxxxx - XXxx_xxxxx xxx'x. *) | ||
Irure_sed_a.in_nisi_sed= Irure_sed_fugiat.LaboRum sint_sed; | ||
in_ea_deserunt= nulla } | ||
|
||
type t = | ||
{ a: int option; | ||
(* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb | ||
cccccccccccccccccccccccccccc ddddddddddddddddd eeeee *) | ||
b: float | ||
(* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb | ||
cccccccccccccccccccccccccccc ddddddddddddddddd eeeee *) } | ||
|
||
type t = | ||
| Tuple of {elts: t vector; packed: bool} | ||
| Struct of | ||
{ name: string; | ||
elts: t vector (* possibly cyclic, name unique *); | ||
[@compare.ignore] [@equal.ignore] [@sexp_drop_if fun _ -> true] | ||
elts: t vector; | ||
(* possibly cyclic, name unique *) | ||
(* mooooooooooooooooooooooooooooooooooore comments *) | ||
[@compare.ignore] | ||
[@equal.ignore] | ||
[@sexp_drop_if fun _ -> true] | ||
packed: bool } | ||
| Opaque of {name: string} | ||
[@@deriving compare, equal, hash, sexp] | ||
|
||
type t = {(* c *) c (* c' *): (* d *) d (* d' *)} | ||
|
||
let _ = | ||
{ (* a *) a (* a' *)= (* b *) b (* b' *); | ||
(* c *) c (* c' *): (* d *) d (* d' *) = (* e *) e (* e' *); | ||
(* f *) f (* f' *); | ||
(* g *) g (* g' *)= | ||
(* j *) ((* h *) h (* h' *) : (* i *) i (* i' *)) (* j' *) } | ||
|
||
let { (* a *) a (* a' *)= (* b *) b (* b' *); | ||
(* c *) c (* c' *): (* d *) d (* d' *) = (* e *) e (* e' *); | ||
(* f *) f (* f' *); | ||
(* g *) g (* g' *)= | ||
(* j *) ((* h *) h (* h' *) : (* i *) i (* i' *)) (* j' *) } = | ||
x | ||
|
||
type program = | ||
{ prog_globals: global list; (* global variables *) | ||
prog_struct_types: lltype list; (* data structures *) | ||
prog_lib_funcs: func list (* library functions *) } | ||
|
||
type t = | ||
{ mutable ci_fixed: IntervalSet.t; | ||
mutable ci_spilled: | ||
(* spilled stack slots (reg.loc = Stack (Local n)) still in use *) | ||
IntervalSet.t } | ||
|
||
type t = | ||
{ mutable ci_fixed: IntervalSet.t; | ||
mutable | ||
(* spilled stack slots (reg.loc = Stack (Local n)) still in use *) | ||
ci_spilled: | ||
IntervalSet.t } | ||
|
||
type t = | ||
{ mutable ci_fixed: IntervalSet.t; | ||
mutable ci_spilled | ||
(* spilled stack slots (reg.loc = Stack (Local n)) still in use *): | ||
IntervalSet.t } | ||
|
||
let _ = | ||
match c with | ||
| { issuer= _; | ||
(* TODO *) | ||
_ } -> | ||
() | ||
| {issuer= _; (* TODO *) _} -> () | ||
| {issuer= _; _ (* TODO *)} -> () | ||
| { issuer= _; | ||
(* TODO *) | ||
_ | ||
(* TODO *) } -> | ||
() | ||
| {issuer= _; (* TODO *) _ (* TODO *)} -> () |
1 change: 1 addition & 0 deletions
1
test/passing/tests/comments_in_record-break_separator-before.ml.err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Warning: tests/comments_in_record.ml:21 exceeds the margin |
1 change: 1 addition & 0 deletions
1
test/passing/tests/comments_in_record-break_separator-before.ml.opts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--break-separator=before |
115 changes: 115 additions & 0 deletions
115
test/passing/tests/comments_in_record-break_separator-before.ml.ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
type t = | ||
{ a: int (* some comment *) | ||
; b: float | ||
; c: string | ||
; d: [`something_looooooooooooooooooooooooooooooooong] } | ||
|
||
type t = | ||
{ a: int (** some comment *) | ||
; b: float | ||
; c: string | ||
; d: [`something_looooooooooooooooooooooooooooooooong] } | ||
|
||
type t = {a: int (* Comment *); b: int (* Comment *)} | ||
|
||
type t = | ||
{ a: int (* Comment *) | ||
; b: int (* Comment *) } | ||
[@@ocamlformat "type-decl=sparse"] | ||
|
||
let { (* cmts *) | ||
pat | ||
; loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong | ||
; a | ||
; (* b *) b | ||
; (* c *) c | ||
; d= | ||
(* d *) | ||
(D : loooooooooooooooooooooooooooooooooooooooooooooooooooooooong_int) | ||
; (* e *) | ||
e: loooooooooooooooooooooooooooooooooooooooooooooooooooooooong_int } = | ||
exp | ||
|
||
let x = | ||
{ (* Xxxx xxxxxxxx xxxxx xx xx xx xxxx xxxxxx - XXxx_xxxxx xxx'x. *) | ||
Irure_sed_a.in_nisi_sed= Irure_sed_fugiat.LaboRum sint_sed | ||
; in_ea_deserunt= nulla } | ||
|
||
type t = | ||
{ a: int option | ||
(* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb | ||
cccccccccccccccccccccccccccc ddddddddddddddddd eeeee *) | ||
; b: float | ||
(* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb | ||
cccccccccccccccccccccccccccc ddddddddddddddddd eeeee *) } | ||
|
||
type t = | ||
| Tuple of {elts: t vector; packed: bool} | ||
| Struct of | ||
{ name: string | ||
; elts: t vector (* possibly cyclic, name unique *) | ||
[@compare.ignore] [@equal.ignore] [@sexp_drop_if fun _ -> true] | ||
; elts: t vector | ||
(* possibly cyclic, name unique *) | ||
(* mooooooooooooooooooooooooooooooooooore comments *) | ||
[@compare.ignore] | ||
[@equal.ignore] | ||
[@sexp_drop_if fun _ -> true] | ||
; packed: bool } | ||
| Opaque of {name: string} | ||
[@@deriving compare, equal, hash, sexp] | ||
|
||
type t = {(* c *) c (* c' *): (* d *) d (* d' *)} | ||
|
||
let _ = | ||
{ (* a *) a (* a' *)= (* b *) b (* b' *) | ||
; (* c *) c (* c' *): (* d *) d (* d' *) = (* e *) e (* e' *) | ||
; (* f *) f (* f' *) | ||
; (* g *) g (* g' *)= | ||
(* j *) ((* h *) h (* h' *) : (* i *) i (* i' *)) (* j' *) } | ||
|
||
let { (* a *) a (* a' *)= (* b *) b (* b' *) | ||
; (* c *) c (* c' *): (* d *) d (* d' *) = (* e *) e (* e' *) | ||
; (* f *) f (* f' *) | ||
; (* g *) g (* g' *)= | ||
(* j *) ((* h *) h (* h' *) : (* i *) i (* i' *)) (* j' *) } = | ||
x | ||
|
||
type program = | ||
{ prog_globals: global list (* global variables *) | ||
; prog_struct_types: lltype list (* data structures *) | ||
; prog_lib_funcs: func list (* library functions *) } | ||
|
||
type t = | ||
{ mutable ci_fixed: IntervalSet.t | ||
; mutable ci_spilled: | ||
(* spilled stack slots (reg.loc = Stack (Local n)) still in use *) | ||
IntervalSet.t } | ||
|
||
type t = | ||
{ mutable ci_fixed: IntervalSet.t | ||
; mutable | ||
(* spilled stack slots (reg.loc = Stack (Local n)) still in use *) | ||
ci_spilled: | ||
IntervalSet.t } | ||
|
||
type t = | ||
{ mutable ci_fixed: IntervalSet.t | ||
; mutable ci_spilled | ||
(* spilled stack slots (reg.loc = Stack (Local n)) still in use *): | ||
IntervalSet.t } | ||
|
||
let _ = | ||
match c with | ||
| { issuer= _ | ||
; (* TODO *) | ||
_ } -> | ||
() | ||
| {issuer= _; (* TODO *) _} -> () | ||
| {issuer= _; _ (* TODO *)} -> () | ||
| { issuer= _ | ||
; (* TODO *) | ||
_ | ||
(* TODO *) } -> | ||
() | ||
| {issuer= _; (* TODO *) _ (* TODO *)} -> () |
Oops, something went wrong.