home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / fsharp.lang < prev    next >
Encoding:
Extensible Markup Language  |  2010-08-16  |  10.9 KB  |  323 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3.   Author: Alexander Kuleshov <kuleshovmail@gmail.com>
  4.   Copyright (C) 2009-2010 Alexander Kuleshov <kuleshovmail@gmail.com>
  5.  
  6.  This library is free software; you can redistribute it and/or
  7.  modify it under the terms of the GNU Library General Public
  8.  License as published by the Free Software Foundation; either
  9.  version 2 of the License, or (at your option) any later version.
  10.  
  11.  This library is distributed in the hope that it will be useful,
  12.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  Library General Public License for more details.
  15.  
  16.  You should have received a copy of the GNU Library General Public
  17.  License along with this library; if not, write to the
  18.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  Boston, MA 02111-1307, USA.
  20.  
  21. -->
  22.  
  23. <language id="fsharp" _name="F#" version="2.0" _section="Sources">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-fsharp</property>
  26.     <property name="globs">*.fs;</property>
  27.     <property name="line-comment-start">//</property>
  28.     <property name="block-comment-start">(*</property>
  29.     <property name="block-comment-end">*)</property>
  30.   </metadata>
  31.   <styles>
  32.     <style id="comment" _name="Comment" map-to="def:comment"/>
  33.     <style id="base-n-integer" _name="Base-N Integer" map-to="def:base-n-integer"/>
  34.     <style id="floating-point" _name="Floating Point number" map-to="def:floating-point"/>
  35.     <style id="decimal" _name="Decimal number" map-to="def:decimal"/>
  36.     <style id="string" _name="String" map-to="def:string"/>
  37.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  38.     <style id="meta-keyword" _name="Type, module or object keyword" map-to="def:keyword"/>
  39.     <style id="fun-keyword" _name="Builtin-function keyword" map-to="def:keyword"/>
  40.     <style id="type" _name="Data Type" map-to="def:type"/>
  41.     <style id="label" _name="Labeled argument" map-to="def:type"/>
  42.     <style id="poly-variant" _name="Polymorphic Variant" map-to="def:type"/>
  43.     <style id="variant" _name="Variant Constructor" map-to="def:type"/>
  44.     <style id="type-var" _name="Type Variable" map-to="def:type"/>
  45.     <style id="module" _name="Module Path" map-to="def:type"/>
  46.     <style id="escape" _name="Escaped Character" map-to="def:special-char"/>
  47.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  48.     <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
  49.     <style id="null-value" _name="Null Value" map-to="def:special-constant"/>
  50.   </styles>
  51.   
  52.   <definitions>
  53.     <define-regex id="cap-ident">\b[A-Z][A-Za-z0-9_']*</define-regex>
  54.     <define-regex id="low-ident">\b[a-z][A-Za-z0-9_']*</define-regex>
  55.     <define-regex id="char-esc">\\((\\|"|'|n|t|b|r)|[0-9]{3}|x[0-9a-fA-F]{2})</define-regex>
  56.     <define-regex id="preproc-start">^\s*#\s*</define-regex>
  57.     <define-regex id="symbolchar">[!#$%&*+./>=<?@:\\^|~-]</define-regex>
  58.   
  59.     <context id="escape-seq" style-ref="escape">
  60.       <match>\%{char-esc}</match>
  61.     </context>
  62.        
  63.     <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
  64.       <start>//</start>
  65.         <include>
  66.           <context ref="def:in-line-comment"/>
  67.         </include>
  68.     </context>
  69.     
  70.     <context id="multiline-comment" style-ref="comment" class="comment" class-disabled="no-spell-check">
  71.       <start>\(\*</start>
  72.       <end>\*\)</end>
  73.         <include>
  74.           <context ref="string"/>
  75.           <context ref="def:in-comment:*"/>
  76.         </include>
  77.     </context>
  78.     
  79.     <context id="if0-comment" style-ref="comment" class="comment" class-disabled="no-spell-check">
  80.       <start>\%{preproc-start}if\b\s*0\b</start>
  81.       <end>\%{preproc-start}(endif|else|elif)\b</end>
  82.       <include>
  83.         <context id="if-in-if0">
  84.           <start>\%{preproc-start}if(n?def)?\b</start>
  85.           <end>\%{preproc-start}endif\b</end>
  86.           <include>
  87.             <context ref="if-in-if0"/>
  88.             <context ref="def:in-comment"/>
  89.           </include>
  90.         </context>
  91.         <context ref="def:in-comment"/>
  92.       </include>
  93.     </context>
  94.     
  95.     <context id="preprocessor" style-ref="preprocessor" end-at-line-end="true">
  96.       <start extended="true">
  97.         \%{preproc-start}
  98.         (if(n?def)?|else|endif|light|region|endregion)\b
  99.       </start>
  100.       <include>
  101.         <context ref="def:line-continue" ignore-style="true"/>
  102.         <context ref="string" ignore-style="true"/>
  103.         <context ref="line-comment"/>
  104.         <context ref="multiline-comment"/>
  105.       </include>
  106.     </context>
  107.     
  108.     <context id="hex-number" style-ref="base-n-integer">
  109.       <match>[-]?0[xX][0-9A-Fa-f][0-9A-Fa-f_]*[lL]?</match>
  110.     </context>
  111.     
  112.     <context id="octal-number" style-ref="base-n-integer">
  113.       <match>[-]?0[oO][0-7][0-7_]*[lL]?</match>
  114.     </context>
  115.     
  116.     <context id="binary-number" style-ref="base-n-integer">
  117.       <match>[-]?0[bB][01][01_]*[lL]?</match>
  118.     </context>
  119.     
  120.     <context id="label" style-ref="label">
  121.       <match>[~?]\%{low-ident}</match>
  122.     </context>
  123.     
  124.     <context id="if-false-comment" style-ref="comment">
  125.       <start>\%{preproc-start}if\s*false\b</start>
  126.       <end>\%{preproc-start}(endif|else|elif)\b</end>
  127.         <include>
  128.           <context id="if-in-if-false">
  129.             <start>\%{preproc-start}if(n?def)?\b</start>
  130.             <end>\%{preproc-start}endif\b</end>
  131.               <include>
  132.                 <context ref="if-in-if-false"/>
  133.                 <context ref="def:in-comment"/>
  134.               </include>
  135.           </context>
  136.           <context ref="def:in-comment"/>
  137.       </include>
  138.     </context>
  139.     
  140.     <context id="poly-variant" style-ref="poly-variant">
  141.       <match>`\%{cap-ident}</match>
  142.     </context>
  143.     
  144.     <context id="modpath" style-ref="module">
  145.       <match>\%{cap-ident}(\.\%{cap-ident})*(?=\.)</match>
  146.     </context>
  147.     
  148.     <context id="variant" style-ref="variant">
  149.       <match>\%{cap-ident}</match>
  150.     </context>
  151.     
  152.     <context id="string" style-ref="string">
  153.       <start>"</start>
  154.       <end>"</end>
  155.       <include>
  156.         <context ref="escape-seq"/>
  157.       </include>
  158.     </context>
  159.     
  160.     <context id="character-constant" style-ref="string">
  161.       <match>('\%{char-esc}')|('[^\\']')</match>
  162.     </context>
  163.     
  164.     <context id="type-var" style-ref="type-var">
  165.       <match>'\%{low-ident}</match>
  166.     </context>
  167.     
  168.     <context id="arraylit">
  169.       <start>\[\|</start>
  170.       <end>\|\]</end>
  171.     </context>
  172.     
  173.     <context id="decimal" style-ref="decimal">
  174.       <match extended="true">
  175.         (?<![\w\.])
  176.         [0-9]+[uUlL]*
  177.         (?![\w\.])
  178.       </match>
  179.     </context>
  180.     
  181.     <context id="boolean-constant" style-ref="boolean">
  182.       <keyword>true</keyword>
  183.       <keyword>false</keyword>
  184.     </context>
  185.     
  186.     <context id="keysymbol" style-ref="keyword">
  187.       <prefix>(?<!\%{symbolchar})</prefix>
  188.       <suffix>(?!\%{symbolchar})</suffix>
  189.         <keyword>\.\.</keyword>
  190.         <keyword>::</keyword>
  191.         <keyword>=</keyword>
  192.         <keyword>@</keyword>
  193.         <keyword>~</keyword>
  194.         <keyword>-></keyword>
  195.         <keyword>|</keyword>
  196.         <keyword>:?</keyword>
  197.         <keyword>:?></keyword>
  198.         <keyword>^</keyword>
  199.         <keyword><-</keyword>
  200.         <keyword>&&</keyword>
  201.         <keyword>&</keyword>
  202.     </context>
  203.     
  204.     <context id="keywords" style-ref="keyword">
  205.       <keyword>abstract</keyword>
  206.       <keyword>and</keyword>
  207.       <keyword>as</keyword>
  208.       <keyword>assert</keyword>
  209.       <keyword>asr</keyword>
  210.       <keyword>begin</keyword>
  211.       <keyword>class</keyword>
  212.       <keyword>default</keyword>
  213.       <keyword>delegate</keyword>
  214.       <keyword>do</keyword>
  215.       <keyword>done</keyword>
  216.       <keyword>downcast</keyword>
  217.       <keyword>downto</keyword>
  218.       <keyword>else</keyword>
  219.       <keyword>end</keyword>
  220.       <keyword>enum</keyword>
  221.       <keyword>exception</keyword>
  222.       <keyword>false</keyword>
  223.       <keyword>finaly</keyword>
  224.       <keyword>for</keyword>
  225.       <keyword>fun</keyword>
  226.       <keyword>function</keyword>
  227.       <keyword>if</keyword>
  228.       <keyword>in</keyword>
  229.       <keyword>iherit</keyword>
  230.       <keyword>interface</keyword>
  231.       <keyword>land</keyword>
  232.       <keyword>lazy</keyword>
  233.       <keyword>let</keyword>
  234.       <keyword>lor</keyword>
  235.       <keyword>lsl</keyword>
  236.       <keyword>lsr</keyword>
  237.       <keyword>lxor</keyword>
  238.       <keyword>match</keyword>
  239.       <keyword>member</keyword>
  240.       <keyword>mod</keyword>
  241.       <keyword>module</keyword>
  242.       <keyword>mutable</keyword>
  243.       <keyword>namespace</keyword>
  244.       <keyword>new</keyword>
  245.       <keyword>null</keyword>
  246.       <keyword>of</keyword>
  247.       <keyword>open</keyword>
  248.       <keyword>or</keyword>
  249.       <keyword>override</keyword>
  250.       <keyword>sig</keyword>
  251.       <keyword>static</keyword>
  252.       <keyword>struct</keyword>
  253.       <keyword>then</keyword>
  254.       <keyword>to</keyword>
  255.       <keyword>true</keyword>
  256.       <keyword>try</keyword>
  257.       <keyword>type</keyword>
  258.       <keyword>val</keyword>
  259.       <keyword>when</keyword>
  260.       <keyword>inline</keyword>
  261.       <keyword>upcast</keyword>
  262.       <keyword>while</keyword>
  263.       <keyword>with</keyword>
  264.       <keyword>async</keyword>
  265.       <keyword>atomic</keyword>
  266.       <keyword>break</keyword>
  267.       <keyword>checked</keyword>
  268.       <keyword>component</keyword>
  269.       <keyword>const</keyword>
  270.       <keyword>constructor</keyword>
  271.       <keyword>continue</keyword>
  272.       <keyword>eager</keyword>
  273.       <keyword>event</keyword>
  274.       <keyword>external</keyword>
  275.       <keyword>fixed</keyword>
  276.       <keyword>functor</keyword>
  277.       <keyword>include</keyword>
  278.       <keyword>method</keyword>
  279.       <keyword>mixin</keyword>
  280.       <keyword>process</keyword>
  281.       <keyword>property</keyword>
  282.       <keyword>protected</keyword>
  283.       <keyword>public</keyword>
  284.       <keyword>pure</keyword>
  285.       <keyword>readonly</keyword>
  286.       <keyword>return</keyword>
  287.       <keyword>sealed</keyword>
  288.       <keyword>switch</keyword>
  289.       <keyword>virtual</keyword>
  290.       <keyword>void</keyword>
  291.       <keyword>volatile</keyword>
  292.       <keyword>where</keyword>
  293.     </context>
  294.  
  295.     <!-- main context -->
  296.     <context id="fsharp" class="no-spell-check">
  297.       <include>
  298.         <context ref="keywords"/>
  299.         <context ref="keysymbol"/>
  300.         <context ref="boolean-constant"/>
  301.         <context ref="arraylit"/>
  302.         <context ref="character-constant"/>
  303.         <context ref="string"/>
  304.         <context ref="variant"/>
  305.         <context ref="modpath"/>
  306.         <context ref="poly-variant"/>
  307.         <context ref="label"/> 
  308.         <context ref="binary-number"/>
  309.         <context ref="octal-number"/> 
  310.         <context ref="hex-number"/>
  311.         <context ref="line-comment"/>
  312.         <context ref="multiline-comment"/>
  313.         <context ref="type-var"/>
  314.         <context ref="if-false-comment"/>
  315.         <context ref="preprocessor"/>
  316.         <context ref="if0-comment"/>
  317.         <context ref="decimal"/>
  318.       </include>
  319.     </context>
  320.     <!-- main context -->
  321.   </definitions>
  322. </language>
  323.