Closed Beliavsky closed 6 years ago
This is a feature since some people prefer to not indent deeply nested loops. So if a nested loop is not indented, fprettify does not impose indentation on the inner loop. However if you change your code to:
program main
integer :: i,j
do i=1,2
do j=1,3
print*,i,j,i*j
end do
end do
end program main
fprettify will assume that you want to indent the nested loop and therefore change the code to
program main
integer :: i, j
do i = 1, 2
do j = 1, 3
print *, i, j, i*j
end do
end do
end program main
It would be nice if fprettify had an option to transform the original un-indented code to the last code you displayed, with each loop indented.
to strictly indent nested loops, you can now invoke fprettify as:
fprettify.py --strict-indent
Fprettify changes the code
to
I would like each loop to be indented, not just the inner-most loop.