Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/fortran-free.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd"> | 2 | <!DOCTYPE language SYSTEM "language.dtd"> | ||
3 | <language name="Fortran (Free Format)" version="2" 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"> | 3 | <language name="Fortran (Free Format)" version="3" 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"> | ||
4 | <!-- Original author: Franchin Matteo (fnch@libero.it). | 4 | <!-- Original author: Franchin Matteo (fnch@libero.it). | ||
5 | Adaptation to free & fixed format: Janus Weil. | 5 | Adaptation to free & fixed format: Janus Weil. | ||
6 | --> | 6 | --> | ||
7 | <!-- NOTE: Keep in sync with the "Fortran (Fixed Format)" highlighter! (fortran-fixed.xml) --> | 7 | <!-- NOTE: Keep in sync with the "Fortran (Fixed Format)" highlighter! (fortran-fixed.xml) --> | ||
8 | <highlighting> | 8 | <highlighting> | ||
9 | 9 | | |||
10 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | 10 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
11 | <!-- * L I S T S * --> | 11 | <!-- * L I S T S * --> | ||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 157 | <!-- inside_func_paren##Fortran (Fixed Format) --> | |||
159 | <DetectChar attribute="Normal Text" context="#pop" char=")"/> | 159 | <DetectChar attribute="Normal Text" context="#pop" char=")"/> | ||
160 | <IncludeRules context="find_strings" /> | 160 | <IncludeRules context="find_strings" /> | ||
161 | <IncludeRules context="find_intrinsics" /> | 161 | <IncludeRules context="find_intrinsics" /> | ||
162 | <IncludeRules context="find_numbers##Fortran (Fixed Format)" /> | 162 | <IncludeRules context="find_numbers##Fortran (Fixed Format)" /> | ||
163 | </context> | 163 | </context> | ||
164 | 164 | | |||
165 | <!-- The following two contexts match input/output statements --> | 165 | <!-- The following two contexts match input/output statements --> | ||
166 | <context attribute="Normal Text" lineEndContext="#stay" name="find_io_stmnts"> | 166 | <context attribute="Normal Text" lineEndContext="#stay" name="find_io_stmnts"> | ||
167 | <RegExpr attribute="IO Function" context="find_io_paren" String="\b(flush|wait)\s*[(]" insensitive="true"/> | 167 | <RegExpr attribute="IO Function" context="find_io_paren" String="\b(?:flush|wait)\s*[(]" insensitive="true"/> | ||
168 | <!-- find_io_stmnts##Fortran (Fixed Format) --> | 168 | <!-- find_io_stmnts##Fortran (Fixed Format) --> | ||
169 | <RegExpr attribute="IO Function" context="find_io_paren" String="\b(read|write|backspace|rewind|end\s*file|close|open|inquire)\s*[(]" insensitive="true"/> | 169 | <RegExpr attribute="IO Function" context="find_io_paren" String="\b(?:read|write|backspace|rewind|end\s*file|close|open|inquire)\s*[(]" insensitive="true"/> | ||
170 | <RegExpr attribute="IO Function" context="format_stmnt" String="\bformat\s*[(]" insensitive="true"/> | 170 | <RegExpr attribute="IO Function" context="format_stmnt" String="\bformat\s*[(]" insensitive="true"/> | ||
171 | <RegExpr attribute="IO Function" context="#stay" String="\bend\s*file\b" insensitive="true"/> | 171 | <RegExpr attribute="IO Function" context="#stay" String="\bend\s*file\b" insensitive="true"/> | ||
172 | <keyword attribute="IO Function" context="#stay" String="io_functions"/> | 172 | <keyword attribute="IO Function" context="#stay" String="io_functions"/> | ||
173 | </context> | 173 | </context> | ||
174 | <!-- This context matches parenthesis for the read, write, ... statements --> | 174 | <!-- This context matches parenthesis for the read, write, ... statements --> | ||
175 | <context attribute="Normal Text" lineEndContext="#stay" name="find_io_paren"> | 175 | <context attribute="Normal Text" lineEndContext="#stay" name="find_io_paren"> | ||
176 | <!-- find_io_paren##Fortran (Fixed Format) --> | 176 | <!-- find_io_paren##Fortran (Fixed Format) --> | ||
177 | <DetectChar attribute="IO Function" context="#stay" char="*"/> | 177 | <DetectChar attribute="IO Function" context="#stay" char="*"/> | ||
Show All 14 Lines | 189 | <context attribute="Normal Text" lineEndContext="#stay" name="format_stmnt"> | |||
192 | <IncludeRules context="find_strings" /> | 192 | <IncludeRules context="find_strings" /> | ||
193 | <IncludeRules context="format_stmnt##Fortran (Fixed Format)" /> | 193 | <IncludeRules context="format_stmnt##Fortran (Fixed Format)" /> | ||
194 | </context> | 194 | </context> | ||
195 | 195 | | |||
196 | <!-- FIXME: beginRegion/endRegion don't work well with IncludeRules. When this is corrected, use IncludeRules instead of replicating rules. --> | 196 | <!-- FIXME: beginRegion/endRegion don't work well with IncludeRules. When this is corrected, use IncludeRules instead of replicating rules. --> | ||
197 | <!-- The following context matches the begin of program units --> | 197 | <!-- The following context matches the begin of program units --> | ||
198 | <context attribute="Normal Text" lineEndContext="#stay" name="find_begin_stmnts"> | 198 | <context attribute="Normal Text" lineEndContext="#stay" name="find_begin_stmnts"> | ||
199 | <WordDetect attribute="Keyword" context="#stay" String="submodule" insensitive="true" beginRegion="Routine"/> | 199 | <WordDetect attribute="Keyword" context="#stay" String="submodule" insensitive="true" beginRegion="Routine"/> | ||
200 | <RegExpr attribute="Keyword" context="#stay" String="\b(do\s*(,|\s)\s*concurrent|select\s+type|block|critical)\b" insensitive="true" beginRegion="Block"/> | 200 | <RegExpr attribute="Keyword" context="#stay" String="\b(?:do\s*[,\s]\s*concurrent|select\s+type|block|critical)\b" insensitive="true" beginRegion="Block"/> | ||
201 | <!-- Here IncludeRules: find_begin_stmnts##Fortran (Fixed Format) --> | 201 | <!-- Here IncludeRules: find_begin_stmnts##Fortran (Fixed Format) --> | ||
202 | <RegExpr attribute="Keyword" context="#stay" String="\bmodule\s+procedure\b" insensitive="true"/> | 202 | <RegExpr attribute="Keyword" context="#stay" String="\bmodule\s+procedure\b" insensitive="true"/> | ||
203 | <RegExpr attribute="Keyword" context="#stay" String="\b(subroutine|function|block\s*data|program|module)\b" insensitive="true" beginRegion="Routine"/> | 203 | <RegExpr attribute="Keyword" context="#stay" String="\b(?:subroutine|function|block\s*data|program|module)\b" insensitive="true" beginRegion="Routine"/> | ||
204 | <RegExpr attribute="Keyword" context="#stay" String="\b(then|do|select\s+case)\b" insensitive="true" beginRegion="Block"/> | 204 | <RegExpr attribute="Keyword" context="#stay" String="\b(?:then|do|select\s+case)\b" insensitive="true" beginRegion="Block"/> | ||
205 | </context> | 205 | </context> | ||
206 | <!-- The following context matches the end of program units --> | 206 | <!-- The following context matches the end of program units --> | ||
207 | <context attribute="Normal Text" lineEndContext="#stay" name="find_end_stmnts"> | 207 | <context attribute="Normal Text" lineEndContext="#stay" name="find_end_stmnts"> | ||
208 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(procedure|submodule)\b" insensitive="true" endRegion="Routine"/> | 208 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:procedure|submodule)\b" insensitive="true" endRegion="Routine"/> | ||
209 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(block|critical)\b" insensitive="true" endRegion="Block"/> | 209 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:block|critical)\b" insensitive="true" endRegion="Block"/> | ||
210 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(associate)\b" insensitive="true"/> | 210 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:associate)\b" insensitive="true"/> | ||
211 | <RegExpr attribute="Data Type" context="#stay" String="\bend\s*(type|enum)\b" insensitive="true"/> | 211 | <RegExpr attribute="Data Type" context="#stay" String="\bend\s*(?:type|enum)\b" insensitive="true"/> | ||
212 | <!-- Here IncludeRules: find_end_stmnts##Fortran (Fixed Format) --> | 212 | <!-- Here IncludeRules: find_end_stmnts##Fortran (Fixed Format) --> | ||
213 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(subroutine|function|block\s*data|program|module)\b" insensitive="true" endRegion="Routine"/> | 213 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:subroutine|function|block\s*data|program|module)\b" insensitive="true" endRegion="Routine"/> | ||
214 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(do|if)\b" insensitive="true" endRegion="Block"/> | 214 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:do|if)\b" insensitive="true" endRegion="Block"/> | ||
215 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(select|where|forall|interface)\b" insensitive="true"/> | 215 | <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(?:select|where|forall|interface)\b" insensitive="true"/> | ||
216 | <RegExpr attribute="Keyword" context="#stay" String="\belse\s*if\b" insensitive="true" endRegion="Block"/> | 216 | <RegExpr attribute="Keyword" context="#stay" String="\belse\s*if\b" insensitive="true" endRegion="Block"/> | ||
217 | <WordDetect attribute="Keyword" context="#stay" String="end" insensitive="true" endRegion="Routine"/> | 217 | <WordDetect attribute="Keyword" context="#stay" String="end" insensitive="true" endRegion="Routine"/> | ||
218 | </context> | 218 | </context> | ||
219 | <!-- The following context matches the mid of program units --> | 219 | <!-- The following context matches the mid of program units --> | ||
220 | <context attribute="Normal Text" lineEndContext="#stay" name="find_mid_stmnts"> | 220 | <context attribute="Normal Text" lineEndContext="#stay" name="find_mid_stmnts"> | ||
221 | <RegExpr attribute="Keyword" context="#stay" String="\b(type\s+is|class\s+(is|default))\b" insensitive="true" endRegion="Block" beginRegion="Block"/> | 221 | <RegExpr attribute="Keyword" context="#stay" String="\b(?:type\s+is|class\s+(?:is|default))\b" insensitive="true" endRegion="Block" beginRegion="Block"/> | ||
222 | <!-- Here IncludeRules: find_mid_stmnts##Fortran (Fixed Format) --> | 222 | <!-- Here IncludeRules: find_mid_stmnts##Fortran (Fixed Format) --> | ||
223 | <WordDetect attribute="Keyword" context="#stay" String="else" insensitive="true" endRegion="Block" beginRegion="Block"/> | 223 | <WordDetect attribute="Keyword" context="#stay" String="else" insensitive="true" endRegion="Block" beginRegion="Block"/> | ||
224 | <RegExpr attribute="Keyword" context="#stay" String="\bcase(\s+default)?\b" insensitive="true" endRegion="Block" beginRegion="Block"/> | 224 | <RegExpr attribute="Keyword" context="#stay" String="\bcase(?:\s+default)?\b" insensitive="true" endRegion="Block" beginRegion="Block"/> | ||
225 | <WordDetect attribute="Keyword" context="#stay" String="contains" insensitive="true" endRegion="Routine" beginRegion="Routine"/> | 225 | <WordDetect attribute="Keyword" context="#stay" String="contains" insensitive="true" endRegion="Routine" beginRegion="Routine"/> | ||
226 | </context> | 226 | </context> | ||
227 | 227 | | |||
228 | <!-- The following two contexts match declarations --> | 228 | <!-- The following two contexts match declarations --> | ||
229 | <context attribute="Normal Text" lineEndContext="#stay" name="find_decls"> | 229 | <context attribute="Normal Text" lineEndContext="#stay" name="find_decls"> | ||
230 | <RegExpr attribute="Data Type" context="find_paren" String="\b(class|extends|procedure|pass|codimension)\s*[(]" insensitive="true"/> | 230 | <RegExpr attribute="Data Type" context="find_paren" String="\b(?:class|extends|procedure|pass|codimension)\s*[(]" insensitive="true"/> | ||
231 | <WordDetect attribute="Data Type" context="#stay" String="codimension" insensitive="true"/> | 231 | <WordDetect attribute="Data Type" context="#stay" String="codimension" insensitive="true"/> | ||
232 | <WordDetect attribute="Data Type" context="#stay" String="procedure" insensitive="true"/> | 232 | <WordDetect attribute="Data Type" context="#stay" String="procedure" insensitive="true"/> | ||
233 | <WordDetect attribute="Data Type" context="#stay" String="pass" insensitive="true"/> | 233 | <WordDetect attribute="Data Type" context="#stay" String="pass" insensitive="true"/> | ||
234 | <!-- find_decls##Fortran (Fixed Format) --> | 234 | <!-- find_decls##Fortran (Fixed Format) --> | ||
235 | <keyword attribute="Data Type" context="#stay" String="types"/> | 235 | <keyword attribute="Data Type" context="#stay" String="types"/> | ||
236 | <!--<RegExpr attribute="Data Type" context="find_paren" String="real\s*[(]" firstNonSpace="true" insensitive="true"/>--> | 236 | <!--<RegExpr attribute="Data Type" context="find_paren" String="real\s*[(]" firstNonSpace="true" insensitive="true"/>--> | ||
237 | <RegExpr attribute="Data Type" context="find_paren" String="\b(type|integer|real|complex|character|logical|intent|dimension)\s*[(]" insensitive="true"/> | 237 | <RegExpr attribute="Data Type" context="find_paren" String="\b(?:type|integer|real|complex|character|logical|intent|dimension)\s*[(]" insensitive="true"/> | ||
238 | <IncludeRules context="find_decls##Fortran (Fixed Format)"/> | 238 | <IncludeRules context="find_decls##Fortran (Fixed Format)"/> | ||
239 | </context> | 239 | </context> | ||
240 | <!-- This context matches parenthesis in data type declarations, such as in 'real(...)'--> | 240 | <!-- This context matches parenthesis in data type declarations, such as in 'real(...)'--> | ||
241 | <context attribute="Data Type" lineEndContext="#pop" name="find_paren"> | 241 | <context attribute="Data Type" lineEndContext="#pop" name="find_paren"> | ||
242 | <!-- find_paren##Fortran (Fixed Format) --> | 242 | <!-- find_paren##Fortran (Fixed Format) --> | ||
243 | <DetectChar attribute="Data Type" context="find_paren" char="("/> | 243 | <DetectChar attribute="Data Type" context="find_paren" char="("/> | ||
244 | <DetectChar attribute="Data Type" context="find_paren" char="["/> | 244 | <DetectChar attribute="Data Type" context="find_paren" char="["/> | ||
245 | <DetectChar attribute="Data Type" context="#pop" char=")"/> | 245 | <DetectChar attribute="Data Type" context="#pop" char=")"/> | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |