Warning, /frameworks/syntax-highlighting/data/syntax/fsharp.xml is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!-- Kate syntax highlighting for F# based on the OCAML syntax by Glyn Webster (glyn@wave.co.nz). -->
0003 <!DOCTYPE language
0004 [
0005 <!-- Regular expresion constants: -->
0006 <!ENTITY LETTER "A-Za-z\300-\326\330-\366\370-\377"> <!-- Latin-1 letters. -->
0007 <!ENTITY IDENT "[&LETTER;_][&LETTER;0-9_']*"> <!-- OCaml identifiers. -->
0008 <!ENTITY MIDENT "[A-Z][&LETTER;0-9_']*"> <!-- OCaml uppercase identifiers. -->
0009 <!ENTITY ESC "(\\[ntbr'"\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})"> <!-- OCaml character code escapes. -->
0010 <!ENTITY DEC "[0-9][0-9_]*"> <!-- Decimal digits with underscores. -->
0011 ]>
0012 <language name="FSharp" version="10" kateversion="5.0" section="Sources" extensions="*.fs;*.fsi;*.fsx" mimetype="" priority="10" author="Bas Bossink (bas.bossink@gmail.com)" license="LGPL">
0013
0014 <highlighting>
0015 <list name="keywords">
0016 <item>abstract</item>
0017 <item>and</item>
0018 <item>as</item>
0019 <item>assert</item>
0020 <item>base</item>
0021 <!-- <item>begin</item> -->
0022 <item>class</item>
0023 <item>delegate</item>
0024 <!-- <item>do</item> -->
0025 <!-- <item>done</item> -->
0026 <item>dowcast</item>
0027 <item>downto</item>
0028 <item>elif</item>
0029 <item>else</item>
0030 <!-- <item>end</item> -->
0031 <item>exception</item>
0032 <item>extern</item>
0033 <item>false</item>
0034 <item>for</item>
0035 <item>fun</item>
0036 <item>function</item>
0037 <item>functor</item>
0038 <item>global</item>
0039 <item>if</item>
0040 <item>in</item>
0041 <!-- <item>include</item> -->
0042 <item>inherit</item>
0043 <item>inline</item>
0044 <item>interfaece</item>
0045 <item>internal</item>
0046 <item>lazy</item>
0047 <item>let</item>
0048 <item>match</item>
0049 <item>member</item>
0050 <!-- <item>module</item> -->
0051 <item>mutable</item>
0052 <item>namespace</item>
0053 <item>new</item>
0054 <item>not</item>
0055 <item>null</item>
0056 <!-- <item>object</item> -->
0057 <item>of</item>
0058 <!-- <item>open</item> -->
0059 <item>or</item>
0060 <item>override</item>
0061 <item>private</item>
0062 <item>public</item>
0063 <item>rec</item>
0064 <item>ref</item>
0065 <item>return</item>
0066 <!-- <item>sig</item> -->
0067 <item>static</item>
0068 <!-- <item>struct</item> -->
0069 <item>then</item>
0070 <item>to</item>
0071 <item>true</item>
0072 <item>try</item>
0073 <item>type</item>
0074 <item>upcast</item>
0075 <item>use</item>
0076 <item>val</item>
0077 <item>void</item>
0078 <item>when</item>
0079 <item>while</item>
0080 <item>with</item>
0081 <item>yield</item>
0082 </list>
0083 <list name="core types">
0084 <item>bool</item>
0085 <item>byte</item>
0086 <item>sbyte</item>
0087 <item>int16</item>
0088 <item>uint16</item>
0089 <item>int</item>
0090 <item>uint32</item>
0091 <item>int64</item>
0092 <item>uint64</item>
0093 <item>nativeint</item>
0094 <item>unativeint</item>
0095 <item>char</item>
0096 <item>string</item>
0097 <item>decimal</item>
0098 <item>unit</item>
0099 <item>void</item>
0100 <item>float32</item>
0101 <item>single</item>
0102 <item>float</item>
0103 <item>double</item>
0104 <item>bigint</item>
0105 <item>option</item>
0106 <item>seq</item>
0107 </list>
0108 <list name="end">
0109 <item>end</item>
0110 </list>
0111 <list name="sig">
0112 <item>sig</item>
0113 </list>
0114 <list name="struct">
0115 <item>struct</item>
0116 </list>
0117 <list name="object">
0118 <item>object</item>
0119 </list>
0120 <list name="begin">
0121 <item>begin</item>
0122 </list>
0123 <list name="do">
0124 <item>do</item>
0125 </list>
0126 <list name="done">
0127 <item>done</item>
0128 </list>
0129 <list name="module_environment">
0130 <item>module</item>
0131 <item>open</item>
0132 </list>
0133 <contexts>
0134
0135 <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
0136
0137 <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
0138 <Detect2Chars context="Singleline Comment" char="/" char1="/" />
0139
0140 <DetectChar attribute="Symbol" context="#stay" char="(" beginRegion="paren"/>
0141 <DetectChar attribute="Symbol" context="#stay" char=")" endRegion="paren"/>
0142
0143 <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="record"/>
0144 <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="record"/>
0145 <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="<" beginRegion="attribute"/>
0146 <Detect2Chars attribute="Symbol" context="#stay" char=">" char1="]" endRegion="attribute"/>
0147
0148 <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="|" beginRegion="array"/>
0149 <Detect2Chars attribute="Symbol" context="#stay" char="|" char1="]" endRegion="array"/>
0150 <DetectChar attribute="Symbol" context="#stay" char="[" beginRegion="list"/>
0151 <DetectChar attribute="Symbol" context="#stay" char="]" endRegion="list"/>
0152
0153 <keyword attribute="Keyword" context="#stay" String="do" beginRegion="loop"/>
0154 <keyword attribute="Keyword" context="#stay" String="done" endRegion="loop"/>
0155 <keyword attribute="Directive" context="ModuleEnv" String="module_environment"/>
0156 <keyword attribute="Region Marker" context="Block" String="begin" beginRegion="block"/>
0157 <keyword attribute="Region Marker" context="Object" String="object" beginRegion="object"/>
0158 <keyword attribute="Region Marker" context="Sig" String="sig" beginRegion="sig"/>
0159 <keyword attribute="Region Marker" context="Struct" String="struct" beginRegion="struct"/>
0160
0161 <RegExpr attribute="Constructor" context="#stay" String="`\s*&IDENT;"/>
0162 <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>
0163 <RegExpr attribute="Constructor" context="#stay" String="&MIDENT;"/>
0164
0165 <!-- Interpreter directives. -->
0166 <!-- (These are lines where the first symbol is a '#' followed by an identifier. -->
0167 <!-- Such lines could also be part of a method call split over two lines but -->
0168 <!-- it's unlikey anyone would code like that.) -->
0169 <RegExpr attribute="Directive" context="#stay" String="#&IDENT;.*$" firstNonSpace="true"/>
0170
0171 <!-- String, character and Camlp4 "quotation" constants. -->
0172 <!-- Note: If you must modify the pattern for characters be precise: -->
0173 <!-- single quotes have several meanings in Ocaml. -->
0174 <DetectChar attribute="String" context="String Constant" char=""" />
0175 <RegExpr attribute="Character" context="#stay" String="'(&ESC;|[^'])'" />
0176 <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="<" char1="<" />
0177 <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="<:&IDENT;<" />
0178
0179 <!-- Identifiers and keywords. -->
0180 <keyword attribute="Keyword" context="#stay" String="keywords" />
0181 <keyword attribute="Core Data Type" context="#stay" String="core types" />
0182 <RegExpr attribute="Identifier" context="#stay" String="&IDENT;" />
0183
0184 <!-- Numeric constants. -->
0185 <!-- Note that they may contain underscores. -->
0186 <RegExpr attribute="Hexadecimal" context="#stay" String="-?0[xX][0-9A-Fa-f_]+" />
0187 <RegExpr attribute="Octal" context="#stay" String="-?0[oO][0-7_]+" />
0188 <RegExpr attribute="Binary" context="#stay" String="-?0[bB][01_]+" />
0189 <RegExpr attribute="Float" context="#stay" String="-?&DEC;((\.(&DEC;)?([eE][-+]?&DEC;)?)|([eE][-+]?&DEC;))" />
0190 <RegExpr attribute="Decimal" context="#stay" String="-?&DEC;" />
0191 </context>
0192
0193 <context attribute="Comment" lineEndContext="#pop" name="Singleline Comment">
0194 <DetectSpaces />
0195 <IncludeRules context="##Comments" />
0196 </context>
0197 <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment">
0198 <!-- Support for nested comments -->
0199 <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="comment" />
0200 <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
0201 <DetectSpaces />
0202 <IncludeRules context="##Comments" />
0203 </context>
0204
0205 <context attribute="String" lineEndContext="#stay" name="String Constant">
0206 <DetectChar attribute="String" context="#pop" char=""" />
0207 <!-- An underscore at the end of a line in a string indicates -->
0208 <!-- that the string will continue on the next line. -->
0209 <RegExpr attribute="Escaped characters" context="#stay" String="&ESC;|\\$" />
0210 </context>
0211
0212 <context attribute="Normal Text" lineEndContext="#stay" name="Block">
0213 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="block"/>
0214 <IncludeRules context="Normal"/>
0215 </context>
0216
0217 <context attribute="Normal Text" lineEndContext="#stay" name="Sig">
0218 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="sig"/>
0219 <IncludeRules context="Normal"/>
0220 </context>
0221
0222 <context attribute="Normal Text" lineEndContext="#stay" name="Struct">
0223 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="struct"/>
0224 <IncludeRules context="Normal"/>
0225 </context>
0226
0227 <context attribute="Normal Text" lineEndContext="#stay" name="Object">
0228 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="object"/>
0229 <IncludeRules context="Normal"/>
0230 </context>
0231
0232 <context attribute="Normal Text" lineEndContext="#stay" name="ModuleEnv" fallthrough="true" fallthroughContext="#pop">
0233 <DetectSpaces attribute="Normal Text" context="#stay"/>
0234 <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>
0235 <RegExpr attribute="Module" context="#pop" String="&MIDENT;"/>
0236 </context>
0237
0238 <context attribute="Normal Text" lineEndContext="#stay" name="ModuleEnv2">
0239 <RegExpr attribute="Module" context="#stay" String="&MIDENT;"/>
0240 <DetectSpaces attribute="Normal Text" context="#stay"/>
0241 <DetectChar attribute="Keyword" context="#pop" char="."/>
0242 </context>
0243
0244 <!-- Camlp4 Quotations. These are source code literals used by the Campl4 preprocessor. -->
0245 <!-- The only escapes allowed in a Camlp4 quotation are for the quotation start and stop symbols. -->
0246 <context attribute="Camlp4 Quotation" lineEndContext="#stay" name="Camlp4 Quotation Constant">
0247 <Detect2Chars attribute="Camlp4 Quotation" context="#pop" char=">" char1=">" />
0248 <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="<" char1="<" />
0249 <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="<:&IDENT;<" />
0250 <RegExpr attribute="Escaped characters" context="#stay" String="\\(\\|>>|<<|<:&IDENT;<)" />
0251 </context>
0252 </contexts>
0253
0254 <itemDatas>
0255 <itemData name="Normal Text" defStyleNum="dsNormal"/>
0256 <itemData name="Identifier" defStyleNum="dsNormal"/>
0257 <itemData name="Symbol" defStyleNum="dsOperator"/>
0258 <itemData name="Keyword" defStyleNum="dsKeyword"/>
0259 <itemData name="Core Data Type" defStyleNum="dsDataType"/>
0260 <itemData name="Decimal" defStyleNum="dsDecVal"/>
0261 <itemData name="Hexadecimal" defStyleNum="dsBaseN"/>
0262 <itemData name="Octal" defStyleNum="dsBaseN"/>
0263 <itemData name="Binary" defStyleNum="dsBaseN"/>
0264 <itemData name="Float" defStyleNum="dsFloat"/>
0265 <itemData name="Character" defStyleNum="dsChar"/>
0266 <itemData name="String" defStyleNum="dsString"/>
0267 <itemData name="Escaped characters" defStyleNum="dsSpecialChar"/>
0268 <itemData name="Comment" defStyleNum="dsComment"/>
0269 <itemData name="Camlp4 Quotation" defStyleNum="dsString"/>
0270 <itemData name="Directive" defStyleNum="dsOthers"/>
0271 <itemData name="Constructor" defStyleNum="dsNormal"/>
0272 <itemData name="Module" defStyleNum="dsNormal"/>
0273 <itemData name="Region Marker" defStyleNum="dsKeyword"/>
0274 </itemDatas>
0275 </highlighting>
0276
0277 <general>
0278 <keywords casesensitive="1" />
0279 <comments>
0280 <comment name="singleLine" start="//" />
0281 <comment name="multiLine" start="(*" end="*)" region="comment" />
0282 </comments>
0283 </general>
0284 </language>
0285 <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->