fortran-lang / fprettify

auto-formatter for modern fortran source code
https://pypi.python.org/pypi/fprettify
Other
368 stars 73 forks source link

Support for coarray syntax #151

Open hheinzer opened 1 year ago

hheinzer commented 1 year ago

With the new Fortran coarrays, formatting results are slightly awkward:

real, allocatable :: a(:)[:]

is formatted into

real, allocatable :: a(:) [:]

Every time the [] operator appears, fprettify inserts a space before it.

The syntax for coarrays requires you to always put an index range () before using the codimension []. This might simplify an implementation.