After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730130 - Fortran Language file: Add support for OpenMP directives
Fortran Language file: Add support for OpenMP directives
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-14 13:50 UTC by Fulguritus
Modified: 2014-05-16 17:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch introducing OpenMP directives for Fortran (1.70 KB, patch)
2014-05-14 13:50 UTC, Fulguritus
reviewed Details | Review
Updated patch (3.22 KB, patch)
2014-05-15 14:13 UTC, Fulguritus
committed Details | Review

Description Fulguritus 2014-05-14 13:50:42 UTC
Created attachment 276535 [details] [review]
Patch introducing OpenMP directives for Fortran

OpenMP directives are preceded by `!$` or `^[Cc]$`. They either contain compiler directives like 

!$omp parallel do
do i=1,100
  a(i) = i*i
enddo
!$omp end parallel do

or Fortran statements that are executed when OpenMP is enabled in the compiler:

!$ use omp_lib
!$ real*8 :: t1

!$ t1 = omp_get_wtime()

If OpenMP is disabled, these directives are treated as regular comments. 

The attached patch treats lines starting with `!$` or `^[Cc]$` as preprocessor directives for coloring.
Comment 1 Fulguritus 2014-05-14 17:57:09 UTC
Also, see this SO issue: https://stackoverflow.com/questions/23081274/openmp-syntax-highlighting-in-gedit
Comment 2 Sébastien Wilmet 2014-05-15 13:33:31 UTC
Review of attachment 276535 [details] [review]:

The patch looks good.
It would be nice to add an example in tests/testfiles.sh.
And it's easier for us if you create the patch with the "git format-patch" command, so we have a commit message and the author.
Comment 3 Fulguritus 2014-05-15 14:13:40 UTC
Created attachment 276604 [details] [review]
Updated patch
Comment 4 Fulguritus 2014-05-15 14:14:00 UTC
Is that better?
Comment 5 Sébastien Wilmet 2014-05-16 17:12:19 UTC
Comment on attachment 276604 [details] [review]
Updated patch

I've pushed the commit with small fixes:
- the commit message, it must be one short line, followed by a blank line and then the long description (see the HACKING file for more details).
- remove trailing spaces

Also, when you update a patch, mark the old one as obsolete.