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

Added the right delimiter for modern fortran #186

Closed
wants to merge 6 commits into from
Closed

Added the right delimiter for modern fortran #186

wants to merge 6 commits into from

Conversation

gnikit
Copy link

@gnikit gnikit commented Sep 19, 2019

This merge solves the issue highlighted in #185 .
Might be worth adding some regression testing like the one already in place for this type of fortran comments.

@gnikit
Copy link
Author

gnikit commented Sep 19, 2019

I also updated the buildbot because seeing it fail annoyed me.

@aaron-bond
Copy link
Owner

Thanks for the PR. Could you add samples for the new formats in the test/samples folder?

Also, could you check the indentation on the case..switch statement to keep it consistent with what's already there?

@gnikit
Copy link
Author

gnikit commented Sep 22, 2019

I added some example code for new and old fortran and made the indentation consistent.
Does it look okay now?

@gnikit
Copy link
Author

gnikit commented Oct 21, 2019

This merge should probably be postponed for a bit, since the implemented changes cause incorrect coloring of stringsprint*, "something important!!! something else". I'll have a look during to see if there is an easy fix.

@breengles
Copy link

This merge should probably be postponed for a bit, since the implemented changes cause incorrect coloring of stringsprint*, "something important!!! something else". I'll have a look during to see if there is an easy fix.

Hi, no news about that for FreeForm? 🤔

@gnikit
Copy link
Author

gnikit commented Nov 13, 2019

Yeah, this is not fortran specific, so the PR is fine. I believe that in any language, if the delimiter character is used within a comment followed by one of the reserved characters, the same behaviour listed above will occur.
e.g. in Python
# Comment #! this is red,
""" Comment #! this is red """
or
print("#! this is red")

I believe this would require a bit of a rewrite of the extension so as to escape string chars in all supported languages with comment characters in them.

@gnikit
Copy link
Author

gnikit commented Nov 16, 2019

I made a new issue addressing this string highlighting behaviour #202 .

@gnikit
Copy link
Author

gnikit commented Jul 21, 2020

Hi @aaron-bond any chance we could merge this to master?

@Arsennnic
Copy link

Arsennnic commented Jan 20, 2021

@gnikit your commits seem useful.
Since @aaron-bond has not merged your commits, how could I manually install your modified plugin?

@gnikit
Copy link
Author

gnikit commented Jan 20, 2021

@gnikit your commits seem useful.
Since @aaron-bond has not merged your commits, how could I manually install your modified plugin?

The best solution would be for someone with write access to this repo to merge this branch and publish a new version of the extension, but for some reason this has yet to happen.

You could go and manually edit parser.js, where the extension is installed, with the code that I added in parser.ts but beware that if you have extension syncing enabled these changes will be overwritten whenever the extensions are synced with your GitHub/Microsoft account. So really the only solution is for @aaron-bond to merge this to master.

@Arsennnic one more thing I should probably point out about this extension and Fortran code is that !! in Fortran is used by default in Doxygen documentation as continuation characters. Using this extension with Doxygen-styled docstrings will cause them to be highlighted in bright red, which can be a bit annoying for some.

@Arsennnic
Copy link

@gnikit your commits seem useful.
Since @aaron-bond has not merged your commits, how could I manually install your modified plugin?

The best solution would be for someone with write access to this repo to merge this branch and publish a new version of the extension, but for some reason this has yet to happen.

You could go and manually edit parser.js, where the extension is installed, with the code that I added in parser.ts but beware that if you have extension syncing enabled these changes will be overwritten whenever the extensions are synced with your GitHub/Microsoft account. So really the only solution is for @aaron-bond to merge this to master.

@Arsennnic one more thing I should probably point out about this extension and Fortran code is that !! in Fortran is used by default in Doxygen documentation as continuation characters. Using this extension with Doxygen-styled docstrings will cause them to be highlighted in bright red, which can be a bit annoying for some.

Thanks! I have managed to do this. I wrote this down for others who may need help.
In parser.js I added following lines for setDelimiter(languageCode):

case "FortranFreeForm":
  this.delimiter = "!";
  break;
case "fortran_fixed-form":
  this.delimiter = "c";
  break;

@gnikit gnikit closed this by deleting the head repository Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants