Open phil-blain opened 3 years ago
@hansec gentle bump :)
@hansec another bump :) I had to patch the package on a new system since I need this fix and there has been no new releases since 2020..
@phil-blain not sure if I have already fixed this on my implementation of LSP fortls
but you can give it a go and let me know. (named has remained fortls
for people to be able to transition with ease from fortran-language-server to my version).
If not I can fix it during the weekend.
@gnikit thanks for the pointer, I was not aware of your fortls
! No need to fix it yourself though ;) https://github.com/gnikit/fortls/pull/67
The regex that checks for preprocessor macros using the
defined
operator assumes that the macro that follows the operator is between parenthesis. However, the syntax for thedefined
operator does not require parenthesis, at least in GNU Cpp [1] and Intel fpp [2], arguably the two most commonly used Fortran preprocessors.Tweak the regex by allowing the opening and closing parenthesis zero or once.
[1] https://gcc.gnu.org/onlinedocs/gcc-10.2.0/cpp/Defined.html#Defined [2] https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/optimization-and-programming-guide/fpp-preprocessing/using-fpp-preprocessor-directives.html