I don't know who created the wordfile
fortran90.uew originally, but it contained some errors.
FORTRAN_LANG was twice in the first line. The second occurrence is deleted now.
The definition of the line comment was also not correct.
Line Comment = !space$space was an invalid definition of a line comment.
Some keywords were present in color group 1 as well as in color group 4.
Because I don't know anything about Fortran90 I used the information from
Fortran90 for Fortran77 Programmers to be able to help you with your syntax highlighting problem of Fortran90 comments.
In chapter
2.1 Basic Rules for both free and fixed-format there is the sentence:
End-of-line comments start with an exclamation mark (but must not be in column 6 of fixed-format code).
In chapter
2.2 Free-format layout there is the sentence:
Comments start with an exclamation mark "!'' (so C or * in column 1 have to be changed to "!'').
In UltraEdit help about syntax highlighting you can read:
FORTRAN is quite different from other languages regarding comments, and to better facilitate the use of UltraEdit for editing FORTRAN files the "FORTRAN_LANG" keyword was added. When this keyword is present, UltraEdit treats a 'C', 'c' or '*' in the first column as a line comment indicator and the rest of the line is highlighted as if it were commented out.
Note: Any of the normal comment indications may also be used (line comments, block comments).
That means that Fortran90 is different than Fortran77 regarding comments and the keyword
FORTRAN_LANG should be removed from the first line of the syntax highlighting wordfile for Fortran90 completely to not enable the special comment behavior of Fortran77 for Fortran90.
Furthermore it would be good to use
Line Comment Num = 2! Line Comment Valid Columns = [1-5,7-4095]
This means that only an exclamation mark followed by a space character is interpreted as line comment, but only when the exclamation mark does not exist in column 6. I hope the author of the referenced webpage starts counting the columns with 1 and not with 0.
Next I looked on the
/Delimiters = line and missed the space and tab character which are usually also word delimiting characters.
The 2 UltraEdit regular expression strings for finding strings of interest for the function list contained useless expressions. I removed them. I hope the following are still correct and find the strings of interest. And I missed the module names in the function list.
/Function String = "%[ ^t]+^(SUBROUTINE[ ^t]+[A-Z0-9_]+^)"
/Function String 1 = "%*^(FUNCTION[ ^t]+[A-Z0-9_]+^)("
/Function String 2 = "%[ ^t]++^(^{MODULE^}^{PROGRAM^}[ ^t]+[A-Z0-9_]+^)[ ^t]++^{!^}^{$^}"
But I think the function strings could be further improved to display in the function list either only the function names, or the function names with the arguments, or the type of function, the function name and the arguments.
First for showing only the function names in the function list:
/Function String = "%[ ^t]+SUBROUTINE[ ^t]+^([A-Z0-9_]+^)"
/Function String 1 = "%*FUNCTION[ ^t]+^([A-Z0-9_]+^)("
/Function String 2 = "%[ ^t]++^{MODULE^}^{PROGRAM^}[ ^t]+^([A-Z0-9_]+^)[ ^t]++^{!^}^{$^}"
Second for showing function names with arguments in the function list:
/Function String = "%[ ^t]+SUBROUTINE[ ^t]+^([A-Z0-9_][~^p!]++^)"
/Function String 1 = "%*FUNCTION[ ^t]+^([A-Z0-9_]+([~^p!]++^)"
/Function String 2 = "%[ ^t]++^{MODULE^}^{PROGRAM^}[ ^t]+^([A-Z0-9_]+^)[ ^t]++^{!^}^{$^}"
Third for showing type of function, function name and their arguments in the function list:
/Function String = "%[ ^t]+^(SUBROUTINE[ ^t]+[A-Z0-9_][~^p!]++^)"
/Function String 1 = "%*^(FUNCTION[ ^t]+[A-Z0-9_]+([~^p!]++^)"
/Function String 2 = "%[ ^t]++^(^{MODULE^}^{PROGRAM^}[ ^t]+[A-Z0-9_]+^)[ ^t]++^{!^}^{$^}"
You can make other combinations by just moving
^( and
^) inside the function strings to define what should be displayed in the function list view.
I could not try excessive any of these regular expressions because I don't have Fortran90 files for evaluating them.
Next I thought the lines
/Open Brace Strings = "("
/Close Brace Strings = ")"
for highlighting matching parenthesis would be useful too.
Then I added
"ELSE" to the
/Unindent Strings = because the line with this keyword must be unindented and the next line is again indented. This is useful when using the auto-indent feature of UltraEdit.
I thought code folding can be also very useful for Fortran90 files and added following two lines:
/Open Fold Strings = "FUNCTION" "MODULE" "PROGRAM" "SUBROUTINE" "THEN" "ELSE" "DO"
/Close Fold Strings = "END FUNCTION" "END MODULE" "END PROGRAM" "END SUBROUTINE" "ELSE" "END IF" "END DO"
Note: According to the referenced page
"ENDIF" and
"ENDDO" would be also valid which is the reason why the unindent strings contain both. If you use
"ENDIF" and
"ENDDO" instead of
"END IF" and
"END DO" you have to remove the space in the last 2 close fold strings.
Last I used my
3 wordfile syntax checking macros to sort the keywords and remove duplicate keywords.
Added on 2010-01-10:
According to last post of
javiergp and the contribution of another user the final wordfile
fortran90.uew contains only 1 simple function string:
/Function String = "^(^{SUBROUTINE^}^{FUNCTION^}[ ^t]+[A-Z0-9_]+^)("
And
Line Comment Valid Columns = [1-5,7-4095] was replaced by
Line Comment Alt = !! in the first line.
The main wordfile
fortran90.uew with the single function string is on IDM's server and can be downloaded from
Extra Downloads - Wordfiles.