Skip to content

Commit

Permalink
Revert "Add missing break after if-then-else keyword"
Browse files Browse the repository at this point in the history
This reverts commit 08934b4.
  • Loading branch information
Julow committed Jan 16, 2024
1 parent bb48a96 commit b8cb6c3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
4 changes: 3 additions & 1 deletion lib/Params.ml
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,9 @@ let get_if_then_else (c : Conf.t) ~first ~last ~parens_bch ~parens_prev_bch
( fmt_or_k first
(str "if" $ fmt_opt fmt_extension_suffix)
(str "else if")
$ fmt_attributes $ fmt "@ " $ fmt_cond xcnd )
$ fmt_attributes
$ fmt_or (Option.is_some fmt_extension_suffix) "@ " " "
$ fmt_cond xcnd )
$ fmt "@ " )
; box_keyword_and_expr=
(fun k -> hvbox 2 (fmt_or (Option.is_some xcond) "then" "else" $ k))
Expand Down
15 changes: 6 additions & 9 deletions test/passing/tests/ite-kw_first.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ f
;;

f
( if
and_ even
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooonger
( if and_ even
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooonger
then ()
else () )

Expand Down Expand Up @@ -165,12 +164,10 @@ let _ =
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz

let _ =
if
(* foo *)
foo
if (* foo *)
foo
then 0
else if
(* bar *)
bar
else if (* bar *)
bar
then 1
else 2
15 changes: 6 additions & 9 deletions test/passing/tests/ite-kw_first_closing.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ f
;;

f
( if
and_ even
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooonger
( if and_ even
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooonger
then ()
else ()
)
Expand Down Expand Up @@ -180,12 +179,10 @@ let _ =
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz

let _ =
if
(* foo *)
foo
if (* foo *)
foo
then 0
else if
(* bar *)
bar
else if (* bar *)
bar
then 1
else 2
15 changes: 6 additions & 9 deletions test/passing/tests/ite-kw_first_no_indicate.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ f
;;

f
(if
and_ even
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooonger
(if and_ even
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooonger
then ()
else ())

Expand Down Expand Up @@ -164,12 +163,10 @@ let _ =
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz

let _ =
if
(* foo *)
foo
if (* foo *)
foo
then 0
else if
(* bar *)
bar
else if (* bar *)
bar
then 1
else 2

0 comments on commit b8cb6c3

Please sign in to comment.