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 143970 - Syntax highlighting for Fortran
Syntax highlighting for Fortran
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2004-06-08 18:43 UTC by John Spray
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fortan 95 syntax file (2.43 KB, text/plain)
2004-06-08 18:43 UTC, John Spray
  Details
Some Fortran. (1.90 KB, text/x-fortran)
2004-07-20 10:16 UTC, John Spray
  Details
Some more fortran (8.34 KB, text/x-fortran)
2004-07-20 10:17 UTC, John Spray
  Details
Second try at fortran 95 syntax highlighting file (9.34 KB, text/plain)
2004-07-23 22:25 UTC, John Spray
  Details
A couple of additions (955 bytes, patch)
2004-09-22 14:34 UTC, John Spray
none Details | Review

Description John Spray 2004-06-08 18:43:17 UTC
Please find attached a .lang file for Fortran 95.  It's not comprehensive or
complicated, but it's better than nothing.
Comment 1 John Spray 2004-06-08 18:43:58 UTC
Created attachment 28481 [details]
Fortan 95 syntax file
Comment 2 Paolo Maggi 2004-07-20 09:59:11 UTC
Sorry for the late reply.

May you please attach a couple of Fortran 95 files, so that I can test your
.lang file? Note that I don't know Fortran.

Thanks.
Paolo
Comment 3 John Spray 2004-07-20 10:16:31 UTC
Created attachment 29684 [details]
Some Fortran.
Comment 4 John Spray 2004-07-20 10:17:01 UTC
Created attachment 29685 [details]
Some more fortran
Comment 5 Paolo Maggi 2004-07-21 09:50:56 UTC
Comment on attachment 28481 [details]
Fortan 95 syntax file

Testing the .lang file with the samples you sent me I have seen some problems:

- enddo is not higlighted
- Shouldn't PARAMETER, INTENT, DIMENSION, etc. be highlighted too?
- "sin" is not hightlighted
- I don't like "String_doublequotes" an d "String_singlequotes" names. Do not
use "_" in names.
- The following warning is displayed in the console:
"(gedit:20602): Gtk-WARNING **: Failed to set label from markup due to error
parsing markup: Error on line 2: Character '=' is not valid inside an entity
name".

Could you please try to fix these problems?

Normally I try to use the same colors as Vim and use the Vim syntax files as a
starting point.
Comment 6 Paolo Maggi 2004-07-21 10:02:17 UTC
The warning 
"(gedit:20602): Gtk-WARNING **: Failed to set label from markup due to error
parsing markup: Error on line 2: Character '=' is not valid inside an entity
name" is not due to your .lang file. Sorry.
Comment 7 John Spray 2004-07-23 22:25:33 UTC
Created attachment 29840 [details]
Second try at fortran 95 syntax highlighting file

This version includes the intrinsic functions (such as sin) listed in the vim
syntax file, as well as some other additions.

It remains non-comprehensive, but should be substantially less likely to raise
eyebrows than the previous version.

One known limitation is that it fails to distinguish between the use of a type
name in a declaration, and its use in the function.  I don't understand the vim
syntax file well enough to see how to do that.
Comment 8 Gustavo Giráldez 2004-08-09 02:58:10 UTC
Thanks, I just committed the file.  Please feel free to close the bug if you
feel the limitation is not very important.  I don't know Fortran so I can't
tell.  We can always reopen later, or open new bugs.

Comment 9 John Spray 2004-09-22 14:34:00 UTC
Created attachment 31833 [details] [review]
A couple of additions

-Add support for ancient-style line comments (a line beginning with C)
-Add "data","block data","common" keywords
Comment 10 Paolo Maggi 2004-12-07 14:56:28 UTC
I have just committed a modified version of the last John' patch.

Closing.

Jonh: feel free to open a new bug if you feel that the limitation of the current
fortran.lang file are important.