Permalink
Browse files

implemented our change of mind on pattern indentation via i_strict_with

  • Loading branch information...
1 parent 9d25f05 commit 9bc9feecc1e827e2f79e7273d976628b6944d40e @pszilagyi pszilagyi committed Mar 13, 2013
View
2 src/indentConfig.ml
@@ -49,7 +49,7 @@ let presets = [
default;
"JaneStreet",
{ i_base = 2; i_type = 2; i_in = 0;
- i_with = 0; i_strict_with = Always; i_match_clause = 2;
+ i_with = 0; i_strict_with = Auto; i_match_clause = 2;
i_strict_comments = true;
i_align_params = Always };
]
View
93 tests/failing-output/js-args.ml
@@ -1,93 +0,0 @@
-let () =
- foo.bar <-
- f x
- y z
-
-(* yminsky *)
-let should_check_can_sell_and_marking regulatory_regime =
- match z with
- | `foo
- -> some_function
- argument
-(* pszilagyi: The above typically occurs in a multi-pattern match clause, so the
- clause expression is on a line by itself. This is the more typical way a
- long single-pattern match clause would be written: *)
-let should_check_can_sell_and_marking regulatory_regime =
- match z with
- | `foo ->
- some_function
- argument
-
-let f = fun x ->
- ghi
- x
-
-(* uncommon *)
-let x =
- try x with a -> b
- | c -> d
-let x =
- try x
- with a -> b
- | c -> d
-(* common *)
-let x =
- try x with
- | a -> b
- | c -> d
-let x = try x with
-| a -> b
-| c -> d
-let x =
- try x
- with
- | a -> b
- | c -> d
-
-let z =
- some_function
- argument
-
-
-
-(* dwu *)
-let () =
- f a b ~c:c
- d
-
-let () =
- f a b ~c:1.
- d
-
-let () =
- My_module.f a b ~c:c
- d
-
-(* This last case is where Tuareg is inconsistent with the others. *)
-let () =
- My_module.f a b ~c:1.
- d
-
-
-
-let () =
- messages :=
- Message_store.create (Session_id.of_string "")
- (* Tuareg indents these lines too far to the left. *)
- "herd-retransmitter"
- Message_store.Message_size.Byte
-
-
-
-let () =
- raise (Bug ("foo"
- (* In this and similar cases, we want the subsequent lines to
- align with the first expression. *)
- ^ "bar"))
-
-(* Except in specific cases, we want the argument indented relative to the
- function being called. (Exceptions include "fun" arguments where the line
- ends with "->" and subsequent lines beginning with operators, like above.) *)
-let () =
- Some (Message_store.create s
- "herd-retransmitter" ~unlink:true Message_store.Message_size.Byte)
View
32 tests/failing-output/js-pattern.ml
@@ -1,32 +0,0 @@
-let f = function
-| _ -> 0
-;;
-
-let f x = match x with
-| _ -> 0
-;;
-
-let f =
- function
- | _ -> 0
-;;
-
-let f x =
- match x with
- | _ -> 0
-;;
-
-let f x =
- begin match x with
- | _ -> 0
- end
-;;
-
-let check_price t = function
-| { Exec.
- trade_at_settlement = (None | Some false);
- } -> ()
-
-let check_price t = function
-| simpler -> ()
-| other -> ()
View
0 tests/failing/js-args.ml → tests/passing/js-args.ml
File renamed without changes.
View
0 tests/failing/js-args.ml.opts → tests/passing/js-args.ml.opts
File renamed without changes.
View
16 tests/passing/js-begin.ml
@@ -1,15 +1,15 @@
(* yminsky *)
let f = function
-| zoo -> begin
- foo;
- bar;
- end
+ | zoo -> begin
+ foo;
+ bar;
+ end
;;
let g = function
-| zoo -> (
- foo;
- bar;
- )
+ | zoo -> (
+ foo;
+ bar;
+ )
;;
let () =
begin match foo with
View
0 tests/failing/js-pattern.ml → tests/passing/js-pattern.ml
File renamed without changes.
View
0 tests/failing/js-pattern.ml.opts → tests/passing/js-pattern.ml.opts
File renamed without changes.

0 comments on commit 9bc9fee

Please sign in to comment.