fortran-lang / fprettify

auto-formatter for modern fortran source code

Home Page:https://pypi.python.org/pypi/fprettify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

e-kwsm opened this issue · comments

  • 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