Skip to content

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

@gnikit

Description

@gnikit

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):

  • OS: any
  • Python Version [e.g. 3.10]
  • fortls version: master
  • Code editor used [e.g. VS Code, Vim]
  • the Fortran extension for the code editor and its version [e.g. Modern Fortran v3.0.0] (if applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparser: nativeIssues related with the native parser of fortls

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions