Fortran-FOSS-Programmers / ford

Automatically generates FORtran Documentation from comments within the code.
https://forddocs.readthedocs.io
GNU General Public License v3.0
402 stars 131 forks source link

Issue with the BLOCK Statement #638

Closed JulesKouatchou closed 4 months ago

JulesKouatchou commented 4 months ago

Hi Peter,

I am trying to generate a documentation with Ford (7.0.3). Ford fails in files that have BLOCK/END BLOCK statements. When I comment out only the lines with BLOCK and END BLOCK, I do not have a problem.

Any pointer you provide will be appreciated. The link to the sample code is below.

Thank you for your assistance.

Cheers,

Jules


The code is in a tar.gzip file:

https://drive.google.com/file/d/1M2YzF8gj_XuttNdlPlWh9jl_Vo4s-0oR/view?usp=sharing

It has the following directory structure:

reproducer/
reproducer/docs/
reproducer/gFTL/
reproducer/gridcomps/
reproducer/include/

To run Ford, go to reproducer/docs/Ford/ and issue the command:

ford docs-with-remote-esmf.md

You will get the error message:

reproducer/gridcomps/cap3g/CapGridComp.F90
ERROR in file 'CapGridComp.F90': Unexpected variable in sourcefile 'CapGridComp.F90':
        type(PrivateWrapper) :: w
ERROR in file 'CapGridComp.F90': END statement outside of any nesting:
        end block
ERROR in file 'CapGridComp.F90': END statement outside of any nesting:
        end subroutine init
  Parsing files         ━━━━━━━━━━━━━━━━━━━━━━ 100% 2/2 0:00:00 0:00:00 ../../gridcomps/cap3g/CapGridComp.F90
Traceback (most recent call last):

The file reproducer/gridcomps/cap3g/CapGridComp.F90 relies on the include reproducer/include/MAPL_private_state.h where macros (having BLOCK/END BLOCK statements) are defined.

ZedThree commented 4 months ago

Thanks for the bug report and reproducer @JulesKouatchou! I have a fix for this