Skip to content

Fix comments' placement (do not look at loc_stack)#923

Merged
gpetiot merged 1 commit intoocaml-ppx:masterfrom
gpetiot:no-loc-stack
Jul 31, 2019
Merged

Fix comments' placement (do not look at loc_stack)#923
gpetiot merged 1 commit intoocaml-ppx:masterfrom
gpetiot:no-loc-stack

Conversation

@gpetiot
Copy link
Copy Markdown
Collaborator

@gpetiot gpetiot commented Jul 11, 2019

Fix #917, will be reverted with #921

Diff of test_branch:

diff --git a/infer/src/base/ProcessPool.ml b/infer/src/base/ProcessPool.ml
index 988426188..b4b541ec0 100644
--- a/infer/src/base/ProcessPool.ml
+++ b/infer/src/base/ProcessPool.ml
@@ -292,7 +292,8 @@ let rec child_loop ~slot send_to_parent receive_from_parent ~f =
                 false )
               else (
                 (* crash hard, but first let the master know that we have crashed *)
-                send_to_parent (Crash slot) ; true )) ) ;
+                send_to_parent (Crash slot) ;
+                true )) ) ;
       child_loop ~slot send_to_parent receive_from_parent ~f
 
 
diff --git a/infer/src/biabduction/Abs.ml b/infer/src/biabduction/Abs.ml
index 71caec743..3bedc6414 100644
--- a/infer/src/biabduction/Abs.ml
+++ b/infer/src/biabduction/Abs.ml
@@ -481,8 +481,7 @@ let typ_get_recursive_flds tenv typ_exp =
           L.(debug Analysis Quiet)
             "@\ntyp_get_recursive_flds: unexpected %a unknown struct type: %a@." Exp.pp typ_exp
             Typ.Name.pp name ;
-          []
-      (* ToDo: assert false *) )
+          [] (* ToDo: assert false *) )
     | Tint _ | Tvoid | Tfun _ | Tptr _ | Tfloat _ | Tarray _ | TVar _ ->
         [] )
   | Exp.Var _ ->
diff --git a/infer/src/biabduction/Rearrange.ml b/infer/src/biabduction/Rearrange.ml
index aff0994dd..ed9729a30 100644
--- a/infer/src/biabduction/Rearrange.ml
+++ b/infer/src/biabduction/Rearrange.ml
@@ -981,7 +981,8 @@ let add_guarded_by_constraints tenv prop lexp pdesc =
         else if (* we don't know if we have the lock or not. *)
                 should_warn pdesc then (
           (* non-private method; can't ensure that the lock is held. warn. *)
-          warn accessed_fld guarded_by_str ; prop )
+          warn accessed_fld guarded_by_str ;
+          prop )
         else
           (* private method. add locked proof obligation to [pdesc] *)
           Attribute.add tenv ~footprint:true prop Alocked [guarded_by_exp]
diff --git a/infer/src/checkers/functionPointers.ml b/infer/src/checkers/functionPointers.ml
index e6e8e35b2..05ebde1b8 100644
--- a/infer/src/checkers/functionPointers.ml
+++ b/infer/src/checkers/functionPointers.ml
@@ -55,7 +55,7 @@ let find_procname var astate =
         Some procname
     | IContainer.More ->
         Some (ProcnameSet.min_elt procnames)
-    (* TODO: handle multiple procnames, e.g. with non-determinism branching *) )
+        (* TODO: handle multiple procnames, e.g. with non-determinism branching *) )
   | None ->
       None
 
diff --git a/compiler/lib/js_output.ml b/compiler/lib/js_output.ml
index bdb38fc8a..f96034bd3 100644
--- a/compiler/lib/js_output.ml
+++ b/compiler/lib/js_output.ml
@@ -990,7 +990,7 @@ struct
           last_semi ();
           PP.end_group f;
           PP.end_group f
-      (* There MUST be a space between the return and its
+          (* There MUST be a space between the return and its
        argument. A line return will not work *)
       )

@gpetiot gpetiot changed the title [TMP] Do not look at loc_stack Fix comments' placement (do not look at loc_stack) Jul 30, 2019
@gpetiot gpetiot requested a review from Julow July 30, 2019 10:43
@gpetiot gpetiot mentioned this pull request Jul 30, 2019
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.

This is fixing some bugs but add some.

2
let _ = 2 (* a *)

(* b *)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is wrong. The original code was:

let _ =
  ( (* a *) ( (* b *) 2 ))

let _ = 'a'

let _ = (* test *) "asd"
let _ = "asd" (* test *)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should be on the left, was:

let _ = ((* test *)"asd" )

({f; g} (* 3 *) as (* 4 *) x)
(* 5 *)
(* 6 *) =
~x:(* 1 *) ((* 2 *) {f; g} (* 3 *) as (* 4 *) x (* 5 *)) (* 6 *) =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(* 1 *) is still wrong, it should be before ~x.

@gpetiot gpetiot merged commit 5b76d0d into ocaml-ppx:master Jul 31, 2019
@gpetiot gpetiot deleted the no-loc-stack branch July 31, 2019 09:28
gpetiot added a commit that referenced this pull request Jul 31, 2019
hhugo pushed a commit that referenced this pull request Aug 25, 2019
gpetiot added a commit that referenced this pull request Aug 28, 2019
gpetiot added a commit that referenced this pull request Sep 2, 2019
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.

comments moving in ways that change their meaning

3 participants