vscode-fortran-support
vscode-fortran-support copied to clipboard
bug(syntax): Comment in line continuation with apostrophe breaks highlighting
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
In fixed-form Fortran, if I have a function call that spreads over multiple lines and somewhere in the middle of those lines there is a comment line (starting with a c
in the first column) that includes an apostrophe ('
) the syntax highlighting is completely messed up after the apostrophe.
It seems that the comment line is not recognized correctly and then the apostrophe starts a string literal that is never matched. If I use an exclamation mark (!
) instead of the c
to start the comment line, the comment seems to get recognized correctly.
Screenshots
Incorrect:
Expected:
Code Example
call foo(a,
& b,
c I don't like this comment
& d)
Minimal, compiling program:
program hello
print*, sign(1,
c I don't like this comment
& -5)
end program hello
Fortran Version (Free/Fixed Form)
Fixed Form e.g. F77
Version of Modern Fortran
v3.4.2023053001
Version of Visual Studio Code
1.79.2
Platform and Architecture
Windows
Additional Information
No response
Edit: added a minimal example that is a valid, compiling program (tested with gfortran and ifort)
I will have to have a more detailed look in the grammar syntax files to make sure, but I suspect that there line continuation condition for fixed form is either wrong. I will add this to the backlog
@albertziegenhagel is this issue still open ?
Yes, I can confirm that this is still an issue (checked version v3.4.2024041503
).