fortran-lang / fortls

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

bug(preprocessor): incorrect evaluation of local scopes #332

Closed gnikit closed 1 year ago

gnikit commented 1 year ago

Describe the bug The preprocessor stack that would conditionally and locally be used to define a variable do not work.

To Reproduce

subroutine preprocessor_else(var)

#if 0
#define MYTYPE logical
#else
#define MYTYPE integer
#endif

MYTYPE :: var0  !< incorrect evaluation of MYTYPE

#undef MYTYPE

#if 1
#define MYTYPE real
#else
#define MYTYPE character
#endif

MYTYPE :: var1

endsubroutine preprocessor_else

Setup information (please complete the following information):