fortran-lang / fortls

fortls - Fortran Language Server
https://fortls.fortran-lang.org/
MIT License
255 stars 40 forks source link

IMPLICIT statement without enclosing scope #264

Open warrenstephens opened 1 year ago

warrenstephens commented 1 year ago

The fortls linter gives an IMPLICIT statement without enclosing scope on the IMPLICIT statement like this:

      BLOCKDATA
      IMPLICIT NONE
      COMMON /GRAPHQWDATA/ CCLIENT
      CHARACTER*8 CCLIENT
      DATA CCLIENT /'SCANMF'C/
      ENDBLOCKDATA

A red underline is on the word NONE.

Moved to inside the COMMON it says the same thing.

This is with the Modern Fortran v3.2.0 extension in VS Code. The fortls version is 2.13.0

The block is followed by a PROGRAM, and so forth.

gnikit commented 1 year ago

Thanks for the issue @warrenstephens, if I had to guess why that is I would say that it probably related to how we serve diagnostics and in general processes BLOCK DATA, DATA and COMMON statements. A lot of the Fortran77 features that have been superseded by Fortran 90+ features are not that well supported.

I will investigate this further.

warrenstephens commented 1 year ago

You are welcome! 😉

I have lots of old code, but only a few COMMON blocks to deal with while reviving an old project which is mostly F90.

Modernizing with Intel oneAPI Fortran, also a fan of VScode.