-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove incorrect
fmt_expression ~epi
mechanism (#2445)
This argument doesn't work similarly to the `~epi` argument of other functions. It meant different things depending on the expression: - `Pexp_match` and `Pexp_apply`: it was similar to `~pro`. - `Pexp_constant`: like the usual `~epi` but was passed a break. - all other cases: it was not used. These rules are now handled in `fmt_args_grouped`, the only place where they made sense. The `~epi` argument is removed. In the first case, the `~pro` argument is used instead. This requires refactoring `fmt_expression` to make sure that every cases use `~pro` exactly once.
- Loading branch information
Showing
8 changed files
with
616 additions
and
500 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
Large diffs are not rendered by default.
Oops, something went wrong.
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/ocp_indent_compat-break_colon_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,2 @@ | ||
--ocp-indent-compat | ||
--break-colon=after |
93 changes: 93 additions & 0 deletions
93
test/passing/tests/ocp_indent_compat-break_colon_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,93 @@ | ||
(* Bad: unboxing the function type *) | ||
external i : (int -> float[@unboxed]) = "i" "i_nat" | ||
|
||
module type M = sig | ||
val action : action | ||
(** Formatting action: input type and source, and output destination. *) | ||
|
||
val doc_atrs : | ||
(string Location.loc * payload) list | ||
-> (string Location.loc * bool) list option | ||
* (string Location.loc * payload) list | ||
|
||
val transl_modtype_longident | ||
(* from Typemod *) : | ||
(Location.t -> Env.t -> Longident.t -> Path.t) ref | ||
|
||
val transl_modtype_longident | ||
(* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo | ||
foooooooooooooo foooooooooooo *) : | ||
(Location.t -> Env.t -> Longident.t -> Path.t) ref | ||
|
||
val imported_sets_of_closures_table : | ||
Simple_value_approx.function_declarations option Set_of_closures_id.Tbl.t | ||
|
||
type 'a option_decl = | ||
names:string list | ||
-> doc:string | ||
-> section:[`Formatting | `Operational] | ||
-> ?allow_inline:bool | ||
-> (config -> 'a -> config) | ||
-> (config -> 'a) | ||
-> 'a t | ||
|
||
val select : | ||
(* The fsevents context *) | ||
env | ||
-> (* Additional file descriptor to select for reading *) | ||
?read_fdl:fd_select list | ||
-> (* Additional file descriptor to select for writing *) | ||
?write_fdl:fd_select list | ||
-> (* Timeout...like Unix.select *) | ||
timeout:float | ||
-> (* The callback for file system events *) | ||
(event list -> unit) | ||
-> unit | ||
|
||
val f : | ||
x:t | ||
(** an extremely long comment about [x] that does not fit on the same | ||
line with [x] *) | ||
-> unit | ||
|
||
val f : | ||
fooooooooooooooooo: | ||
(fooooooooooooooo | ||
-> fooooooooooooooooooo | ||
-> foooooooooooooo | ||
-> foooooooooooooo * fooooooooooooooooo | ||
-> foooooooooooooooo ) | ||
(** an extremely long comment about [x] that does not fit on the same | ||
line with [x] *) | ||
-> unit | ||
end | ||
|
||
let ssmap : | ||
(module MapT | ||
with type key = string | ||
and type data = string | ||
and type map = SSMap.map ) | ||
= | ||
() | ||
|
||
let ssmap : | ||
(module MapT | ||
with type key = string | ||
and type data = string | ||
and type map = SSMap.map ) | ||
-> unit | ||
= | ||
() | ||
|
||
let long_function_name : | ||
type a. a long_long_type -> a -> a -> a -> wrap_wrap_wrap -> unit | ||
= | ||
fun () -> () | ||
|
||
let add_edge target dep = | ||
if target <> dep then ( | ||
Hashtbl.replace edges dep | ||
(target :: (try Hashtbl.find edges dep with Not_found -> [])) ; | ||
Hashtbl.replace edge_count target | ||
(1 + try Hashtbl.find edge_count target with Not_found -> 0) ; | ||
if not (Hashtbl.mem edge_count dep) then Hashtbl.add edge_count dep 0 ) |
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 +0,0 @@ | ||
Warning: tests/ocp_indent_compat.ml:138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--ocp-indent-compat | ||
--break-colon=before |