Warning, /frameworks/syntax-highlighting/data/syntax/fortran-free.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language>
0003 <language name="Fortran (Free Format)" version="5" kateversion="5.53" section="Sources" extensions="*.f90;*.F90;*.f95;*.F95;*.f03;*.F03;*.f08;*.F08;" mimetype="text/x-fortran-src" casesensitive="0" author="Franchin Matteo (fnch@libero.it), Janus Weil" license="MIT" priority="10">
0004 <!-- Original author: Franchin Matteo (fnch@libero.it).
0005      Adaptation to free & fixed format: Janus Weil.
0006 -->
0007 <!-- NOTE: Keep in sync with the "Fortran (Fixed Format)" highlighter! (fortran-fixed.xml) -->
0008   <highlighting>
0009 
0010 <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  -->
0011 <!-- *                              L I S T S                            *  -->
0012 <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  -->
0013     <list name="keywords">
0014       <include>keywords##Fortran (Fixed Format)</include>
0015       <item>associate</item>
0016       <item>import</item>
0017       <item>impure</item>
0018     </list>
0019     <list name="io_functions">
0020       <include>io_functions##Fortran (Fixed Format)</include>
0021     </list>
0022     <!-- Keywords inside read(...), write(...), backspace(...),
0023           rewind(...), endfile(...), close(...) -->
0024     <list name="io_keywords">
0025       <include>io_keywords##Fortran (Fixed Format)</include>
0026     </list>
0027     <!-- Keywords inside open(...) -->
0028     <list name="open_keywords">
0029       <include>open_keywords##Fortran (Fixed Format)</include>
0030     </list>
0031     <!-- Keywords inside inquire(...) -->
0032     <list name="inquire_keywords">
0033       <include>inquire_keywords##Fortran (Fixed Format)</include>
0034     </list>
0035     <list name="types">
0036       <include>types##Fortran (Fixed Format)</include>
0037       <item>abstract</item>
0038       <item>asynchronous</item>
0039       <item>bind</item>
0040       <item>contiguous</item>
0041       <item>deferred</item>
0042       <item>enum</item>
0043       <item>enumerator</item>
0044       <item>final</item>
0045       <item>generic</item>
0046       <item>nopass</item>
0047       <item>non_overridable</item>
0048       <item>protected</item>
0049       <item>value</item>
0050       <item>volatile</item>
0051     </list>
0052 
0053 <!-- There are 4 types of intrinsic procedures in Fortran 90:
0054    1) Elemental procedures (elemental_procs);
0055    2) Inquiry functions (inquiry_fn);
0056    3) Transformational functions (transform_fn);
0057    4) Non elemental subroutines (non_elem_subr);
0058   Often mathematical functions have one generic form and many specific names!
0059   If you use the generic form, the compiler will select the right function
0060   to use depending on the type of the arguments.
0061   But you can use also the specific names!
0062   -->
0063 
0064 <!-- E L E M E N T A L    P R O C E D U R E S -->
0065     <list name="elemental_procs">
0066       <include>elemental_procs##Fortran (Fixed Format)</include>
0067     <!-- Elemental mathematical functions -->
0068       <item>acosh</item>
0069       <item>asinh</item>
0070       <item>atanh</item>
0071       <item>bessel_j0</item>
0072       <item>bessel_j1</item>
0073       <item>bessel_jn</item>
0074       <item>bessel_y0</item>
0075       <item>bessel_y1</item>
0076       <item>bessel_yn</item>
0077       <item>erf</item>
0078       <item>erfc</item>
0079       <item>erfc_scaled</item>
0080       <item>gamma</item>
0081       <item>log_gamma</item>
0082       <item>hypot</item>
0083     </list>
0084 
0085 <!-- I N Q U I R Y    F U N C T I O N S -->
0086     <list name="inquiry_fn">
0087       <include>inquiry_fn##Fortran (Fixed Format)</include>
0088     <!-- Inquiry functions for any type -->
0089       <item>extends_type_of</item>
0090       <item>same_type_as</item>
0091       <item>storage_size</item>
0092     <!-- Coarray inquiry functions -->
0093       <item>lcobound</item>
0094       <item>ucobound</item>
0095       <item>image_index</item>
0096     </list>
0097 
0098 <!-- 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 -->
0099     <list name="transform_fn">
0100       <include>transform_fn##Fortran (Fixed Format)</include>
0101     <!-- Transformational functions for kind values -->
0102       <item>selected_char_kind</item>
0103     <!-- Transformational functions that reduce arrays -->
0104       <item>parity</item>
0105       <item>iall</item>
0106       <item>iany</item>
0107       <item>iparity</item>
0108     <!-- Coarray transformational functions -->
0109       <item>num_images</item>
0110       <item>this_image</item>
0111     </list>
0112 
0113 <!-- N O N    E L E M E N T A L    S U B R O U T I N E S -->
0114     <list name="non_elem_subr">
0115       <include>non_elem_subr##Fortran (Fixed Format)</include>
0116     <!-- Real time clock -->
0117       <item>cpu_time</item>
0118     <!-- System commands -->
0119       <item>execute_command_line</item>
0120       <item>get_environment_variable</item>
0121     </list>
0122 
0123 <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  -->
0124 <!-- *                           C O N T E X T S                         *  -->
0125 <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  -->
0126     <contexts>
0127       <context attribute="Normal Text" lineEndContext="#stay" name="default" >
0128         <IncludeRules context="find_strings" />
0129         <IncludeRules context="find_io_stmnts" />
0130         <IncludeRules context="find_op_and_log##Fortran (Fixed Format)" />
0131         <IncludeRules context="find_numbers##Fortran (Fixed Format)" />
0132         <IncludeRules context="find_preprocessor##Fortran (Fixed Format)" />
0133         <IncludeRules context="find_comments" />
0134         <IncludeRules context="find_symbols##Fortran (Fixed Format)" />
0135         <IncludeRules context="find_begin_stmnts" />
0136         <IncludeRules context="find_mid_stmnts" />
0137         <IncludeRules context="find_end_stmnts" />
0138         <IncludeRules context="find_decls" />
0139         <IncludeRules context="find_intrinsics" />
0140       </context>
0141 <!--************************END OF THE MAIN CONTEXT*************************-->
0142 
0143 
0144 <!-- IMPORTANT: If you modify something, do it also in "fortran-fixed.xml"! -->
0145 
0146 <!-- This context highlights comments -->
0147       <context attribute="Normal Text" lineEndContext="#stay" name="find_comments">
0148         <DetectChar attribute="Comment" context="comment" char="!"/>
0149       </context>
0150       <context attribute="Comment" lineEndContext="#pop" name="comment">
0151         <IncludeRules context="##Comments"/>
0152       </context>
0153 
0154 <!-- This context highlights items inside the parentesis of a function -->
0155       <context attribute="Normal Text" lineEndContext="#stay" name="inside_func_paren">
0156       <!-- inside_func_paren##Fortran (Fixed Format) -->
0157         <DetectChar attribute="Normal Text" context="inside_func_paren" char="("/>
0158         <DetectChar attribute="Normal Text" context="#pop" char=")"/>
0159         <IncludeRules context="find_strings" />
0160         <IncludeRules context="find_intrinsics" />
0161         <IncludeRules context="find_numbers##Fortran (Fixed Format)" />
0162       </context>
0163 
0164 <!-- The following two contexts match input/output statements -->
0165       <context attribute="Normal Text" lineEndContext="#stay" name="find_io_stmnts">
0166       <!-- find_io_stmnts##Fortran (Fixed Format) -->
0167         <RegExpr attribute="IO Function" context="find_io_paren" String="\b(?:flush|wait|read|write|backspace|rewind|end\s*file|close|open|inquire)\s*[(]" insensitive="true"/>
0168         <RegExpr attribute="IO Function" context="format_stmnt" String="\bformat\s*[(]" insensitive="true"/>
0169         <RegExpr attribute="IO Function" context="#stay" String="\bend\s*file\b" insensitive="true"/>
0170         <keyword attribute="IO Function" context="#stay" String="io_functions"/>
0171       </context>
0172 <!-- This context matches parenthesis for the read, write, ... statements -->
0173       <context attribute="Normal Text" lineEndContext="#stay" name="find_io_paren">
0174       <!-- find_io_paren##Fortran (Fixed Format) -->
0175         <DetectChar attribute="IO Function" context="#stay" char="*"/>
0176         <DetectChar attribute="Normal Text" context="inside_func_paren" char="("/>
0177         <DetectChar attribute="IO Function" context="#pop" char=")"/>
0178         <keyword attribute="IO Function"  context="#stay" String="io_keywords"/>
0179         <keyword attribute="IO Function"  context="#stay" String="inquire_keywords"/>
0180         <keyword attribute="IO Function"  context="#stay" String="open_keywords"/>
0181         <IncludeRules context="find_strings" />
0182         <IncludeRules context="find_intrinsics" />
0183         <IncludeRules context="find_numbers##Fortran (Fixed Format)" />
0184         <IncludeRules context="find_symbols##Fortran (Fixed Format)" />
0185       </context>
0186 <!-- This context highlights the text inside the parenthesis of fortran statement -->
0187       <context attribute="Normal Text" lineEndContext="#stay" name="format_stmnt">
0188         <DetectChar attribute="IO Function" context="format_stmnt" char="("/>
0189         <DetectChar attribute="IO Function" context="#pop" char=")"/>
0190         <IncludeRules context="find_strings" />
0191         <IncludeRules context="format_stmnt##Fortran (Fixed Format)" />
0192       </context>
0193 
0194 <!-- FIXME: beginRegion/endRegion don't work well with IncludeRules. When this is corrected, use IncludeRules instead of replicating rules. -->
0195 <!-- The following context matches the begin of program units -->
0196       <context attribute="Normal Text" lineEndContext="#stay" name="find_begin_stmnts">
0197         <WordDetect attribute="Keyword" context="#stay" String="submodule" insensitive="true" beginRegion="Routine"/>
0198         <RegExpr attribute="Keyword" context="#stay" String="\b(?:do\s*[,\s]\s*concurrent|select\s+type|block|critical)\b" insensitive="true" beginRegion="Block"/>
0199       <!-- Here IncludeRules: find_begin_stmnts##Fortran (Fixed Format) -->
0200         <RegExpr attribute="Keyword" context="#stay" String="\bmodule\s+procedure\b" insensitive="true"/>
0201         <RegExpr attribute="Keyword" context="#stay" String="\b(?:subroutine|function|block\s*data|program|module)\b" insensitive="true" beginRegion="Routine"/>
0202         <RegExpr attribute="Keyword" context="#stay" String="\b(?:then|do|select\s+case)\b" insensitive="true" beginRegion="Block"/>
0203       </context>
0204 <!-- The following context matches the end of program units -->
0205       <context attribute="Normal Text" lineEndContext="#stay" name="find_end_stmnts">
0206         <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:procedure|submodule)\b" insensitive="true" endRegion="Routine"/>
0207         <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:block|critical)\b" insensitive="true" endRegion="Block"/>
0208         <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:associate)\b" insensitive="true"/>
0209         <RegExpr attribute="Data Type" context="#stay" String="\bend\s*(?:type|enum)\b" insensitive="true"/>
0210       <!-- Here IncludeRules: find_end_stmnts##Fortran (Fixed Format) -->
0211         <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:subroutine|function|block\s*data|program|module)\b" insensitive="true" endRegion="Routine"/>
0212         <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:do|if)\b" insensitive="true" endRegion="Block"/>
0213         <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:select|where|forall|interface)\b" insensitive="true"/>
0214         <RegExpr attribute="Keyword" context="#stay" String="\belse\s*if\b" insensitive="true" endRegion="Block"/>
0215         <WordDetect attribute="Keyword" context="#stay" String="end" insensitive="true" endRegion="Routine"/>
0216       </context>
0217 <!-- The following context matches the mid of program units -->
0218       <context attribute="Normal Text" lineEndContext="#stay" name="find_mid_stmnts">
0219         <RegExpr attribute="Keyword" context="#stay" String="\b(?:type\s+is|class\s+(?:is|default))\b" insensitive="true" endRegion="Block" beginRegion="Block"/>
0220       <!-- Here IncludeRules: find_mid_stmnts##Fortran (Fixed Format) -->
0221         <WordDetect attribute="Keyword" context="#stay" String="else" insensitive="true" endRegion="Block" beginRegion="Block"/>
0222         <RegExpr attribute="Keyword" context="#stay" String="\bcase(?:\s+default)?\b" insensitive="true" endRegion="Block" beginRegion="Block"/>
0223         <WordDetect attribute="Keyword" context="#stay" String="contains" insensitive="true" endRegion="Routine" beginRegion="Routine"/>
0224       </context>
0225 
0226 <!-- The following two contexts match declarations -->
0227       <context attribute="Normal Text" lineEndContext="#stay" name="find_decls">
0228         <RegExpr attribute="Data Type" context="find_paren" String="\b(?:class|extends|procedure|pass|codimension)\s*[(]" insensitive="true"/>
0229         <WordDetect attribute="Data Type" context="#stay" String="codimension" insensitive="true"/>
0230         <WordDetect attribute="Data Type" context="#stay" String="procedure" insensitive="true"/>
0231         <WordDetect attribute="Data Type" context="#stay" String="pass" insensitive="true"/>
0232       <!-- find_decls##Fortran (Fixed Format) -->
0233         <keyword attribute="Data Type" context="#stay" String="types"/>
0234         <!--<RegExpr attribute="Data Type" context="find_paren" String="real\s*[(]" firstNonSpace="true" insensitive="true"/>-->
0235         <RegExpr attribute="Data Type" context="find_paren" String="\b(?:type|integer|real|complex|character|logical|intent|dimension)\s*[(]" insensitive="true"/>
0236         <IncludeRules context="find_decls##Fortran (Fixed Format)"/>
0237       </context>
0238 <!-- This context matches parenthesis in data type declarations, such as in 'real(...)'-->
0239       <context attribute="Data Type" lineEndContext="#pop" name="find_paren">
0240       <!-- find_paren##Fortran (Fixed Format) -->
0241         <AnyChar attribute="Data Type" context="find_paren" String="(["/>
0242         <AnyChar attribute="Data Type" context="#pop" String=")]"/>
0243       </context>
0244 
0245 <!-- The following context matches intrinsic procedures -->
0246       <context attribute="Normal Text" lineEndContext="#stay" name="find_intrinsics">
0247       <!-- find_intrinsics##Fortran (Fixed Format) -->
0248         <keyword attribute="Keyword" context="#stay" String="keywords"/>
0249       <!-- INTRINSIC PROCEDURES -->
0250         <keyword attribute="Elemental Procedure"       context="#stay" String="elemental_procs"/>
0251         <keyword attribute="Inquiry Function"          context="#stay" String="inquiry_fn"/>
0252         <keyword attribute="Transformational Function" context="#stay" String="transform_fn"/>
0253         <keyword attribute="Non elemental subroutine"  context="#stay" String="non_elem_subr"/>
0254       </context>
0255 
0256 <!-- The following four contexts implement the complex string multi-line declarations -->
0257 <!-- NOTE: Contexts replicated from "Fortran (Fixed Format)" -->
0258       <!-- Matches STRINGS (there are 2 types of strings: '...' and "...") -->
0259       <context attribute="String" lineEndContext="#stay" name="find_strings">
0260         <DetectChar attribute="String" context="string_1" char="&apos;"/>
0261         <DetectChar attribute="String" context="string_2" char="&quot;"/>
0262       </context>
0263 
0264       <context attribute="String" lineEndContext="#stay" name="string_1" fallthrough="true" fallthroughContext="#pop">
0265         <RegExpr attribute="String" context="#pop" String="[^&apos;]*&apos;"/>
0266         <RegExpr attribute="Keyword" context="end_of_string" String="&amp;\s*$"/>
0267         <RegExpr attribute="String" context="end_of_string" String=".*(?=&amp;\s*$)"/>
0268       </context>
0269 
0270       <context attribute="String" lineEndContext="#stay" name="string_2" fallthrough="true" fallthroughContext="#pop">
0271         <RegExpr attribute="String" context="#pop" String="[^&quot;]*&quot;"/>
0272         <RegExpr attribute="Keyword" context="end_of_string" String="&amp;\s*$"/>
0273         <RegExpr attribute="String" context="end_of_string" String=".*(?=&amp;\s*$)"/>
0274       </context>
0275 
0276       <context attribute="String" lineEndContext="#stay" name="end_of_string" fallthrough="true" fallthroughContext="#pop#pop">
0277         <DetectSpaces />
0278         <RegExpr attribute="Keyword" context="#stay" String="&amp;\s*$"/>
0279         <DetectChar attribute="Keyword" context="#pop" char="&amp;" firstNonSpace="true"/>
0280         <DetectChar attribute="Comment" context="comment" char="!" firstNonSpace="true"/>
0281       </context>
0282     </contexts>
0283 
0284 <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  -->
0285 <!-- *             S T Y L E   I T E M   D E F I N I T I O N S           *  -->
0286 <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  -->
0287     <itemDatas>
0288       <itemData name="Normal Text" defStyleNum="dsNormal"/>
0289       <itemData name="Keyword" defStyleNum="dsKeyword"/>
0290       <itemData name="Data Type" defStyleNum="dsDataType"/>
0291       <itemData name="String" defStyleNum="dsString"/>
0292       <itemData name="Comment" defStyleNum="dsComment"/>
0293       <itemData name="IO Function" defStyleNum="dsFunction" bold="0" italic="0"/>
0294       <itemData name="Elemental Procedure" defStyleNum="dsBuiltIn" bold="1" italic="0"/>
0295       <itemData name="Inquiry Function" defStyleNum="dsFunction" bold="1" italic="1"/>
0296       <itemData name="Transformational Function" defStyleNum="dsFunction" bold="1" italic="0"/>
0297       <itemData name="Non elemental subroutine" defStyleNum="dsFunction" bold="1" italic="0"/>
0298     </itemDatas>
0299   </highlighting>
0300   <general>
0301     <comments>
0302       <comment name="singleLine" start="!"/>
0303     </comments>
0304     <keywords casesensitive="0"/>
0305   </general>
0306 </language>
0307 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->