medit/moo/mooedit/language-specs/haskell.lang

114 lines
3.7 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language _name="Haskell" version="1.0" _section="Sources" mimetypes="text/x-haskell" globs="*.hs">
<escape-char>\</escape-char>
<line-comment _name = "Line Comment" style= "Comment">
<start-regex>--</start-regex>
</line-comment>
<block-comment _name = "Block Comment" style = "Comment">
<start-regex>\{-</start-regex>
<end-regex>-\}</end-regex>
</block-comment>
<syntax-item _name = "Include/Pragma" style = "Preprocessor">
<start-regex>\{-#</start-regex>
<end-regex>#-\}</end-regex>
</syntax-item>
<pattern-item _name = "Type or Constructor" style = "Data Type">
<regex>\b[A-Z][0-9a-zA-Z._]*(&apos;|#)*</regex>
</pattern-item>
<pattern-item _name = "Keysymbol" style = "Keyword">
<regex>::|-&gt;|&lt;-|=&gt;|=|\||\\|@|~</regex>
</pattern-item>
<!--
<pattern-item _name = "Operator" style = "Operators">
<regex>[:!#$%&amp;*+./&gt;=&lt;?@\\^|~\-]+</regex>
</pattern-item>
<keyword-list _name="Keysymbol" style = "Keyword">
<keyword>::</keyword>
<keyword>-&gt;</keyword>
<keyword>&lt;-</keyword>
<keyword>=&gt;</keyword>
<keyword>=</keyword>
<keyword>|</keyword>`
<keyword>\</keyword>
<keyword>@</keyword>
<keyword>~</keyword>
</keyword-list>
-->
<string _name = "String" style = "String" end-at-line-end = "true">
<start-regex>&quot;</start-regex>
<end-regex>&quot;</end-regex>
</string>
<string _name = "Character Constant" style = "String" end-at-line-end = "true">
<start-regex>[^A-Za-z0-9]&apos;</start-regex>
<end-regex>&apos;</end-regex>
</string>
<pattern-item _name = "Decimal" style = "Decimal">
<regex>\b[0-9]\b</regex>
</pattern-item>
<pattern-item _name = "Floating Point Number" style = "Floating point">
<regex>\b([0-9]+.[0-9]+([eE][+-]?[0-9])?|[0-9][eE][+-]?[0-9])</regex>
</pattern-item>
<pattern-item _name = "Octal Number" style = "Base-N Integer">
<regex>\b[oO][0-7]+\b</regex>
</pattern-item>
<pattern-item _name = "Hex Number" style = "Base-N Integer">
<regex>\b0[xX][0-9a-fA-F]+\b</regex>
</pattern-item>
<keyword-list _name = "Keyword" style = "Keyword" case-sensitive="true">
<keyword>as</keyword>
<keyword>case</keyword>
<keyword>class</keyword>
<keyword>data</keyword>
<keyword>deriving</keyword>
<keyword>do</keyword>
<keyword>else</keyword>
<keyword>forall</keyword> <!-- GHC extension -->
<keyword>hiding</keyword>
<keyword>if</keyword>
<keyword>import</keyword>
<keyword>in</keyword>
<keyword>infix</keyword>
<keyword>infixl</keyword>
<keyword>infixr</keyword>
<keyword>instance</keyword>
<keyword>let</keyword>
<keyword>module</keyword>
<keyword>newtype</keyword>
<keyword>of</keyword>
<keyword>qualified</keyword>
<keyword>then</keyword>
<keyword>where</keyword>
<keyword>with</keyword> <!-- GHC extension -->
</keyword-list>
<keyword-list _name = "Preprocessor Definition" style = "Preprocessor" case-sensitive="true"
match-empty-string-at-beginning = "false"
match-empty-string-at-end = "true"
beginning-regex = "^[ \t]*#[ \t]*">
<keyword>if</keyword>
<keyword>ifdef</keyword>
<keyword>ifndef</keyword>
<keyword>else</keyword>
<keyword>elif</keyword>
<keyword>define</keyword>
<keyword>endif</keyword>
<keyword>undef</keyword>
<keyword>error</keyword>
</keyword-list>
</language>