fprettify icon indicating copy to clipboard operation
fprettify copied to clipboard

fprettify is not idempotent if labeled statement has line continuation with leading `&`

Open e-kwsm opened this issue 4 years ago • 0 comments
trafficstars

  • fprettify: 0.3.7

Consider the following file:

program main
   integer :: x = 1
   integer :: f

   f = ((1*x + 2)*x &
        + 3)

100 f = ((1*x + 2)*x &
        + 3)

   f = ((1*x + 2)*x &
      & + 3)

200 f = ((1*x + 2)*x &
      & + 3)
end program

If fprettify is run, the file is modified as:

@@ -14,3 +14,3 @@ program main
 200 f = ((1*x + 2)*x &
-      & + 3)
+     & + 3)
 end program

A space is removed by each execution, and consequently the file becomes:

@@ -14,3 +14,3 @@ program main
 200 f = ((1*x + 2)*x &
-      & + 3)
+& + 3)
 end program

e-kwsm avatar Mar 30 '21 00:03 e-kwsm