dparkins / language-fortran

Syntax highlighting for FORTRAN for atom
MIT License
35 stars 16 forks source link

highlighting error with VALUE keyword in fixed format FORTRAN #109

Open capitalaslash opened 5 years ago

capitalaslash commented 5 years ago

To my understanding, VALUE is a keyword only in FORTRAN 2003 and later, it should not be treated as such in older FORTRAN formats. An example:

      FOO = VALUE ('BAR')

this line screws up the highlighting with Fortran - fixed form

tomedunn commented 5 years ago

Modern Fortran can be written using either the fixed form or free form format. So it's correct to have the VALUE keyword marked in both formats. However, the problem you've run into is also a problem in Fortran - free form. It stems from the fact that the rules for Attribute Specification Statements don't check for whether they are at the beginning of a line or not. This is conceptually easy to solve but the way Atom's grammar system works make it hard to do so for Fortran in particular. In the mean time, you can get around this problem with the following hack:

FOO = (VALUE ('BAR'))