Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(syntax): Comment in line continuation with apostrophe breaks highlighting #923

Open
1 task done
albertziegenhagel opened this issue Jun 20, 2023 · 3 comments
Open
1 task done

Comments

@albertziegenhagel
Copy link
Contributor

albertziegenhagel commented Jun 20, 2023

Is there an existing issue for this?

  • 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:
image

Expected:
image

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)

@gnikit
Copy link
Member

gnikit commented Jun 22, 2023

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

@gnikit gnikit added this to To do in Version v4.0.0 via automation Jun 22, 2023
@gnikit gnikit modified the milestone: Release: v4.0.0 Jan 16, 2024
@Divyansh200102
Copy link

@albertziegenhagel is this issue still open ?

@albertziegenhagel
Copy link
Contributor Author

Yes, I can confirm that this is still an issue (checked version v3.4.2024041503).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants