Page 1 of 1

FORTRAN keyword issues

Posted: 30 Aug 2011 00:42
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

Re: FORTRAN keyword issues

Posted: 30 Aug 2011 01:09
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 

Re: FORTRAN keyword issues

Posted: 30 Aug 2011 07:57
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.

Re: FORTRAN keyword issues

Posted: 30 Aug 2011 15:42
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

Re: FORTRAN keyword issues

Posted: 30 Aug 2011 23:34
by Rickard Johansson
It's been fixed. I'll release a new beta so please check when available.

Re: FORTRAN keyword issues

Posted: 30 Aug 2011 23:40
by jgodfrey
Rickard Johansson wrote:It's been fixed. I'll release a new beta so please check when available.
Will do - thank you.

Re: FORTRAN keyword issues

Posted: 04 Sep 2011 16:16
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.