272 lines
7.9 KiB
XML
272 lines
7.9 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>Haskell</name>
|
||
|
<alias>haskell</alias>
|
||
|
<alias>hs</alias>
|
||
|
<filename>*.hs</filename>
|
||
|
<mime_type>text/x-haskell</mime_type>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<state name="escape">
|
||
|
<rule pattern="[abfnrtv"\'&\\]">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="\^[][\p{Lu}@^_]">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="o[0-7]+">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="x[\da-fA-F]+">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="\d+">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="\s+\\">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="root">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
<rule pattern="--(?![!#$%&*+./<=>?@^|_~:\\]).*?$">
|
||
|
<token type="CommentSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="\{-">
|
||
|
<token type="CommentMultiline"/>
|
||
|
<push state="comment"/>
|
||
|
</rule>
|
||
|
<rule pattern="\bimport\b">
|
||
|
<token type="KeywordReserved"/>
|
||
|
<push state="import"/>
|
||
|
</rule>
|
||
|
<rule pattern="\bmodule\b">
|
||
|
<token type="KeywordReserved"/>
|
||
|
<push state="module"/>
|
||
|
</rule>
|
||
|
<rule pattern="\berror\b">
|
||
|
<token type="NameException"/>
|
||
|
</rule>
|
||
|
<rule pattern="\b(case|class|data|default|deriving|do|else|family|if|in|infix[lr]?|instance|let|newtype|of|then|type|where|_)(?!\')\b">
|
||
|
<token type="KeywordReserved"/>
|
||
|
</rule>
|
||
|
<rule pattern="'[^\\]'">
|
||
|
<token type="LiteralStringChar"/>
|
||
|
</rule>
|
||
|
<rule pattern="^[_\p{Ll}][\w\']*">
|
||
|
<token type="NameFunction"/>
|
||
|
</rule>
|
||
|
<rule pattern="'?[_\p{Ll}][\w']*">
|
||
|
<token type="Name"/>
|
||
|
</rule>
|
||
|
<rule pattern="('')?[\p{Lu}][\w\']*">
|
||
|
<token type="KeywordType"/>
|
||
|
</rule>
|
||
|
<rule pattern="(')[\p{Lu}][\w\']*">
|
||
|
<token type="KeywordType"/>
|
||
|
</rule>
|
||
|
<rule pattern="(')\[[^\]]*\]">
|
||
|
<token type="KeywordType"/>
|
||
|
</rule>
|
||
|
<rule pattern="(')\([^)]*\)">
|
||
|
<token type="KeywordType"/>
|
||
|
</rule>
|
||
|
<rule pattern="\\(?![:!#$%&*+.\\/<=>?@^|~-]+)">
|
||
|
<token type="NameFunction"/>
|
||
|
</rule>
|
||
|
<rule pattern="(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)">
|
||
|
<token type="OperatorWord"/>
|
||
|
</rule>
|
||
|
<rule pattern=":[:!#$%&*+.\\/<=>?@^|~-]*">
|
||
|
<token type="KeywordType"/>
|
||
|
</rule>
|
||
|
<rule pattern="[:!#$%&*+.\\/<=>?@^|~-]+">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="\d+[eE][+-]?\d+">
|
||
|
<token type="LiteralNumberFloat"/>
|
||
|
</rule>
|
||
|
<rule pattern="\d+\.\d+([eE][+-]?\d+)?">
|
||
|
<token type="LiteralNumberFloat"/>
|
||
|
</rule>
|
||
|
<rule pattern="0[oO][0-7]+">
|
||
|
<token type="LiteralNumberOct"/>
|
||
|
</rule>
|
||
|
<rule pattern="0[xX][\da-fA-F]+">
|
||
|
<token type="LiteralNumberHex"/>
|
||
|
</rule>
|
||
|
<rule pattern="\d+">
|
||
|
<token type="LiteralNumberInteger"/>
|
||
|
</rule>
|
||
|
<rule pattern="'">
|
||
|
<token type="LiteralStringChar"/>
|
||
|
<push state="character"/>
|
||
|
</rule>
|
||
|
<rule pattern=""">
|
||
|
<token type="LiteralString"/>
|
||
|
<push state="string"/>
|
||
|
</rule>
|
||
|
<rule pattern="\[\]">
|
||
|
<token type="KeywordType"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(\)">
|
||
|
<token type="NameBuiltin"/>
|
||
|
</rule>
|
||
|
<rule pattern="[][(),;`{}]">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="import">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
<rule pattern=""">
|
||
|
<token type="LiteralString"/>
|
||
|
<push state="string"/>
|
||
|
</rule>
|
||
|
<rule pattern="\)">
|
||
|
<token type="Punctuation"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="qualified\b">
|
||
|
<token type="Keyword"/>
|
||
|
</rule>
|
||
|
<rule pattern="([\p{Lu}][\w.]*)(\s+)(as)(\s+)([\p{Lu}][\w.]*)">
|
||
|
<bygroups>
|
||
|
<token type="NameNamespace"/>
|
||
|
<token type="Text"/>
|
||
|
<token type="Keyword"/>
|
||
|
<token type="Text"/>
|
||
|
<token type="Name"/>
|
||
|
</bygroups>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="([\p{Lu}][\w.]*)(\s+)(hiding)(\s+)(\()">
|
||
|
<bygroups>
|
||
|
<token type="NameNamespace"/>
|
||
|
<token type="Text"/>
|
||
|
<token type="Keyword"/>
|
||
|
<token type="Text"/>
|
||
|
<token type="Punctuation"/>
|
||
|
</bygroups>
|
||
|
<push state="funclist"/>
|
||
|
</rule>
|
||
|
<rule pattern="([\p{Lu}][\w.]*)(\s+)(\()">
|
||
|
<bygroups>
|
||
|
<token type="NameNamespace"/>
|
||
|
<token type="Text"/>
|
||
|
<token type="Punctuation"/>
|
||
|
</bygroups>
|
||
|
<push state="funclist"/>
|
||
|
</rule>
|
||
|
<rule pattern="[\w.]+">
|
||
|
<token type="NameNamespace"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="module">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
<rule pattern="([\p{Lu}][\w.]*)(\s+)(\()">
|
||
|
<bygroups>
|
||
|
<token type="NameNamespace"/>
|
||
|
<token type="Text"/>
|
||
|
<token type="Punctuation"/>
|
||
|
</bygroups>
|
||
|
<push state="funclist"/>
|
||
|
</rule>
|
||
|
<rule pattern="[\p{Lu}][\w.]*">
|
||
|
<token type="NameNamespace"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="funclist">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="Text"/>
|
||
|
</rule>
|
||
|
<rule pattern="[\p{Lu}]\w*">
|
||
|
<token type="KeywordType"/>
|
||
|
</rule>
|
||
|
<rule pattern="(_[\w\']+|[\p{Ll}][\w\']*)">
|
||
|
<token type="NameFunction"/>
|
||
|
</rule>
|
||
|
<rule pattern="--(?![!#$%&*+./<=>?@^|_~:\\]).*?$">
|
||
|
<token type="CommentSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="\{-">
|
||
|
<token type="CommentMultiline"/>
|
||
|
<push state="comment"/>
|
||
|
</rule>
|
||
|
<rule pattern=",">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="[:!#$%&*+.\\/<=>?@^|~-]+">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="\(">
|
||
|
<token type="Punctuation"/>
|
||
|
<push state="funclist" state="funclist"/>
|
||
|
</rule>
|
||
|
<rule pattern="\)">
|
||
|
<token type="Punctuation"/>
|
||
|
<pop depth="2"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="comment">
|
||
|
<rule pattern="[^-{}]+">
|
||
|
<token type="CommentMultiline"/>
|
||
|
</rule>
|
||
|
<rule pattern="\{-">
|
||
|
<token type="CommentMultiline"/>
|
||
|
<push/>
|
||
|
</rule>
|
||
|
<rule pattern="-\}">
|
||
|
<token type="CommentMultiline"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="[-{}]">
|
||
|
<token type="CommentMultiline"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="character">
|
||
|
<rule pattern="[^\\']'">
|
||
|
<token type="LiteralStringChar"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="\\">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<push state="escape"/>
|
||
|
</rule>
|
||
|
<rule pattern="'">
|
||
|
<token type="LiteralStringChar"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="string">
|
||
|
<rule pattern="[^\\"]+">
|
||
|
<token type="LiteralString"/>
|
||
|
</rule>
|
||
|
<rule pattern="\\">
|
||
|
<token type="LiteralStringEscape"/>
|
||
|
<push state="escape"/>
|
||
|
</rule>
|
||
|
<rule pattern=""">
|
||
|
<token type="LiteralString"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|