Skip to content

Fix precedence of Dot wrt Hash#1058

Merged
Julow merged 10 commits intoocaml-ppx:masterfrom
gpetiot:parens-hash-op
Oct 10, 2019
Merged

Fix precedence of Dot wrt Hash#1058
Julow merged 10 commits intoocaml-ppx:masterfrom
gpetiot:parens-hash-op

Conversation

@gpetiot
Copy link
Copy Markdown
Collaborator

@gpetiot gpetiot commented Oct 9, 2019

Fix #1042

@Julow
Copy link
Copy Markdown
Collaborator

Julow commented Oct 9, 2019

No, . and # should have the same precedence. a.b#c.d is the same as ((a.b)#c).d.

@gpetiot
Copy link
Copy Markdown
Collaborator Author

gpetiot commented Oct 9, 2019

Are you sure about this? I used https://caml.inria.fr/pub/docs/manual-ocaml/expr.html#sec133 for reference but maybe I missed something.

@Julow
Copy link
Copy Markdown
Collaborator

Julow commented Oct 9, 2019

After experimenting they seem to have the same precedence and associativity.

This 2 expressions parse to the same AST:

a.b#c.*(d)#e.(f);;
((((a.b)#c).*(d))#e).(f);;

and OCamlformat format them to ((a.b)#c.*(d))#e.(f)

@gpetiot
Copy link
Copy Markdown
Collaborator Author

gpetiot commented Oct 9, 2019

And are we sure this is not a parsing bug? I find it weird to not find any indication in the manual

@Julow
Copy link
Copy Markdown
Collaborator

Julow commented Oct 9, 2019

It's not a bug but it's weird indeed.

Actually the table shoud look like this:

., .(, .[, .{ -
#... left
#id -

The #... is not the method call syntax but HASHOP, custom operators starting with #.
#id is lower but parenthesis are not needed because there can only be an identifier on the right of the # (it has no associativity, like ., the parser will only look for an identifier on the right).

This cannot be solved by changing the precedence and needs a special case for a#b.c

@gpetiot gpetiot marked this pull request as ready for review October 9, 2019 16:04
@gpetiot
Copy link
Copy Markdown
Collaborator Author

gpetiot commented Oct 9, 2019

I used the Dot precedence for x#y, here is the diff of test_branch, that looks better:

diff --git a/examples/boulderdash/boulderdash.ml b/examples/boulderdash/boulderdash.ml
index 2532c1659..4c1b0d720 100644
--- a/examples/boulderdash/boulderdash.ml
+++ b/examples/boulderdash/boulderdash.ml
@@ -105,7 +105,7 @@ let img_assoc v =
 
 let set_cell state x y v =
   state.map.(y).(x) <- v;
-  (state.imgs.(y).(x))##.src := img_assoc v
+  state.imgs.(y).(x)##.src := img_assoc v
 
 let walkable = function
   | Empty | Grass | Diamond | End -> true
@@ -151,9 +151,9 @@ let rec build_interaction state show_rem ((_, _, clock_stop) as clock) =
   >>= fun () ->
   for y = 0 to Array.length state.map - 1 do
     for x = 0 to Array.length state.map.(y) - 1 do
-      (state.imgs.(y).(x))##.onmouseover := Html.no_handler;
-      (state.imgs.(y).(x))##.onmouseout := Html.no_handler;
-      (state.imgs.(y).(x))##.onclick := Html.no_handler
+      state.imgs.(y).(x)##.onmouseover := Html.no_handler;
+      state.imgs.(y).(x)##.onmouseout := Html.no_handler;
+      state.imgs.(y).(x)##.onclick := Html.no_handler
     done
   done;
   let inhibit f _x =
@@ -184,12 +184,12 @@ let rec build_interaction state show_rem ((_, _, clock_stop) as clock) =
   let rec update (x, y) next img over_cont out_cont click_cont =
     if walkable state.map.(y).(x)
     then (
-      let cur_img = (state.imgs.(y).(x))##.src in
+      let cur_img = state.imgs.(y).(x)##.src in
       let over () =
-        (state.imgs.(y).(x))##.src := img;
+        state.imgs.(y).(x)##.src := img;
         over_cont ()
       and out () =
-        (state.imgs.(y).(x))##.src := cur_img;
+        state.imgs.(y).(x)##.src := cur_img;
         out_cont ()
       and click' () =
         click_cont ()
@@ -222,11 +222,11 @@ let rec build_interaction state show_rem ((_, _, clock_stop) as clock) =
             | _ -> Lwt.fail e)
         >>= fun () -> build_interaction state show_rem clock
       in
-      (state.imgs.(y).(x))##.onmouseover
+      state.imgs.(y).(x)##.onmouseover
       := Html.handler (inhibit (set_pending_out (with_pending_out over) out));
-      (state.imgs.(y).(x))##.onmouseout
+      state.imgs.(y).(x)##.onmouseout
       := Html.handler (inhibit (with_pending_out (fun () -> Lwt.return ())));
-      (state.imgs.(y).(x))##.onclick := Html.handler (inhibit (with_pending_out click));
+      state.imgs.(y).(x)##.onclick := Html.handler (inhibit (with_pending_out click));
       if state.map.(y).(x) <> End then update (next (x, y)) next img over out click')
   in
   let update_push ((x, y) as pos) next img img_guy =
@@ -236,13 +236,13 @@ let rec build_interaction state show_rem ((_, _, clock_stop) as clock) =
        with Invalid_argument _ -> false
     then (
       let over () =
-        (state.imgs.(y).(x))##.src := img_guy;
-        (state.imgs.(y').(x'))##.src := img;
+        state.imgs.(y).(x)##.src := img_guy;
+        state.imgs.(y').(x')##.src := img;
         Lwt.return ()
       in
       let out () =
-        (state.imgs.(y).(x))##.src := js "sprites/guy.png";
-        (state.imgs.(y').(x'))##.src := js "sprites/boulder.png"
+        state.imgs.(y).(x)##.src := js "sprites/guy.png";
+        state.imgs.(y').(x')##.src := js "sprites/boulder.png"
       in
       let click () =
         set_cell state x y Empty;
@@ -259,11 +259,11 @@ let rec build_interaction state show_rem ((_, _, clock_stop) as clock) =
             | e -> Lwt.fail e)
         >>= fun () -> build_interaction state show_rem clock
       in
-      (state.imgs.(y').(x'))##.onmouseover
+      state.imgs.(y').(x')##.onmouseover
       := Html.handler (inhibit (set_pending_out (with_pending_out over) out));
-      (state.imgs.(y').(x'))##.onmouseout
+      state.imgs.(y').(x')##.onmouseout
       := Html.handler (inhibit (with_pending_out (fun () -> Lwt.return ())));
-      (state.imgs.(y').(x'))##.onclick := Html.handler (inhibit (with_pending_out click)))
+      state.imgs.(y').(x')##.onclick := Html.handler (inhibit (with_pending_out click)))
   in
   if state.pos = state.endpos
   then (
@@ -277,7 +277,7 @@ let rec build_interaction state show_rem ((_, _, clock_stop) as clock) =
     if state.rem = 0
     then (
       let x, y = state.endpos in
-      (state.imgs.(y).(x))##.src := js "sprites/end.png";
+      state.imgs.(y).(x)##.src := js "sprites/end.png";
       state.map.(y).(x) <- End);
     let r (x, y) = succ x, y and l (x, y) = pred x, y in
     let u (x, y) = x, pred y and d (x, y) = x, succ y in
diff --git a/examples/graph_viewer/svg.ml b/examples/graph_viewer/svg.ml
index 063f3e24f..ee1ef0262 100644
--- a/examples/graph_viewer/svg.ml
+++ b/examples/graph_viewer/svg.ml
@@ -487,7 +487,7 @@ let redraw w range ev =
   (*
   let t1 = Unix.gettimeofday () in
 *)
-  let ctx = Cairo_lablgtk.create (w#misc)#window in
+  let ctx = Cairo_lablgtk.create w#misc#window in
   Cairo.save ctx;
   if !bboxes = [] then bboxes := List.map (fun e -> compute_extent ctx e) l;
   Cairo.new_path ctx;
@@ -495,7 +495,7 @@ let redraw w range ev =
   let rect = Gdk.Rectangle.create 0 0 0 0 in
   Gdk.Region.get_clipbox (GdkEvent.Expose.region ev) rect;
   Cairo.clip ctx;
-  let scale = scale *. ((1. /. scale) ** (range#adjustment)#value) in
+  let scale = scale *. ((1. /. scale) ** range#adjustment#value) in
   Cairo.scale ctx scale scale;
   Cairo.translate ctx 364. 22443.;
   let bbox =
@@ -519,8 +519,8 @@ Format.eprintf "%f %f %f %f (%f)@." x1 y1 x2 y2 scale;
   true
 
 let slider_changed (area : GMisc.drawing_area) range () =
-  let scale = scale *. ((1. /. scale) ** (range#adjustment)#value) in
-  (area#misc)#set_size_request
+  let scale = scale *. ((1. /. scale) ** range#adjustment#value) in
+  area#misc#set_size_request
     ~width:(truncate (width *. scale))
     ~height:(truncate (height *. scale))
     ();
@@ -530,7 +530,7 @@ let _ =
   ignore (GMain.Main.init ());
   let initial_size = 600 in
   let w = GWindow.window () in
-  ignore ((w#connect)#destroy GMain.quit);
+  ignore (w#connect#destroy GMain.quit);
   let b = GPack.vbox ~spacing:6 ~border_width:12 ~packing:w#add () in
   (*
   let f = GBin.frame ~shadow_type:`IN
@@ -548,12 +548,12 @@ let _ =
       ~packing:f#add_with_viewport
       ()
   in
-  (area#misc)#set_size_request
+  area#misc#set_size_request
     ~width:(truncate (width *. scale))
     ~height:(truncate (height *. scale))
     ();
   let slider = GRange.scale `HORIZONTAL ~draw_value:false ~packing:b#pack () in
-  (slider#adjustment)#set_bounds ~lower:0. ~upper:1. ~step_incr:0.1 ();
+  slider#adjustment#set_bounds ~lower:0. ~upper:1. ~step_incr:0.1 ();
   (*
   let button = GButton.check_button ~label:"Animate"
       ~packing:b#pack () in
@@ -565,8 +565,8 @@ let _ =
   ignore (button#connect#toggled
             (animate_toggled button slider)) ;
 *)
-  ignore (((area#event)#connect)#expose (redraw area slider));
-  ignore ((slider#connect)#value_changed (slider_changed area slider));
+  ignore (area#event#connect#expose (redraw area slider));
+  ignore (slider#connect#value_changed (slider_changed area slider));
   w#show ();
   GMain.main ()
 
diff --git a/examples/graph_viewer/viewer.ml b/examples/graph_viewer/viewer.ml
index 3bcd2d0e0..3a6970d1a 100644
--- a/examples/graph_viewer/viewer.ml
+++ b/examples/graph_viewer/viewer.ml
@@ -126,7 +126,7 @@ module Common = Viewer_common.F (struct
 
   type pixmap = GDraw.pixmap
 
-  let get_drawable w = new GDraw.drawable (w#misc)#window
+  let get_drawable w = new GDraw.drawable w#misc#window
 
   let make_pixmap window width height = GDraw.pixmap ~width ~height ~window ()
 
@@ -154,9 +154,9 @@ open Common
 
 let set_visible w vis =
   if vis
-  then (if not (w#misc)#visible then (w#misc)#show ())
-  else if (w#misc)#visible
-  then (w#misc)#hide ()
+  then (if not w#misc#visible then w#misc#show ())
+  else if w#misc#visible
+  then w#misc#hide ()
   (*
   let button = GButton.check_button ~label:"Animate"
       ~packing:b#pack () in
@@ -565,8 +565,8 @@ let _ =
   ignore (button#connect#toggled
             (animate_toggled button slider)) ;
 *)
-  ignore (((area#event)#connect)#expose (redraw area slider));
-  ignore ((slider#connect)#value_changed (slider_changed area slider));
+  ignore (area#event#connect#expose (redraw area slider));
+  ignore (slider#connect#value_changed (slider_changed area slider));
   w#show ();
   GMain.main ()
 
diff --git a/examples/graph_viewer/viewer.ml b/examples/graph_viewer/viewer.ml
index 3bcd2d0e0..3a6970d1a 100644
--- a/examples/graph_viewer/viewer.ml
+++ b/examples/graph_viewer/viewer.ml
@@ -126,7 +126,7 @@ module Common = Viewer_common.F (struct
 
   type pixmap = GDraw.pixmap
 
-  let get_drawable w = new GDraw.drawable (w#misc)#window
+  let get_drawable w = new GDraw.drawable w#misc#window
 
   let make_pixmap window width height = GDraw.pixmap ~width ~height ~window ()
 
@@ -154,9 +154,9 @@ open Common
 
 let set_visible w vis =
   if vis
-  then (if not (w#misc)#visible then (w#misc)#show ())
-  else if (w#misc)#visible
-  then (w#misc)#hide ()
+  then (if not w#misc#visible then w#misc#show ())
+  else if w#misc#visible
+  then w#misc#hide ()
 
 let scroll_view ?width ?height ?packing st =
   let table = GPack.table ?width ?height ~columns:2 ~rows:2 ?packing () in
@@ -168,7 +168,7 @@ let scroll_view ?width ?height ?packing st =
       ~packing:(table#attach ~left:0 ~top:1 ~fill:`BOTH ~expand:`NONE)
       ()
   in
-  (hbar#misc)#hide ();
+  hbar#misc#hide ();
   let vadj = GData.adjustment () in
   let vbar =
     GRange.scrollbar
@@ -177,12 +177,12 @@ let scroll_view ?width ?height ?packing st =
       ~packing:(table#attach ~left:1 ~top:0 ~fill:`BOTH ~expand:`NONE)
       ()
   in
-  (vbar#misc)#hide ();
+  vbar#misc#hide ();
   let display =
     GMisc.drawing_area ~packing:(table#attach ~left:0 ~top:0 ~fill:`BOTH ~expand:`BOTH) ()
   in
-  (display#misc)#set_can_focus true;
-  (display#misc)#set_double_buffered false;
+  display#misc#set_can_focus true;
+  display#misc#set_double_buffered false;
   let sadj = GData.adjustment ~upper:20. ~step_incr:1. ~page_incr:1. ~page_size:0. () in
   let zoom_steps = 8. in
   (* Number of steps to get a factor of 2 *)
@@ -195,7 +195,7 @@ let scroll_view ?width ?height ?packing st =
   in
   let get_scale () = (2. ** (sadj#value /. zoom_steps)) /. st.zoom_factor in
   let update_scrollbars () =
-    let a = (display#misc)#allocation in
+    let a = display#misc#allocation in
     let scale = get_scale () in
     let aw = ceil (float a.Gtk.width /. scale) in
     let ah = ceil (float a.Gtk.height /. scale) in
@@ -223,13 +223,13 @@ let scroll_view ?width ?height ?packing st =
     GtkBase.Widget.queue_draw display#as_widget
   in
   ignore
-    (((display#event)#connect)#configure (fun ev ->
+    (display#event#connect#configure (fun ev ->
          prerr_endline "CONFIGURE";
          update_scrollbars ();
          false));
   ignore
-    (((display#event)#connect)#map (fun ev ->
-         let a = (display#misc)#allocation in
+    (display#event#connect#map (fun ev ->
+         let a = display#misc#allocation in
          Format.eprintf "alloc: %d %d@." a.Gtk.width a.Gtk.height;
          let zoom_factor =
            max (st.st_width /. float a.Gtk.width) (st.st_height /. float a.Gtk.height)
@@ -238,9 +238,9 @@ let scroll_view ?width ?height ?packing st =
          refresh ();
          update_scrollbars ();
          false));
-  (display#event)#add [`STRUCTURE];
+  display#event#add [`STRUCTURE];
   ignore
-    (((display#event)#connect)#expose (fun ev ->
+    (display#event#connect#expose (fun ev ->
          let area = GdkEvent.Expose.area ev in
          let x = Gdk.Rectangle.x area in
          let y = Gdk.Rectangle.y area in
@@ -252,20 +252,20 @@ let scroll_view ?width ?height ?packing st =
            hadj#value
            vadj#value
            display
-           (display#misc)#allocation
+           display#misc#allocation
            x
            y
            width
            height;
          true));
   ignore
-    ((hadj#connect)#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
+    (hadj#connect#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
   ignore
-    ((vadj#connect)#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
+    (vadj#connect#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
   let prev_scale = ref (get_scale ()) in
   let zoom_center = ref (0.5, 0.5) in
   ignore
-    ((sadj#connect)#value_changed (fun () ->
+    (sadj#connect#value_changed (fun () ->
          let scale = get_scale () in
          let r = 1. -. (!prev_scale /. scale) in
          Format.eprintf "update@.";
@@ -275,7 +275,7 @@ let scroll_view ?width ?height ?packing st =
          refresh ();
          update_scrollbars ()));
   let bump_scale x y v =
-    let a = (display#misc)#allocation in
+    let a = display#misc#allocation in
     let x = x /. float a.Gtk.width in
     let y = y /. float a.Gtk.height in
     if x >= 0. && x <= 1. && y >= 0. && y <= 1. then zoom_center := x, y;
@@ -287,33 +287,33 @@ let scroll_view ?width ?height ?packing st =
   in
   (* Zoom using the mouse wheel *)
   ignore
-    (((display#event)#connect)#scroll (fun ev ->
+    (display#event#connect#scroll (fun ev ->
          let x = GdkEvent.Scroll.x ev in
          let y = GdkEvent.Scroll.y ev in
          match GdkEvent.Scroll.direction ev with
          | `UP -> bump_scale x y 1.
          | `DOWN -> bump_scale x y (-1.)
            width
            height;
          true));
   ignore
-    ((hadj#connect)#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
+    (hadj#connect#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
   ignore
-    ((vadj#connect)#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
+    (vadj#connect#value_changed (fun () -> GtkBase.Widget.queue_draw display#as_widget));
   let prev_scale = ref (get_scale ()) in
   let zoom_center = ref (0.5, 0.5) in
   ignore
-    ((sadj#connect)#value_changed (fun () ->
+    (sadj#connect#value_changed (fun () ->
          let scale = get_scale () in
          let r = 1. -. (!prev_scale /. scale) in
          Format.eprintf "update@.";
@@ -275,7 +275,7 @@ let scroll_view ?width ?height ?packing st =
          refresh ();
          update_scrollbars ()));
   let bump_scale x y v =
-    let a = (display#misc)#allocation in
+    let a = display#misc#allocation in
     let x = x /. float a.Gtk.width in
     let y = y /. float a.Gtk.height in
     if x >= 0. && x <= 1. && y >= 0. && y <= 1. then zoom_center := x, y;
@@ -287,33 +287,33 @@ let scroll_view ?width ?height ?packing st =
   in
   (* Zoom using the mouse wheel *)
   ignore
-    (((display#event)#connect)#scroll (fun ev ->
+    (display#event#connect#scroll (fun ev ->
          let x = GdkEvent.Scroll.x ev in
          let y = GdkEvent.Scroll.y ev in
          match GdkEvent.Scroll.direction ev with
          | `UP -> bump_scale x y 1.
          | `DOWN -> bump_scale x y (-1.)
          | _ -> false));
-  (display#event)#add [`SCROLL];
+  display#event#add [`SCROLL];
   let pos = ref None in
   ignore
-    (((display#event)#connect)#button_press (fun ev ->
-         (display#misc)#grab_focus ();
+    (display#event#connect#button_press (fun ev ->
+         display#misc#grab_focus ();
          if GdkEvent.get_type ev = `BUTTON_PRESS && GdkEvent.Button.button ev = 1
          then pos := Some (GdkEvent.Button.x ev, GdkEvent.Button.y ev);
          false));
   ignore
-    (((display#event)#connect)#button_release (fun ev ->
+    (display#event#connect#button_release (fun ev ->
          if GdkEvent.Button.button ev = 1 then pos := None;
          false));
   ignore
-    (((display#event)#connect)#motion_notify (fun ev ->
+    (display#event#connect#motion_notify (fun ev ->
          (match !pos with
          | Some (x, y) ->
              let x', y' =
                if GdkEvent.Motion.is_hint ev
                then
-                 let x', y' = (display#misc)#pointer in
+                 let x', y' = display#misc#pointer in
                  float x', float y'
                else GdkEvent.Motion.x ev, GdkEvent.Motion.y ev
              in
@@ -324,10 +324,9 @@ let scroll_view ?width ?height ?packing st =
              pos := Some (x', y')
          | None -> ());
          false));
-  (display#event)#add
-    [`BUTTON_PRESS; `BUTTON_RELEASE; `BUTTON1_MOTION; `POINTER_MOTION_HINT];
+  display#event#add [`BUTTON_PRESS; `BUTTON_RELEASE; `BUTTON1_MOTION; `POINTER_MOTION_HINT];
   ignore
-    (((display#event)#connect)#key_press (fun ev ->
+    (display#event#connect#key_press (fun ev ->
          let keyval = GdkEvent.Key.keyval ev in
          if keyval = GdkKeysyms._Up
          then (
@@ -361,7 +360,7 @@ let scroll_view ?width ?height ?packing st =
            true)
          else if keyval = GdkKeysyms._0 || keyval = GdkKeysyms._agrave
          then (
-           let a = (table#misc)#allocation in
+           let a = table#misc#allocation in
            Format.eprintf "alloc: %d %d@." a.Gtk.width a.Gtk.height;
            let zf =
              max (st.st_width /. float a.Gtk.width) (st.st_height /. float a.Gtk.height)
@@ -378,14 +377,14 @@ let scroll_view ?width ?height ?packing st =
                  || keyval = GdkKeysyms._equal
                  || keyval = GdkKeysyms._KP_Add
          then
-           let x, y = (display#misc)#pointer in
+           let x, y = display#misc#pointer in
            bump_scale (float x) (float y) 1.
          else if keyval = GdkKeysyms._minus || keyval = GdkKeysyms._KP_Subtract
          then
-           let x, y = (display#misc)#pointer in
+           let x, y = display#misc#pointer in
            bump_scale (float x) (float y) (-1.)
          else false));
-  (display#event)#add [`KEY_PRESS];
+  display#event#add [`KEY_PRESS];
   object
     method scale_adjustment = sadj
   end
@@ -403,7 +402,7 @@ let create ?(full_screen = false) (x1, y1, x2, y2) scene =
   in
   let initial_size = 600 in
   let w = GWindow.window () in
-  ignore ((w#connect)#destroy GMain.quit);
+  ignore (w#connect#destroy GMain.quit);
   let b = GPack.hbox ~packing:w#add () in
   let f =
     scroll_view ~width:initial_size ~height:initial_size ~packing:(b#pack ~expand:true) st
@@ -431,7 +430,7 @@ Format.eprintf "%d %d %b@." x y kbd; false));
   in
   if full_screen then ignore (toggle_fullscreen ());
   ignore
-    (((w#event)#connect)#key_press (fun ev ->
+    (w#event#connect#key_press (fun ev ->
          let keyval = GdkEvent.Key.keyval ev in
          if keyval = GdkKeysyms._q || keyval = GdkKeysyms._Q
          then exit 0
diff --git a/examples/minesweeper/minesweeper.ml b/examples/minesweeper/minesweeper.ml
index d58ad8da0..5bc984421 100644
--- a/examples/minesweeper/minesweeper.ml
+++ b/examples/minesweeper/minesweeper.ml
@@ -164,7 +164,7 @@ let draw_board d =
 let disable_events d =
   for y = 0 to d.cf.nbrows - 1 do
     for x = 0 to d.cf.nbcols - 1 do
-      (d.dom.(y).(x))##.onclick
+      d.dom.(y).(x)##.onclick
       := Html.handler (fun _ ->
              Html.window##alert (js "GAME OVER");
              Js._false)

Copy link
Copy Markdown
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Dot precedence seems to work.

This two lines below have the same AST, should we add parenthesis for disambiguation ?

(a #+ b)#m #= c;;
a #+ b#m #= c;;

@gpetiot
Copy link
Copy Markdown
Collaborator Author

gpetiot commented Oct 10, 2019

The Dot precedence seems to work.

This two lines below have the same AST, should we add parenthesis for disambiguation ?

(a #+ b)#m #= c;;
a #+ b#m #= c;;

These two lines both format to (a#+b)#m#=c on this branch, so it looks good to me.

@Julow Julow merged commit 99444f3 into ocaml-ppx:master Oct 10, 2019
@gpetiot gpetiot deleted the parens-hash-op branch October 10, 2019 15:39
Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#1060) (Guillaume Petiot)
    This new profile is made to better match the most used style and is encouraged.
    To continue using the previous default, use `profile = ocamlformat` in your `.ocamlformat`.
  + CLI: Allow both values of boolean options (ocaml-ppx/ocamlformat#1062) (Jules Aguillon)
    Now, both `--opt` and --no-opt` are available on the CLI for any boolean option "opt".
    Previously, only one of them were available depending on the default value.
  + Auto mode for `break-string-literals` (ocaml-ppx/ocamlformat#1057) (Guillaume Petiot)
    `wrap`, `newlines` and `newlines-and-wrap` values of `break-string-literals` are removed.
    `auto` replaces them, it is equivalent to `newlines-and-wrap`.
  + Dock collection brackets (ocaml-ppx/ocamlformat#1014) (Guillaume Petiot)
    `after-and-docked` value of `break-separators` is removed and is replaced by a new `dock-collection-brackets` option.
  + Preserve `begin` and `end` keywords in if-then-else (ocaml-ppx/ocamlformat#978) (Jules Aguillon)
    Previously, `begin`/`end` keywords around if-then-else branches were turned into parentheses.

#### New features

  + Give a hint when warning 50 is raised (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#1077) (Jules Aguillon)
    Preserve a blank line after `let .. in` when `sequence-blank-line` set to `preserve-one`.
    Previously, only blank lines after `;` could be preserved.
  + Parse toplevel directives (ocaml-ppx/ocamlformat#1020) (Jules Aguillon)
    Allow `#directives` in `.ml` files.
    Previously, files containing a directive needed to be parsed as "use file".
    The "use file" mode is removed and `--use-file` is now the same as `--impl`.
  + Don't require `--name`, require kind, forbid `--inplace`, allow `--check`, make `--enable-outside-detected-project` implicit when reading from stdin (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#721) (Jules Aguillon)
    Formatting of documentation comments is more robust and support newer Odoc syntaxes.
    Internally, Odoc replaces Octavius as the documentation parser.

#### Bug fixes

  + Fix unstabilizing comments on assignments (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#1060) (Guillaume Petiot)
    This new profile is made to better match the most used style and is encouraged.
    To continue using the previous default, use `profile = ocamlformat` in your `.ocamlformat`.
  + CLI: Allow both values of boolean options (ocaml-ppx/ocamlformat#1062) (Jules Aguillon)
    Now, both `--opt` and --no-opt` are available on the CLI for any boolean option "opt".
    Previously, only one of them were available depending on the default value.
  + Auto mode for `break-string-literals` (ocaml-ppx/ocamlformat#1057) (Guillaume Petiot)
    `wrap`, `newlines` and `newlines-and-wrap` values of `break-string-literals` are removed.
    `auto` replaces them, it is equivalent to `newlines-and-wrap`.
  + Dock collection brackets (ocaml-ppx/ocamlformat#1014) (Guillaume Petiot)
    `after-and-docked` value of `break-separators` is removed and is replaced by a new `dock-collection-brackets` option.
  + Preserve `begin` and `end` keywords in if-then-else (ocaml-ppx/ocamlformat#978) (Jules Aguillon)
    Previously, `begin`/`end` keywords around if-then-else branches were turned into parentheses.

#### New features

  + Give a hint when warning 50 is raised (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#1077) (Jules Aguillon)
    Preserve a blank line after `let .. in` when `sequence-blank-line` set to `preserve-one`.
    Previously, only blank lines after `;` could be preserved.
  + Parse toplevel directives (ocaml-ppx/ocamlformat#1020) (Jules Aguillon)
    Allow `#directives` in `.ml` files.
    Previously, files containing a directive needed to be parsed as "use file".
    The "use file" mode is removed and `--use-file` is now the same as `--impl`.
  + Don't require `--name`, require kind, forbid `--inplace`, allow `--check`, make `--enable-outside-detected-project` implicit when reading from stdin (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#721) (Jules Aguillon)
    Formatting of documentation comments is more robust and support newer Odoc syntaxes.
    Internally, Odoc replaces Octavius as the documentation parser.

#### Bug fixes

  + Fix unstabilizing comments on assignments (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#1060) (Guillaume Petiot)
    This new profile is made to better match the most used style and is encouraged.
    To continue using the previous default, use `profile = ocamlformat` in your `.ocamlformat`.
  + CLI: Allow both values of boolean options (ocaml-ppx/ocamlformat#1062) (Jules Aguillon)
    Now, both `--opt` and --no-opt` are available on the CLI for any boolean option "opt".
    Previously, only one of them were available depending on the default value.
  + Auto mode for `break-string-literals` (ocaml-ppx/ocamlformat#1057) (Guillaume Petiot)
    `wrap`, `newlines` and `newlines-and-wrap` values of `break-string-literals` are removed.
    `auto` replaces them, it is equivalent to `newlines-and-wrap`.
  + Dock collection brackets (ocaml-ppx/ocamlformat#1014) (Guillaume Petiot)
    `after-and-docked` value of `break-separators` is removed and is replaced by a new `dock-collection-brackets` option.
  + Preserve `begin` and `end` keywords in if-then-else (ocaml-ppx/ocamlformat#978) (Jules Aguillon)
    Previously, `begin`/`end` keywords around if-then-else branches were turned into parentheses.

#### New features

  + Give a hint when warning 50 is raised (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#1077) (Jules Aguillon)
    Preserve a blank line after `let .. in` when `sequence-blank-line` set to `preserve-one`.
    Previously, only blank lines after `;` could be preserved.
  + Parse toplevel directives (ocaml-ppx/ocamlformat#1020) (Jules Aguillon)
    Allow `#directives` in `.ml` files.
    Previously, files containing a directive needed to be parsed as "use file".
    The "use file" mode is removed and `--use-file` is now the same as `--impl`.
  + Don't require `--name`, require kind, forbid `--inplace`, allow `--check`, make `--enable-outside-detected-project` implicit when reading from stdin (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#721) (Jules Aguillon)
    Formatting of documentation comments is more robust and support newer Odoc syntaxes.
    Internally, Odoc replaces Octavius as the documentation parser.

#### Bug fixes

  + Fix unstabilizing comments on assignments (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
Julow added a commit to Julow/opam-repository that referenced this pull request Nov 4, 2019
CHANGES:

#### Changes

  + Set "conventional" as the default profile (ocaml-ppx/ocamlformat#1060) (Guillaume Petiot)
    This new profile is made to better match the most used style and is encouraged.
    To continue using the previous default, use `profile = ocamlformat` in your `.ocamlformat`.
  + CLI: Allow both values of boolean options (ocaml-ppx/ocamlformat#1062) (Jules Aguillon)
    Now, both `--opt` and --no-opt` are available on the CLI for any boolean option "opt".
    Previously, only one of them were available depending on the default value.
  + Auto mode for `break-string-literals` (ocaml-ppx/ocamlformat#1057) (Guillaume Petiot)
    `wrap`, `newlines` and `newlines-and-wrap` values of `break-string-literals` are removed.
    `auto` replaces them, it is equivalent to `newlines-and-wrap`.
  + Dock collection brackets (ocaml-ppx/ocamlformat#1014) (Guillaume Petiot)
    `after-and-docked` value of `break-separators` is removed and is replaced by a new `dock-collection-brackets` option.
  + Preserve `begin` and `end` keywords in if-then-else (ocaml-ppx/ocamlformat#978) (Jules Aguillon)
    Previously, `begin`/`end` keywords around if-then-else branches were turned into parentheses.

#### New features

  + Give a hint when warning 50 is raised (ocaml-ppx/ocamlformat#1111) (Guillaume Petiot)
  + Add a message when a config value is removed (ocaml-ppx/ocamlformat#1089) (Etienne Millon)
    Explain what replaces removed options and avoid printing a parsing error.
  + Implement `sequence-blank-line=preserve-one` for let bindings (ocaml-ppx/ocamlformat#1077) (Jules Aguillon)
    Preserve a blank line after `let .. in` when `sequence-blank-line` set to `preserve-one`.
    Previously, only blank lines after `;` could be preserved.
  + Parse toplevel directives (ocaml-ppx/ocamlformat#1020) (Jules Aguillon)
    Allow `#directives` in `.ml` files.
    Previously, files containing a directive needed to be parsed as "use file".
    The "use file" mode is removed and `--use-file` is now the same as `--impl`.
  + Don't require `--name`, require kind, forbid `--inplace`, allow `--check`, make `--enable-outside-detected-project` implicit when reading from stdin (ocaml-ppx/ocamlformat#1018) (Guillaume Petiot)
  + Parse code in docstrings (ocaml-ppx/ocamlformat#941) (Guillaume Petiot)
    Format OCaml code in cinaps-style comments `(*$ code *)` and code blocks in documentation comments `(** {[ code ]} *)`.
  + Parse documentation comments with Odoc (ocaml-ppx/ocamlformat#721) (Jules Aguillon)
    Formatting of documentation comments is more robust and support newer Odoc syntaxes.
    Internally, Odoc replaces Octavius as the documentation parser.

#### Bug fixes

  + Fix unstabilizing comments on assignments (ocaml-ppx/ocamlformat#1093) (Guillaume Petiot)
  + Fix the default value documentation for `max-indent` (ocaml-ppx/ocamlformat#1105) (Guillaume Petiot)
  + Fix closing parenthesis exceeding the margin in function application (ocaml-ppx/ocamlformat#1098) (Jules Aguillon)
  + Missing break before attributes of `Pmty_with` (ocaml-ppx/ocamlformat#1103) (Josh Berdine)
  + Fix closing quote exceeding the margin (ocaml-ppx/ocamlformat#1096) (Jules Aguillon)
  + Fix break before the closing bracket of collections (exceeding the margin) (ocaml-ppx/ocamlformat#1073) (Guillaume Petiot)
  + Fix precedence of Dot wrt Hash (ocaml-ppx/ocamlformat#1058) (Guillaume Petiot)
  + Fix break in variant type definition to not exceed the margin (ocaml-ppx/ocamlformat#1064) (Guillaume Petiot)
  + Fix newlines and indentation in toplevel extension points (ocaml-ppx/ocamlformat#1054) (Guillaume Petiot)
  + Fix placement of doc comments around extensions (ocaml-ppx/ocamlformat#1052) (Jules Aguillon)
  + Inline extensions that do not break (ocaml-ppx/ocamlformat#1050) (Guillaume Petiot)
  + Add missing cut before attributes in type declarations (ocaml-ppx/ocamlformat#1051) (Guillaume Petiot)
  + Fix alignment of cases (ocaml-ppx/ocamlformat#1046) (Guillaume Petiot)
  + Fix blank line after comments at the end of lists (ocaml-ppx/ocamlformat#1045) (Guillaume Petiot)
  + Fix indexing operators precedence (ocaml-ppx/ocamlformat#1039) (Jules Aguillon)
  + Fix dropped comment after infix op (ocaml-ppx/ocamlformat#1030) (Guillaume Petiot)
  + No newline if the input is empty (ocaml-ppx/ocamlformat#1031) (Guillaume Petiot)
  + Fix unstable comments around attributes (ocaml-ppx/ocamlformat#1029) (Guillaume Petiot)
  + Fix extra blank line in sequence (ocaml-ppx/ocamlformat#1021) (Jules Aguillon)
  + Check functor arguments when computing placement of doc comments (ocaml-ppx/ocamlformat#1013) (Jules Aguillon)
  + Fix indentation of labelled args (ocaml-ppx/ocamlformat#1006) (Guillaume Petiot)
  + Fix linebreak between or-cases with comments when `break-cases=all` (ocaml-ppx/ocamlformat#1002) (Guillaume Petiot)
  + Fix unstable unattached doc comment in records (ocaml-ppx/ocamlformat#998) (Jules Aguillon)
  + Fix string literal changed (ocaml-ppx/ocamlformat#995) (Jules Aguillon)
  + Fix type variable (ocaml-ppx/ocamlformat#996) (Jules Aguillon)
  + Fix crash on extension sequence (ocaml-ppx/ocamlformat#992) (Guillaume Petiot)
  + Fix position of expressions regarding of comments in infix-op expressions (ocaml-ppx/ocamlformat#986) (Guillaume Petiot)
  + Escape special characters in external declaration (ocaml-ppx/ocamlformat#988) (Jules Aguillon)
  + Fix parens around constrained expr with attrs (ocaml-ppx/ocamlformat#987) (Guillaume Petiot)
  + Fix the margin, and correctly breaks comments (ocaml-ppx/ocamlformat#957) (Guillaume Petiot)
  + Fix formatting of custom indexing operators (ocaml-ppx/ocamlformat#975) (Guillaume Petiot)
  + Fix position of comments of labelled arrow types (ocaml-ppx/ocamlformat#976) (Guillaume Petiot)
  + No box around inline odoc styles (ocaml-ppx/ocamlformat#971) (Guillaume Petiot)
  + Fix boxing of collection expressions/patterns (ocaml-ppx/ocamlformat#960) (Guillaume Petiot)
  + Fix crash on record expr with pack fields (ocaml-ppx/ocamlformat#963) (Jules Aguillon)
  + Fix letop in subexpr (ocaml-ppx/ocamlformat#956) (hhugo)

#### Internal

  + Take file kind from --name when formatting stdin (ocaml-ppx/ocamlformat#1119) (Jules Aguillon)
  + Make Fmt.t abstract (ocaml-ppx/ocamlformat#1109) (Jules Aguillon)
  + Future-proof Fmt API in case Fmt.t goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Future-proof `Fmt` API in case `Fmt.t` goes abstract (ocaml-ppx/ocamlformat#1106) (Etienne Millon)
  + Optional names for formatting boxes in debug output (ocaml-ppx/ocamlformat#1083) (Guillaume Petiot)
  + Check ocamlformat error codes in the testsuite (ocaml-ppx/ocamlformat#1084) (Etienne Millon)
  + Clean `Translation_unit` (ocaml-ppx/ocamlformat#1078) (Guillaume Petiot)
  + Use dune file generation in test/passing/dune (ocaml-ppx/ocamlformat#1082) (Etienne Millon)
  + CI: factorize tests and check reason build (ocaml-ppx/ocamlformat#1079) (Guillaume Petiot)
  + Use short form for action in src/dune (ocaml-ppx/ocamlformat#1076) (Etienne Millon)
  + Cleanup `sequence_blank_line` (ocaml-ppx/ocamlformat#1075) (Jules Aguillon)
  + CI: use a script travis-ci.sh to simplify .travis.yml (ocaml-ppx/ocamlformat#1063) (Guillaume Petiot)
  + Remove utility functions from `Fmt_ast` (ocaml-ppx/ocamlformat#1059) (Guillaume Petiot)
  + CI: use opam-2.0.5 in Travis (ocaml-ppx/ocamlformat#1044) (Anton Kochkov)
  + CI: check the build with OCaml 4.07.1 and 4.08.0 (ocaml-ppx/ocamlformat#1036) (Jules Aguillon)
  + Use the same sets of options for both branches by default in `test_branch.sh` (ocaml-ppx/ocamlformat#1033) (Guillaume Petiot)
  + Fix `test_branch.sh` and CI checking of CHANGES.md (ocaml-ppx/ocamlformat#1032, ocaml-ppx/ocamlformat#1034) (Jules Aguillon)
  + Fix flag of git-worktree in `test_branch.sh` and `bisect.sh` (ocaml-ppx/ocamlformat#1027) (Guillaume Petiot)
  + Remove the `bisect_ppx` dependency and clean the `Makefile` (ocaml-ppx/ocamlformat#1005) (Jules Aguillon)
  + Use a `CHANGES.md` log file again (ocaml-ppx/ocamlformat#1023) (Guillaume Petiot)
  + Support OCaml 4.09.0 (add the odoc.1.4.2 dependency) (ocaml-ppx/ocamlformat#1024) (Guillaume Petiot)
  + Update labels of issue templates (ocaml-ppx/ocamlformat#1017) (Guillaume Petiot)
  + Update labels in `CONTRIBUTING.md` (ocaml-ppx/ocamlformat#1007) (Guillaume Petiot)
  + Allow to ignore invalid options (ocaml-ppx/ocamlformat#984) (hhugo)
    The `--ignore-invalid-option` flag is added to ignore invalid options in `.ocamlformat` files.
  + Improve the documentation of `--doc-comments` (ocaml-ppx/ocamlformat#982) (Jules Aguillon)
  + Remove symbolic links and change naming convention of tests (ocaml-ppx/ocamlformat#980) (Guillaume Petiot)
  + Change the type of `fmt_code` (ocaml-ppx/ocamlformat#974) (Guillaume Petiot)
  + Simplify `Makefile` (ocaml-ppx/ocamlformat#973) (hhugo)
  + Dune should not be flagged as a build dep anymore (ocaml-ppx/ocamlformat#954) (Guillaume Petiot)
bogdan2412 pushed a commit to bogdan2412/ocamlformat that referenced this pull request Mar 28, 2020
* Improve parens around hash-op
* Dot should have higher precedence than Hash
* use Dot precedence for x#y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unecessary parens on method call

3 participants