| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language [ |
| 3 |
<!-- Integers with optional kind specifier --> |
| 4 |
<!ENTITY integer "\b[0-9]++(?:[_](?:[0-9]++|[a-zA-Z][\w_]*))?"> |
| 5 |
<!-- Integers in binary, octal and hexadecimal notations --> |
| 6 |
<!ENTITY baseinteger "\b[bozx](?:['][0-9a-fA-F]++[']|["][0-9a-fA-F]++["])"> |
| 7 |
<!-- Floating-point numbers with optional kind --> |
| 8 |
<!ENTITY float1 "[0-9]*+\.[0-9]++(?:[de][+-]?[0-9]+)?(?:[_](?:[0-9]++|[a-z][\w_]*))?"> |
| 9 |
<!ENTITY float2 "\b[0-9]++\.[0-9]*+(?:[de][+-]?[0-9]+)?(?:[_](?:[0-9]++|[a-z][\w_]*))?(?![a-z])"> |
| 10 |
<!ENTITY float3 "\b[0-9]++[de][+-]?[0-9]++(?:[_](?:[0-9]++|[a-z][\w_]*))?"> |
| 11 |
]> |
| 12 |
<language name="Fortran (Fixed Format)" version="11" kateversion="5.44" section="Sources" extensions="*.f;*.F;*.for;*.FOR;*.fpp;*.FPP;" mimetype="text/x-fortran-src" casesensitive="0" author="Franchin Matteo ([email protected])" license="MIT" priority="9"> |
| 13 |
<!-- by Franchin Matteo, [email protected] --> |
| 14 |
<!-- NOTE: Keep in sync with the "Fortran (Free Format)" highlighter! (fortran-free.xml) --> |
| 15 |
<highlighting> |
| 16 |
|
| 17 |
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> |
| 18 |
<!-- * L I S T S * --> |
| 19 |
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> |
| 20 |
<list name="keywords"> |
| 21 |
<item>allocate</item> |
| 22 |
<item>break</item> |
| 23 |
<item>call</item> |
| 24 |
<item>common</item> |
| 25 |
<item>continue</item> |
| 26 |
<item>cycle</item> |
| 27 |
<item>deallocate</item> |
| 28 |
<item>forall</item> |
| 29 |
<item>where</item> |
| 30 |
<item>elsewhere</item> |
| 31 |
<item>equivalence</item> |
| 32 |
<item>exit</item> |
| 33 |
<item>external</item> |
| 34 |
<item>for</item> |
| 35 |
<item>go</item> |
| 36 |
<item>goto</item> |
| 37 |
<item>if</item> |
| 38 |
<item>implicit</item> |
| 39 |
<item>include</item> |
| 40 |
<item>interface</item> |
| 41 |
<item>intrinsic</item> |
| 42 |
<item>namelist</item> |
| 43 |
<item>none</item> |
| 44 |
<item>nullify</item> |
| 45 |
<item>operator</item> |
| 46 |
<item>assignment</item> |
| 47 |
<item>pause</item> |
| 48 |
<item>procedure</item> |
| 49 |
<item>pure</item> |
| 50 |
<item>elemental</item> |
| 51 |
<item>record</item> |
| 52 |
<item>recursive</item> |
| 53 |
<item>result</item> |
| 54 |
<item>return</item> |
| 55 |
<item>stop</item> |
| 56 |
<item>to</item> |
| 57 |
<item>use</item> |
| 58 |
<item>only</item> |
| 59 |
<item>entry</item> |
| 60 |
<item>while</item> |
| 61 |
<!-- Others keywords: |
| 62 |
case, default, select, selectcase, |
| 63 |
contains, do, elseif, else, then --> |
| 64 |
</list> |
| 65 |
<list name="io_functions"> |
| 66 |
<item>access</item> |
| 67 |
<item>backspace</item> |
| 68 |
<item>close</item> |
| 69 |
<item>inquire</item> |
| 70 |
<item>open</item> |
| 71 |
<item>print</item> |
| 72 |
<item>read</item> |
| 73 |
<item>rewind</item> |
| 74 |
<item>write</item> |
| 75 |
<item>format</item> |
| 76 |
</list> |
| 77 |
<!-- Keywords inside read(...), write(...), backspace(...), |
| 78 |
rewind(...), endfile(...), close(...) --> |
| 79 |
<list name="io_keywords"> |
| 80 |
<item>unit</item> |
| 81 |
<item>end</item> |
| 82 |
<item>err</item> |
| 83 |
<item>fmt</item> |
| 84 |
<item>iostat</item> |
| 85 |
<item>status</item> |
| 86 |
<item>advance</item> |
| 87 |
<item>size</item> |
| 88 |
<item>eor</item> |
| 89 |
</list> |
| 90 |
<!-- Keywords inside open(...) --> |
| 91 |
<list name="open_keywords"> |
| 92 |
<item>unit</item> |
| 93 |
<item>iostat</item> |
| 94 |
<item>err</item> |
| 95 |
<item>file</item> |
| 96 |
<item>status</item> |
| 97 |
<item>access</item> |
| 98 |
<item>form</item> |
| 99 |
<item>recl</item> |
| 100 |
<item>blank</item> |
| 101 |
<item>position</item> |
| 102 |
<item>action</item> |
| 103 |
<item>delim</item> |
| 104 |
<item>pad</item> |
| 105 |
</list> |
| 106 |
<!-- Keywords inside inquire(...) --> |
| 107 |
<list name="inquire_keywords"> |
| 108 |
<item>unit</item> |
| 109 |
<item>iostat</item> |
| 110 |
<item>err</item> |
| 111 |
<item>file</item> |
| 112 |
<item>exist</item> |
| 113 |
<item>opened</item> |
| 114 |
<item>number</item> |
| 115 |
<item>named</item> |
| 116 |
<item>name</item> |
| 117 |
<item>access</item> |
| 118 |
<item>sequential</item> |
| 119 |
<item>direct</item> |
| 120 |
<item>form</item> |
| 121 |
<item>formatted</item> |
| 122 |
<item>unformatted</item> |
| 123 |
<item>recl</item> |
| 124 |
<item>nextrec</item> |
| 125 |
<item>blank</item> |
| 126 |
<item>position</item> |
| 127 |
<item>action</item> |
| 128 |
<item>read</item> |
| 129 |
<item>write</item> |
| 130 |
<item>readwrite</item> |
| 131 |
<item>delim</item> |
| 132 |
<item>pad</item> |
| 133 |
</list> |
| 134 |
<list name="types"> |
| 135 |
<item>parameter</item> |
| 136 |
<item>save</item> |
| 137 |
<item>pointer</item> |
| 138 |
<item>public</item> |
| 139 |
<item>private</item> |
| 140 |
<item>target</item> |
| 141 |
<item>allocatable</item> |
| 142 |
<item>optional</item> |
| 143 |
<item>sequence</item> |
| 144 |
<!-- Others types: double, precision --> |
| 145 |
</list> |
| 146 |
|
| 147 |
<!-- There are 4 types of intrinsic procedures in Fortran 90: |
| 148 |
1) Elemental procedures (elemental_procs); |
| 149 |
2) Inquiry functions (inquiry_fn); |
| 150 |
3) Transformational functions (transform_fn); |
| 151 |
4) Non elemental subroutines (non_elem_subr); |
| 152 |
Often mathematical functions have one generic form and many specific names! |
| 153 |
If you use the generic form, the compiler will select the right function |
| 154 |
to use depending on the type of the arguments. |
| 155 |
But you can use also the specific names! |
| 156 |
--> |
| 157 |
|
| 158 |
<!-- E L E M E N T A L P R O C E D U R E S --> |
| 159 |
<list name="elemental_procs"> |
| 160 |
<!-- Elemental functions that may convert --> |
| 161 |
<item>abs</item> <!-- Generic form: abs --> |
| 162 |
<item>cabs</item> <!-- Specific names for abs --> |
| 163 |
<item>dabs</item> |
| 164 |
<item>iabs</item> |
| 165 |
<item>aimag</item> |
| 166 |
<item>aint</item> <!-- Generic form: aint --> |
| 167 |
<item>dint</item> <!-- Specific name for aint --> |
| 168 |
<item>anint</item> <!-- Generic form: anint --> |
| 169 |
<item>dnint</item> <!-- Specific name for anint --> |
| 170 |
<item>ceiling</item> |
| 171 |
<item>cmplx</item> |
| 172 |
<item>dcmplx</item> <!-- (non standard) --> |
| 173 |
<item>dimag</item> <!-- (non standard) --> |
| 174 |
<item>floor</item> |
| 175 |
<item>nint</item> <!-- Generic form: nint --> |
| 176 |
<item>idnint</item><!-- Specific name for nint --> |
| 177 |
<item>int</item> <!-- Generic form: int --> |
| 178 |
<item>idint</item> <!-- Specific names for int --> |
| 179 |
<item>ifix</item> |
| 180 |
<item>real</item> <!-- Generic form: real --> |
| 181 |
<item>float</item> <!-- Specific names for real --> |
| 182 |
<item>sngl</item> |
| 183 |
<item>dble</item> |
| 184 |
<item>dreal</item> <!-- (non standard) --> |
| 185 |
<item>aprime</item> <!-- 5 functions from fortran.xml --> |
| 186 |
<item>dconjg</item> <!-- I don't know if they really belong to --> |
| 187 |
<item>dfloat</item> <!-- the fortran 90/95 standard! --> |
| 188 |
<item>ddmim</item> |
| 189 |
<item>rand</item> |
| 190 |
<!-- Elemental functions that do not convert --> |
| 191 |
<item>modulo</item> |
| 192 |
<item>conjg</item> |
| 193 |
<item>dprod</item> <!-- dprod(x, y) is the specific name for x*y --> |
| 194 |
<item>dim</item> <!-- Generic form: dim --> |
| 195 |
<item>ddim</item> <!-- Specific names for dim --> |
| 196 |
<item>idim</item> |
| 197 |
<item>max</item> <!-- Generic form: max --> |
| 198 |
<item>amax0</item> <!-- Specific names for max --> |
| 199 |
<item>amax1</item> |
| 200 |
<item>max0</item> |
| 201 |
<item>max1</item> |
| 202 |
<item>dmax1</item> |
| 203 |
<item>min</item> <!-- Generic form: min --> |
| 204 |
<item>amin0</item> <!-- Specific names for min --> |
| 205 |
<item>amin1</item> |
| 206 |
<item>min0</item> |
| 207 |
<item>min1</item> |
| 208 |
<item>dmin1</item> |
| 209 |
<item>mod</item> <!-- Generic form: mod --> |
| 210 |
<item>amod</item> <!-- Specific names for mod --> |
| 211 |
<item>dmod</item> |
| 212 |
<item>sign</item> <!-- Generic form: sign --> |
| 213 |
<item>dsign</item> <!-- Specific names for sign --> |
| 214 |
<item>isign</item> |
| 215 |
<!-- Elemental mathematical functions --> |
| 216 |
<item>acos</item> <!-- Generic form: acos --> |
| 217 |
<item>dacos</item> <!-- Specific names for acos --> |
| 218 |
<item>asin</item> <!-- Generic form: asin --> |
| 219 |
<item>dasin</item> <!-- Specific names for asin --> |
| 220 |
<item>atan</item> <!-- Generic form: atan --> |
| 221 |
<item>datan</item> <!-- Specific names for atan --> |
| 222 |
<item>atan2</item> <!-- Generic form: atan2 --> |
| 223 |
<item>datan2</item> <!-- Specific names for atan2 --> |
| 224 |
<item>cos</item> <!-- Generic form: cos --> |
| 225 |
<item>ccos</item> <!-- Specific names for cos --> |
| 226 |
<item>dcos</item> |
| 227 |
<item>cosh</item> <!-- Generic form: cosh --> |
| 228 |
<item>dcosh</item> <!-- Specific names for cosh --> |
| 229 |
<item>exp</item> <!-- Generic form: exp --> |
| 230 |
<item>cexp</item> <!-- Specific names for exp --> |
| 231 |
<item>dexp</item> |
| 232 |
<item>log</item> <!-- Generic form: log --> |
| 233 |
<item>alog</item> <!-- Specific names for log --> |
| 234 |
<item>dlog</item> |
| 235 |
<item>clog</item> |
| 236 |
<item>log10</item> <!-- Generic form: log10 --> |
| 237 |
<item>alog10</item> <!-- Specific names for log10 --> |
| 238 |
<item>dlog10</item> |
| 239 |
<item>sin</item> <!-- Generic form: sin --> |
| 240 |
<item>csin</item> <!-- Specific names for sin --> |
| 241 |
<item>dsin</item> |
| 242 |
<item>sinh</item> <!-- Generic form: sinh --> |
| 243 |
<item>dsinh</item> <!-- Specific name for sinh --> |
| 244 |
<item>sqrt</item> <!-- Generic form: sqrt --> |
| 245 |
<item>csqrt</item> <!-- Specific names for sqrt --> |
| 246 |
<item>dsqrt</item> |
| 247 |
<item>tan</item> <!-- Generic form: tan --> |
| 248 |
<item>dtan</item> <!-- Generic form: dtan --> |
| 249 |
<item>tanh</item> <!-- Generic form: tanh --> |
| 250 |
<item>dtanh</item> <!-- Specific names for tanh --> |
| 251 |
<!-- Elemental character and logical functions --> |
| 252 |
<!-- Character-integer conversions --> |
| 253 |
<item>achar</item> |
| 254 |
<item>char</item> |
| 255 |
<item>iachar</item> |
| 256 |
<item>ichar</item> |
| 257 |
<!-- Lexical comparison functions --> |
| 258 |
<item>lge</item> |
| 259 |
<item>lgt</item> |
| 260 |
<item>lle</item> |
| 261 |
<item>llt</item> |
| 262 |
<!-- String-handling elemental functions --> |
| 263 |
<item>adjustl</item> |
| 264 |
<item>adjustr</item> |
| 265 |
<item>index</item> |
| 266 |
<item>len_trim</item> |
| 267 |
<item>scan</item> |
| 268 |
<item>verify</item> |
| 269 |
<!-- Logical conversion --> |
| 270 |
<item>logical</item> |
| 271 |
<!-- Elemental functions to manipulate reals --> |
| 272 |
<item>exponent</item> |
| 273 |
<item>fraction</item> |
| 274 |
<item>nearest</item> |
| 275 |
<item>rrspacing</item> |
| 276 |
<item>scale</item> |
| 277 |
<item>set_exponent</item> |
| 278 |
<item>spacing</item> |
| 279 |
<!-- Bit manipulation elemental functions --> |
| 280 |
<item>btest</item> |
| 281 |
<item>iand</item> |
| 282 |
<item>ibclr</item> |
| 283 |
<item>ibits</item> |
| 284 |
<item>ibset</item> |
| 285 |
<item>ieor</item> |
| 286 |
<item>ior</item> |
| 287 |
<item>ishft</item> |
| 288 |
<item>ishftc</item> |
| 289 |
<item>not</item> |
| 290 |
<!-- Bit manipulation elemental subroutine --> |
| 291 |
<item>mvbits</item> |
| 292 |
<!-- Merge elemental function --> |
| 293 |
<item>merge</item> |
| 294 |
</list> |
| 295 |
|
| 296 |
<!-- I N Q U I R Y F U N C T I O N S --> |
| 297 |
<list name="inquiry_fn"> |
| 298 |
<!-- Inquiry functions for any type --> |
| 299 |
<item>associated</item> |
| 300 |
<item>present</item> |
| 301 |
<item>kind</item> |
| 302 |
<!-- String-handling inquiry function --> |
| 303 |
<item>len</item> |
| 304 |
<!-- Numeric inquiry functions --> |
| 305 |
<item>digits</item> |
| 306 |
<item>epsilon</item> |
| 307 |
<item>huge</item> |
| 308 |
<item>maxexponent</item> |
| 309 |
<item>minexponent</item> |
| 310 |
<item>precision</item> |
| 311 |
<item>radix</item> |
| 312 |
<item>range</item> |
| 313 |
<item>tiny</item> |
| 314 |
<!-- Bit inquiry function --> |
| 315 |
<item>bit_size</item> |
| 316 |
<!-- Array inquiry functions --> |
| 317 |
<item>allocated</item> |
| 318 |
<item>lbound</item> |
| 319 |
<item>ubound</item> |
| 320 |
<item>shape</item> |
| 321 |
<item>size</item> |
| 322 |
</list> |
| 323 |
|
| 324 |
<!-- T R A N S F O R M A T I O N A L F U N C T I O N S --> |
| 325 |
<list name="transform_fn"> |
| 326 |
<!-- String-handling transformational functions --> |
| 327 |
<item>repeat</item> |
| 328 |
<item>trim</item> |
| 329 |
<!-- Transformational functions for kind values --> |
| 330 |
<item>selected_int_kind</item> |
| 331 |
<item>selected_real_kind</item> |
| 332 |
<!-- Transfer function --> |
| 333 |
<item>transfer</item> |
| 334 |
<!-- Vector and matrix multiplication functions --> |
| 335 |
<item>dot_product</item> |
| 336 |
<item>matmul</item> |
| 337 |
<!-- Transformational functions that reduce arrays --> |
| 338 |
<item>all</item> |
| 339 |
<item>any</item> |
| 340 |
<item>count</item> |
| 341 |
<item>maxval</item> |
| 342 |
<item>minval</item> |
| 343 |
<item>product</item> |
| 344 |
<item>sum</item> |
| 345 |
<!-- Packing and unpacking arrays --> |
| 346 |
<item>pack</item> |
| 347 |
<item>unpack</item> |
| 348 |
<!-- Transformational function for reshaping an array --> |
| 349 |
<item>reshape</item> |
| 350 |
<!-- Transformational function for replication --> |
| 351 |
<item>spread</item> |
| 352 |
<!-- Array shifting functions --> |
| 353 |
<item>cshift</item> |
| 354 |
<item>eoshift</item> |
| 355 |
<!-- Matrix transpose --> |
| 356 |
<item>transpose</item> |
| 357 |
<!-- Transformational functions for geometric location --> |
| 358 |
<item>findloc</item> |
| 359 |
<item>maxloc</item> |
| 360 |
<item>minloc</item> |
| 361 |
</list> |
| 362 |
|
| 363 |
<!-- N O N E L E M E N T A L S U B R O U T I N E S --> |
| 364 |
<list name="non_elem_subr"> |
| 365 |
<!-- Real time clock --> |
| 366 |
<item>date_and_time</item> |
| 367 |
<item>system_clock</item> |
| 368 |
<!-- Random numbers --> |
| 369 |
<item>random_number</item> |
| 370 |
<item>random_seed</item> |
| 371 |
</list> |
| 372 |
|
| 373 |
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> |
| 374 |
<!-- * C O N T E X T S * --> |
| 375 |
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> |
| 376 |
<contexts> |
| 377 |
<context attribute="Normal Text" lineEndContext="#stay" name="default" > |
| 378 |
<IncludeRules context="find_preprocessor" /> |
| 379 |
<IncludeRules context="find_comments" /> |
| 380 |
<IncludeRules context="find_strings" /> |
| 381 |
<IncludeRules context="find_decls" /> |
| 382 |
<IncludeRules context="find_intrinsics" /> |
| 383 |
<IncludeRules context="find_io_stmnts" /> |
| 384 |
<IncludeRules context="find_op_and_log" /> |
| 385 |
<IncludeRules context="find_numbers" /> |
| 386 |
<IncludeRules context="find_continue" /> |
| 387 |
<IncludeRules context="find_symbols" /> |
| 388 |
<IncludeRules context="find_begin_stmnts" /> |
| 389 |
<IncludeRules context="find_end_stmnts" /> |
| 390 |
<IncludeRules context="find_mid_stmnts" /> |
| 391 |
</context> |
| 392 |
<!--************************END OF THE MAIN CONTEXT*************************--> |
| 393 |
|
| 394 |
|
| 395 |
<!-- IMPORTANT: If you modify something, do it also in "fortran-free.xml"! --> |
| 396 |
|
| 397 |
<!-- This context highlights preprocessor lines --> |
| 398 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_preprocessor"> |
| 399 |
<DetectChar attribute="Preprocessor" context="preprocessor" char="#" column="0"/> |
| 400 |
<StringDetect attribute="Preprocessor" context="preprocessor" String="cDEC$" column="0"/> |
| 401 |
<StringDetect attribute="Preprocessor" context="preprocessor" String="CDEC$" column="0"/> |
| 402 |
</context> |
| 403 |
<context attribute="Preprocessor" lineEndContext="#pop" name="preprocessor" /> |
| 404 |
|
| 405 |
<!-- This context highlights operators and the logical values .true. .false. --> |
| 406 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_op_and_log"> |
| 407 |
<StringDetect attribute="Logical" context="#stay" String=".true." insensitive="true"/> |
| 408 |
<StringDetect attribute="Logical" context="#stay" String=".false." insensitive="true"/> |
| 409 |
<RegExpr attribute="Operator" context="#stay" String="\.[A-Za-z]+\."/> |
| 410 |
<Detect2Chars attribute="Operator" context="#stay" char="=" char1="="/> |
| 411 |
<Detect2Chars attribute="Operator" context="#stay" char="/" char1="="/> |
| 412 |
<Detect2Chars attribute="Operator" context="#stay" char="<" char1="="/> |
| 413 |
<Detect2Chars attribute="Operator" context="#stay" char=">" char1="="/> |
| 414 |
<AnyChar attribute="Operator" context="#stay" String="<>%"/> |
| 415 |
</context> |
| 416 |
|
| 417 |
<!-- This context highlights comments --> |
| 418 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_comments"> |
| 419 |
<AnyChar attribute="Comment" context="comment" String="cC*" column="0"/> |
| 420 |
<DetectChar attribute="Comment" context="comment" char="!"/> |
| 421 |
<RegExpr attribute="Comment" context="comment" String="." column="72" /> |
| 422 |
</context> |
| 423 |
|
| 424 |
<context attribute="Comment" lineEndContext="#pop" name="comment"> |
| 425 |
<IncludeRules context="##Comments"/> |
| 426 |
</context> |
| 427 |
|
| 428 |
<!-- This context highlights symbols --> |
| 429 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_symbols"> |
| 430 |
<Detect2Chars attribute="Keyword" context="#stay" char="*" char1="*"/> |
| 431 |
<Detect2Chars attribute="Keyword" context="#stay" char="(" char1="/"/> |
| 432 |
<Detect2Chars attribute="Keyword" context="#stay" char="/" char1=")"/> |
| 433 |
<AnyChar attribute="Keyword" context="#stay" String="&+-*/=?[]^{|}~"/> |
| 434 |
<AnyChar attribute="Symbol" context="#stay" String="(),"/> |
| 435 |
</context> |
| 436 |
|
| 437 |
<!-- This context highlights the continuation character --> |
| 438 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_continue"> |
| 439 |
<RegExpr attribute="Continuation character" context="#stay" String="^ [^0-9\s]" column="0"/> |
| 440 |
</context> |
| 441 |
|
| 442 |
<!-- This context highlights items inside the parentesis of a function --> |
| 443 |
<context attribute="Normal Text" lineEndContext="#stay" name="inside_func_paren"> |
| 444 |
<DetectChar attribute="Normal Text" context="inside_func_paren" char="("/> |
| 445 |
<DetectChar attribute="Normal Text" context="#pop" char=")"/> |
| 446 |
<IncludeRules context="find_strings" /> |
| 447 |
<IncludeRules context="find_intrinsics" /> |
| 448 |
<IncludeRules context="find_numbers" /> |
| 449 |
</context> |
| 450 |
|
| 451 |
<!-- The following two contexts match input/output statements --> |
| 452 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_io_stmnts"> |
| 453 |
<RegExpr attribute="IO Function" context="find_io_paren" String="\b(?:read|write|backspace|rewind|end\s*file|close|open|inquire)\s*[(]" insensitive="true"/> |
| 454 |
<RegExpr attribute="IO Function" context="format_stmnt" String="\bformat\s*[(]" insensitive="true"/> |
| 455 |
<RegExpr attribute="IO Function" context="#stay" String="\bend\s*file\b" insensitive="true"/> |
| 456 |
<keyword attribute="IO Function" context="#stay" String="io_functions"/> |
| 457 |
</context> |
| 458 |
<!-- This context matches parenthesis for the read, write, ... statements --> |
| 459 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_io_paren"> |
| 460 |
<DetectChar attribute="IO Function" context="#stay" char="*"/> |
| 461 |
<DetectChar attribute="Normal Text" context="inside_func_paren" char="("/> |
| 462 |
<DetectChar attribute="IO Function" context="#pop" char=")"/> |
| 463 |
<keyword attribute="IO Function" context="#stay" String="io_keywords"/> |
| 464 |
<keyword attribute="IO Function" context="#stay" String="inquire_keywords"/> |
| 465 |
<keyword attribute="IO Function" context="#stay" String="open_keywords"/> |
| 466 |
<IncludeRules context="find_strings" /> |
| 467 |
<IncludeRules context="find_intrinsics" /> |
| 468 |
<IncludeRules context="find_numbers" /> |
| 469 |
<IncludeRules context="find_symbols" /> |
| 470 |
</context> |
| 471 |
<!-- This context highlights the text inside the parenthesis of fortran statement --> |
| 472 |
<context attribute="Normal Text" lineEndContext="#stay" name="format_stmnt"> |
| 473 |
<DetectChar attribute="IO Function" context="format_stmnt" char="("/> |
| 474 |
<DetectChar attribute="IO Function" context="#pop" char=")"/> |
| 475 |
<RegExpr attribute="IO Function" context="#stay" String="[0-9]*/" insensitive="true"/> |
| 476 |
<DetectChar attribute="IO Function" context="#stay" char=":"/> |
| 477 |
<IncludeRules context="find_strings" /> |
| 478 |
<IncludeRules context="find_symbols" /> |
| 479 |
</context> |
| 480 |
|
| 481 |
<!-- The following context matches the begin of program units --> |
| 482 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_begin_stmnts"> |
| 483 |
<RegExpr attribute="Keyword" context="#stay" String="\bmodule\s+procedure\b" insensitive="true"/> |
| 484 |
<RegExpr attribute="Keyword" context="#stay" String="\b(?:subroutine|function|block\s*data|program|module)\b" insensitive="true" beginRegion="Routine"/> |
| 485 |
<RegExpr attribute="Keyword" context="#stay" String="\b(?:then|do|select\s+case)\b" insensitive="true" beginRegion="Block"/> |
| 486 |
</context> |
| 487 |
<!-- The following context matches the end of program units --> |
| 488 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_end_stmnts"> |
| 489 |
<RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:subroutine|function|block\s*data|program|module)\b" insensitive="true" endRegion="Routine"/> |
| 490 |
<RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:do|if)\b" insensitive="true" endRegion="Block"/> |
| 491 |
<RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:select|where|forall|interface)\b" insensitive="true"/> |
| 492 |
<RegExpr attribute="Keyword" context="#stay" String="\belse\s*if\b" insensitive="true" endRegion="Block"/> |
| 493 |
<WordDetect attribute="Keyword" context="#stay" String="end" insensitive="true" endRegion="Routine"/> |
| 494 |
</context> |
| 495 |
<!-- The following context matches the mid of program units --> |
| 496 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_mid_stmnts"> |
| 497 |
<WordDetect attribute="Keyword" context="#stay" String="else" insensitive="true" endRegion="Block" beginRegion="Block"/> |
| 498 |
<RegExpr attribute="Keyword" context="#stay" String="\bcase(?:\s+default)?\b" insensitive="true" endRegion="Block" beginRegion="Block"/> |
| 499 |
<WordDetect attribute="Keyword" context="#stay" String="contains" insensitive="true" endRegion="Routine" beginRegion="Routine"/> |
| 500 |
</context> |
| 501 |
|
| 502 |
<!-- The following two contexts match declarations --> |
| 503 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_decls"> |
| 504 |
<RegExpr attribute="Data Type" context="#stay" String="\b(?:integer|real|complex)[\*]\d{1,2}|\bend\s*type\b" insensitive="true"/> |
| 505 |
<keyword attribute="Data Type" context="#stay" String="types"/> |
| 506 |
<WordDetect attribute="Data Type" context="#stay" String="data" firstNonSpace="true" insensitive="true"/> |
| 507 |
<!--<RegExpr attribute="Data Type" context="find_paren" String="real\s*[(]" firstNonSpace="true" insensitive="true"/> |
| 508 |
<RegExpr attribute="Data Type" context="#stay" String="real(?![\w\*])" firstNonSpace="true" insensitive="true"/>--> |
| 509 |
<RegExpr attribute="Data Type" context="#stay" String="\bcharacter[*][0-9]+\b" insensitive="true"/> |
| 510 |
<RegExpr attribute="Data Type" context="find_paren" String="\b(?:type|integer|real|complex|character|logical|intent|dimension)\s*[(]" insensitive="true"/> |
| 511 |
<RegExpr attribute="Data Type" context="#stay" String="\b(?:type|integer|real|complex|character|logical|double\s*precision|intent|dimension)\b" insensitive="true"/> |
| 512 |
<Detect2Chars attribute="Data Type" context="#stay" char=":" char1=":"/> |
| 513 |
</context> |
| 514 |
<!-- This context matches parenthesis in data type declarations, such as in 'real(...)'--> |
| 515 |
<context attribute="Data Type" lineEndContext="#pop" name="find_paren"> |
| 516 |
<DetectChar attribute="Data Type" context="find_paren" char="("/> |
| 517 |
<DetectChar attribute="Data Type" context="#pop" char=")"/> |
| 518 |
</context> |
| 519 |
|
| 520 |
<!-- The following context matches intrinsic procedures --> |
| 521 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_intrinsics"> |
| 522 |
<keyword attribute="Keyword" context="#stay" String="keywords"/> |
| 523 |
<!-- INTRINSIC PROCEDURES --> |
| 524 |
<keyword attribute="Elemental Procedure" context="#stay" String="elemental_procs"/> |
| 525 |
<keyword attribute="Inquiry Function" context="#stay" String="inquiry_fn"/> |
| 526 |
<keyword attribute="Transformational Function" context="#stay" String="transform_fn"/> |
| 527 |
<keyword attribute="Non elemental subroutine" context="#stay" String="non_elem_subr"/> |
| 528 |
</context> |
| 529 |
|
| 530 |
<!-- The following context matches integer and real numbers --> |
| 531 |
<context attribute="Normal Text" lineEndContext="#stay" name="find_numbers"> |
| 532 |
<RegExpr attribute="Float" context="#stay" String="&float1;|&float2;|&float3;" insensitive="true"/> |
| 533 |
<RegExpr attribute="Decimal" context="#stay" String="&integer;|&baseinteger;"/> |
| 534 |
</context> |
| 535 |
|
| 536 |
<!-- The following four contexts implement the complex string multi-line declarations --> |
| 537 |
<!-- Matches STRINGS (there are 2 types of strings: '...' and "...") --> |
| 538 |
<context attribute="String" lineEndContext="#stay" name="find_strings"> |
| 539 |
<DetectChar attribute="String" context="string_1" char="'"/> |
| 540 |
<DetectChar attribute="String" context="string_2" char="""/> |
| 541 |
</context> |
| 542 |
|
| 543 |
<context attribute="String" lineEndContext="#stay" name="string_1" fallthrough="true" fallthroughContext="#pop"> |
| 544 |
<RegExpr attribute="String" context="#pop" String="[^']*'"/> |
| 545 |
<RegExpr attribute="Keyword" context="end_of_string" String="&\s*$"/> |
| 546 |
<RegExpr attribute="String" context="end_of_string" String=".*(?=&\s*$)"/> |
| 547 |
</context> |
| 548 |
|
| 549 |
<context attribute="String" lineEndContext="#stay" name="string_2" fallthrough="true" fallthroughContext="#pop"> |
| 550 |
<RegExpr attribute="String" context="#pop" String="[^"]*""/> |
| 551 |
<RegExpr attribute="Keyword" context="end_of_string" String="&\s*$"/> |
| 552 |
<RegExpr attribute="String" context="end_of_string" String=".*(?=&\s*$)"/> |
| 553 |
</context> |
| 554 |
|
| 555 |
<context attribute="String" lineEndContext="#stay" name="end_of_string" fallthrough="true" fallthroughContext="#pop#pop"> |
| 556 |
<DetectSpaces /> |
| 557 |
<RegExpr attribute="Keyword" context="#stay" String="&\s*$"/> |
| 558 |
<DetectChar attribute="Keyword" context="#pop" char="&" firstNonSpace="true"/> |
| 559 |
<AnyChar attribute="Comment" context="comment" String="cC*" column="0"/> |
| 560 |
<DetectChar attribute="Comment" context="comment" char="!" firstNonSpace="true"/> |
| 561 |
</context> |
| 562 |
</contexts> |
| 563 |
|
| 564 |
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> |
| 565 |
<!-- * S T Y L E I T E M D E F I N I T I O N S * --> |
| 566 |
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> |
| 567 |
<itemDatas> |
| 568 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 569 |
<itemData name="Keyword" defStyleNum="dsKeyword"/> |
| 570 |
<itemData name="Data Type" defStyleNum="dsDataType"/> |
| 571 |
<itemData name="Decimal" defStyleNum="dsDecVal"/> |
| 572 |
<itemData name="Float" defStyleNum="dsFloat"/> |
| 573 |
<itemData name="String" defStyleNum="dsString"/> |
| 574 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 575 |
<itemData name="Symbol" defStyleNum="dsNormal"/> |
| 576 |
<itemData name="Preprocessor" defStyleNum="dsOthers"/> |
| 577 |
<itemData name="Operator" defStyleNum="dsOperator" bold="1" italic="0"/> |
| 578 |
<itemData name="Logical" defStyleNum="dsConstant" bold="1" italic="0"/> |
| 579 |
<itemData name="IO Function" defStyleNum="dsFunction" bold="0" italic="0"/> |
| 580 |
<itemData name="Elemental Procedure" defStyleNum="dsBuiltIn" bold="1" italic="0"/> |
| 581 |
<itemData name="Continuation character" defStyleNum="dsBuiltIn" bold="1" italic="0"/> |
| 582 |
<itemData name="Inquiry Function" defStyleNum="dsFunction" bold="1" italic="1"/> |
| 583 |
<itemData name="Transformational Function" defStyleNum="dsFunction" bold="1" italic="0"/> |
| 584 |
<itemData name="Non elemental subroutine" defStyleNum="dsFunction" bold="1" italic="0"/> |
| 585 |
</itemDatas> |
| 586 |
</highlighting> |
| 587 |
<general> |
| 588 |
<comments> |
| 589 |
<comment name="singleLine" start="c"/> |
| 590 |
</comments> |
| 591 |
<keywords casesensitive="0"/> |
| 592 |
</general> |
| 593 |
</language> |
| 594 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |