Commits

Peter Szilagyi committed d2f64f9

ocp-indent: resolved some tests via jane-discuss

Comments (0)

Files changed (6)

ocaml/contrib/ocp-indent/tests/js-args.ml

   match z with
   | `foo
     -> some_function
-      argument
-(* CR pszilagyi: yminsky wanted "argument" indented under the "m" in "some_function".
-   There is a bit of a conflict with how we indent other function call arguments in
-   pattern-matches.  The above is my claim for how to indent this.  What would you say
-   about this one: *)
-let f = fun x -> g
-  x
+         argument
+
+(* CR pszilagyi: What would you say about this one: *)
+let f = fun x -> ghi
+                   x
 
 let z =
   some_function

ocaml/contrib/ocp-indent/tests/js-comment.ml

   (* CR mburns: float? *)
   bar : string;
 }
+
+
+
+(* Don't reindent inside comments, whether code or formatted text. *)
+(*
+type t = {
+  (* This is a comment *)
+  a: int;
+}
+*)

ocaml/contrib/ocp-indent/tests/js-functor.ml

     (H)
     (I)
 
+(* CR pszilagyi: That is pretty awful.  We really want this?  Let's at least discourage
+   the F style for multi-argument functors? *)
 include F(struct
   let blah _
 end)

ocaml/contrib/ocp-indent/tests/js-let.ml

 (* The picture shows where we want the `=' to be.  However, Tuareg currently moves it over
    to line up with the arguments.
 
-   Perhaps this is merely a personal preference, but that seems ugly to me. *)
+   Perhaps this is merely a personal preference, but that seems ugly to me.
+
+   pszilagyi: It's consistent with other infix operators (although this is syntax) for it
+   to be where you prefer. *)
+
+let foo arguments
+  = bar
+
+let foo
+    arguments
+  = bar

ocaml/contrib/ocp-indent/tests/js-map.ml

   Deferred.List.map x ~f:(fun p ->
     _)
   >>| String.split ~on:'\n'
-
-let projection_files = Deferred.List.map x ~f:(fun p ->
-  _)
-  >>| String.split ~on:'\n'
-
-(* CR pszilagyi: Here we come to a conflict between a couple of indentation principles.  I
-   personally think the immediately above should have "_" under the "f" in "Deferred" and
-   ">>|" under the "D".
-
-   The conflict is between the "indent only as far as necessary given nesting and
-   punctuation" and "align arguments to the right of the beginning of the expression".  In
-   this case, the first rule wants to make the "_" way over to the left, while the second
-   puts ">>|" way over to the right.  I think we favor the first rule, hence the above
-   indentation. *)

ocaml/contrib/ocp-indent/tests/js-pattern.ml

     } -> ()
 (* This and the similar case below ("function" with one pattern) are intermediate states
    of editing (you'd never write "function" with one pattern), but we want to indent them
-   to match subsequent cases we're going to add. *)
+   to match up with subsequent cases we're going to add.  At Jane Street, we generally
+   include the "|" in the first case, but we want this to work even if we don't. *)
 
 let check_price t = function
   | { Exec.