FORTRAN keyword issues

Discuss syntax highlighting or submit new syntax files.
Post Reply
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

FORTRAN keyword issues

Post by jgodfrey »

Something odd is happening with my (very basic) FORTRAN syntax highlighter. All of my keywords are stored in the syntax file in lowercase, but the file is marked as not case sensitive. I've verified that *all* of the defined keywords are properly colorized when written in lower case. However, only *most* of them are properly recognized when written in upper case. There are 16 keywords that get missed when they're written in caps, as illustrated in the attached image:

The color scheme used in the image uses black for keywords and orange for standard text (just for visual clarity). So, as you can see, all lowercase items are recognized, and all uppercase items are not. Again, I'm only showing the ones that fail to match in uppercase. All others work properly in both cases.

The keywords shown were cut/pasted directly from the syntax file, so they haven't been retyped in any way (so, no typos or strange chars).

I can provide additional files as necessary. Any ideas?

Jeff
Attachments
fortran_keyword_miss.png
fortran_keyword_miss.png (7.23 KiB) Viewed 17155 times
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: FORTRAN keyword issues

Post by jgodfrey »

Rickard,

I thought I'd go ahead and include the above word list and the syntax files for your review.

Thanks,

Jeff

Code: Select all

        allocatable ALLOCATABLE
        allocate    ALLOCATE              
        backspace   BACKSPACE    
        deallocate  DEALLOCATE      
        equivalence EQUIVALENCE      
        function    FUNCTION                        
        implicit    IMPLICIT         
        include     INCLUDE                  
        interface   INTERFACE        
        intrinsic   INTRINSIC        
        logical     LOGICAL                     
        procedure   PROCEDURE                 
        public      PUBLIC                          
        recursive   RECURSIVE                   
        select      SELECT           
        sequence    SEQUENCE 
Attachments
fortran.zip
(1.1 KiB) Downloaded 710 times
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: FORTRAN keyword issues

Post by Rickard Johansson »

They all contain a "C" which is used as a line comment. It seems using an alphanumeric character as line comment can interfere with keyword identification. I'll look into it.
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: FORTRAN keyword issues

Post by jgodfrey »

Rickard Johansson wrote:They all contain a "C" which is used as a line comment. It seems using an alphanumeric character as line comment can interfere with keyword identification. I'll look into it.
That's an interesting observation, and I think you're right with one caveat. It only seems to impact the uppercase version of keywords that *contain* a "C", though keywords that *start* with "C" are fine.

Jeff
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: FORTRAN keyword issues

Post by Rickard Johansson »

It's been fixed. I'll release a new beta so please check when available.
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: FORTRAN keyword issues

Post by jgodfrey »

Rickard Johansson wrote:It's been fixed. I'll release a new beta so please check when available.
Will do - thank you.
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: FORTRAN keyword issues

Post by jgodfrey »

Rickard Johansson wrote:It's been fixed. I'll release a new beta so please check when available.
This seems to work exactly as expected - thanks.
Post Reply