jEdit Community - Resources for users of the jEdit Text Editor
Some keywords not recognised for highlighting
Submitted by ClivePage on Monday, 10 May, 2010 - 14:27
I'm using Jedit version 4.3.1 on Windows XP, and editing some Fortran90. The syntax highlighting mostly works very well, but a few Fortran keywords did not get recognised (so they did not benefit from highlighting, and the Macro to convert all keywords to upper-case didn't work on them either).

For example data types INTEGER and REAL got recognised, but COMPLEX and DOUBLE PRECISION did not. And while nearly all other statement keywords in the code were ok, the CONTAINS statement was not.

I checked the fortran.xml file and all of these are present, so it's not obvious to me why a few keywords do not get recognised in my code.

I'm not sure if this is a bug, or just a feature, or if there's something in the way I have used these keywords that has confused the parser.

Here's a trivial example:

PROGRAM quadratic
IMPLICIT NONE
REAL :: a, b, c, term, root1, root2
COMPLEX :: cterm, croot1, croot2
PRINT *, 'Enter a, b, c:'
READ *, a, b, c

All keywords except COMPLEX are highlighted here.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Comments
by Robert Schwenn on Mon, 10/05/2010 - 21:01
All lines beginning with "*", "!", "C", or "D" are defined as comments. If You don't like this You could comment out the related lines in the mode file.

So, I'm very sure that Your line "COMPLEX :: cterm, croot1, croot2" is highlighted as comment1. With at least a leading space it isn't.

Robert
 
Thanks, very much: that sound
by ClivePage on Mon, 10/05/2010 - 22:46
Thanks, very much: that sounds like a good explanation.

It isn't sensible behaviour of course, as C and D only introduce comments in the antique fixed-format layout, (and only C has ever been standard Fortran). All sensible programmers using Fortran90/95/2003/2008 will have adopted free-format layout, so neither C nor D should introduce comments.

I now know what to look for in the fortran.xml file, and will see if I can fix that.
 
Patch
by Robert Schwenn on Thu, 13/05/2010 - 13:21
It would be nice if You'd send the result to the jEdit Patches tracker: https://sourceforge.net/tracker/?atid=300588&group_id=588&func=browse.
User login
Browse archives
« November 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300