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

Indentation broken for named select case statements

wpbonelli opened this issue · comments

Normal select case statements are formatted properly, e.g.

program test
    character :: c
  c = 'a'
select case (c)
  case ('b')
        print *, c
    case default
    print *, 'default'
  end select
end program test

becomes

program test
   character :: c
   c = 'a'
   select case (c)
   case ('b')
      print *, c
   case default
      print *, 'default'
   end select
end program test

Adding a name breaks the nested indentation so this

program test
    character :: c
  c = 'a'
l: select case (c)
  case ('b')
        print *, c
    case default
    print *, 'default'
  end select l
end program test

becomes

program test
   character :: c
   c = 'a'
   l:select case(c)
   case ('b')
   print *, c
   case default
   print *, 'default'
   end select l
end program test

This does not seem to apply to other named constructs, e.g. named do loops are reformatted properly.

I think this is #152?

sorry @dbroemmel, I missed that issue. Closing this duplicate

No problem at all, simply wanted to avoid duplicate work. Also nice to see that others face similar difficulties as I do.