Fortran90 OpenMP directives -- syntax highlighting?
Tony Balinski
ajbj at free.fr
Wed Sep 23 06:31:33 CEST 2009
Quoting "Carlie J. Coats" <coats at baronams.com>:
>
> Fortran OpenMP directives look something like the following example:
>
> !$OMP PARALLEL DO DEFAULT( NONE ), &
> !$OMP& SHARED( C1, C2, R1, R2, DH, KH, SFCHEADRT ), &
> !$OMP& PRIVATE( I, J, K, C, R ), &
> !$OMP& SCHEDULE( DYNAMIC )
>
> where a directive is started by a "!$OMP", and continued by a
> "&\n!$OMP&". It would be nice to have them highlighted in some
> fashion. I've tried to treat them as "Preprocessor" style by
> adding a "Directive:"^!\$OMP":"$"::Preprocessor::\n\" line
> to the Fortran90 "nedit.highlightPatterns" in my RC file (not
> a full-strength description of the directives, but for a first
> cut, it should help), and that didn't work for me. I'm probably
> missing something obvious;-(
>
> How *should* I do it?
Use the syntax highlighting dialog to do this instead of adding the line by
hand (or just put a second backslash in front of $OMP). In the neditrc file,
backslash is an escape character, so in your line, just makes $ explicit. But
what you want is to have backslash in your regex, so you need two. If you'd
used the dialog, you'd have typed ^!\$OMP as your start regex and it would
have been saved correctly when you save preferences.
Tony
More information about the Discuss
mailing list