| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!-- qualification of entities --> |
| 5 |
<!ENTITY qualify "(?:[A-Z][a-zA-Z0-9_']*\.)*"> |
| 6 |
<!-- identifier --> |
| 7 |
<!ENTITY ident "[a-z][a-zA-Z0-9_']*"> |
| 8 |
<!-- Type --> |
| 9 |
<!ENTITY type "[A-Z][a-zA-Z0-9_']*"> |
| 10 |
<!-- infix operator characters --> |
| 11 |
<!ENTITY infixchar "~!@#\$%\^&\*\+\-=<>\?\./\|&backslash;:"> |
| 12 |
<!-- identifier in prefix notation, e.g.: id, ($) --> |
| 13 |
<!ENTITY prefixIdent "(?:&ident;|\([&infixchar;]+\))"> |
| 14 |
|
| 15 |
<!-- Characters allowed in character escape sequence, e.g., \n --> |
| 16 |
<!ENTITY escSeqChar "abfnrtv\"'" > |
| 17 |
<!-- Ascii escape sequence, e.g., \NUL --> |
| 18 |
<!ENTITY escSeqAscii "NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL" > |
| 19 |
<!-- Control escape sequence, e.g., \^X --> |
| 20 |
<!ENTITY escSeqCntrl "\^[A-Z@\[&backslash;\]\^_]" > |
| 21 |
|
| 22 |
<!-- octal number --> |
| 23 |
<!ENTITY octal "[0-7]+" > |
| 24 |
<!-- decimal number --> |
| 25 |
<!ENTITY decimal "[0-9]+" > |
| 26 |
<!-- hexadecimal number --> |
| 27 |
<!ENTITY hexadecimal "[0-9a-fA-F]+" > |
| 28 |
<!-- a backslash, escaped for use in regular expressions --> |
| 29 |
<!ENTITY backslash "\\" > |
| 30 |
<!-- dashes introducing a currydoc comment --> |
| 31 |
<!ENTITY currydoc "---" > |
| 32 |
]> |
| 33 |
<language name="Curry" version="4" kateversion="5.0" |
| 34 |
section="Sources" extensions="*.curry" mimetype="text/x-curry" |
| 35 |
author="Björn Peemöller ([email protected])" license="LGPL" |
| 36 |
indenter="haskell"> |
| 37 |
<highlighting> |
| 38 |
<list name="keywords"> |
| 39 |
<item>case</item> |
| 40 |
<item>data</item> |
| 41 |
<item>do</item> |
| 42 |
<item>else</item> |
| 43 |
<item>external</item> |
| 44 |
<item>fcase</item> |
| 45 |
<item>free</item> |
| 46 |
<item>if</item> |
| 47 |
<!-- Although import is a keyword, it is handled in a special context |
| 48 |
to highlight "qualified", "as" and "hiding" in keyword style, |
| 49 |
albeit these lexemes are no keywords. |
| 50 |
<item>import</item> |
| 51 |
--> |
| 52 |
<item>in</item> |
| 53 |
<item>infix</item> |
| 54 |
<item>infixl</item> |
| 55 |
<item>infixr</item> |
| 56 |
<item>let</item> |
| 57 |
<item>module</item> |
| 58 |
<item>of</item> |
| 59 |
<item>then</item> |
| 60 |
<item>type</item> |
| 61 |
<item>where</item> |
| 62 |
</list> |
| 63 |
<list name="Prelude Func"> |
| 64 |
<item>and</item> |
| 65 |
<item>all</item> |
| 66 |
<item>any</item> |
| 67 |
<item>appendFile</item> |
| 68 |
<item>best</item> |
| 69 |
<item>break</item> |
| 70 |
<item>browse</item> |
| 71 |
<item>browseList</item> |
| 72 |
<item>chr</item> |
| 73 |
<item>concat</item> |
| 74 |
<item>concatMap</item> |
| 75 |
<item>const</item> |
| 76 |
<item>curry</item> |
| 77 |
<item>div</item> |
| 78 |
<item>done</item> |
| 79 |
<item>doSolve</item> |
| 80 |
<item>drop</item> |
| 81 |
<item>dropWhile</item> |
| 82 |
<item>either</item> |
| 83 |
<item>elem</item> |
| 84 |
<item>ensureNotFree</item> |
| 85 |
<item>ensureSpine</item> |
| 86 |
<item>enumFrom</item> |
| 87 |
<item>enumFromThen</item> |
| 88 |
<item>enumFromTo</item> |
| 89 |
<item>enumFromThenTo</item> |
| 90 |
<item>error</item> |
| 91 |
<item>failed</item> |
| 92 |
<item>filter</item> |
| 93 |
<item>findall</item> |
| 94 |
<item>flip</item> |
| 95 |
<item>foldl</item> |
| 96 |
<item>foldl1</item> |
| 97 |
<item>foldr</item> |
| 98 |
<item>foldr1</item> |
| 99 |
<item>fst</item> |
| 100 |
<item>getChar</item> |
| 101 |
<item>getLine</item> |
| 102 |
<item>id</item> |
| 103 |
<item>if_then_else</item> |
| 104 |
<item>iterate</item> |
| 105 |
<item>head</item> |
| 106 |
<item>length</item> |
| 107 |
<item>lines</item> |
| 108 |
<item>lookup</item> |
| 109 |
<item>map</item> |
| 110 |
<item>mapIO</item> |
| 111 |
<item>mapIO_</item> |
| 112 |
<item>max</item> |
| 113 |
<item>maybe</item> |
| 114 |
<item>min</item> |
| 115 |
<item>mod</item> |
| 116 |
<item>negate</item> |
| 117 |
<item>not</item> |
| 118 |
<item>notElem</item> |
| 119 |
<item>null</item> |
| 120 |
<item>once</item> |
| 121 |
<item>or</item> |
| 122 |
<item>ord</item> |
| 123 |
<item>otherwise</item> |
| 124 |
<item>print</item> |
| 125 |
<item>putChar</item> |
| 126 |
<item>putStr</item> |
| 127 |
<item>putStrLn</item> |
| 128 |
<item>readFile</item> |
| 129 |
<item>repeat</item> |
| 130 |
<item>replicate</item> |
| 131 |
<item>return</item> |
| 132 |
<item>reverse</item> |
| 133 |
<item>seq</item> |
| 134 |
<item>sequenceIO</item> |
| 135 |
<item>sequenceIO_</item> |
| 136 |
<item>show</item> |
| 137 |
<item>snd</item> |
| 138 |
<item>solveAll</item> |
| 139 |
<item>span</item> |
| 140 |
<item>splitAt</item> |
| 141 |
<item>success</item> |
| 142 |
<item>tail</item> |
| 143 |
<item>take</item> |
| 144 |
<item>takeWhile</item> |
| 145 |
<item>try</item> |
| 146 |
<item>uncurry</item> |
| 147 |
<item>unknown</item> |
| 148 |
<item>unlines</item> |
| 149 |
<item>unpack</item> |
| 150 |
<item>until</item> |
| 151 |
<item>unwords</item> |
| 152 |
<item>unzip</item> |
| 153 |
<item>unzip3</item> |
| 154 |
<item>writeFile</item> |
| 155 |
<item>words</item> |
| 156 |
<item>zip</item> |
| 157 |
<item>zip3</item> |
| 158 |
<item>zipWith</item> |
| 159 |
<item>zipWith3</item> |
| 160 |
</list> |
| 161 |
<list name="Prelude Type"> |
| 162 |
<item>Bool</item> |
| 163 |
<item>Char</item> |
| 164 |
<item>Either</item> |
| 165 |
<item>Float</item> |
| 166 |
<item>Int</item> |
| 167 |
<item>IO</item> |
| 168 |
<item>Maybe</item> |
| 169 |
<item>Ordering</item> |
| 170 |
<item>String</item> |
| 171 |
<item>Success</item> |
| 172 |
</list> |
| 173 |
<list name="Prelude Cons"> |
| 174 |
<item>False</item> |
| 175 |
<item>True</item> |
| 176 |
<item>Left</item> |
| 177 |
<item>Right</item> |
| 178 |
<item>Just</item> |
| 179 |
<item>Nothing</item> |
| 180 |
<item>EQ</item> |
| 181 |
<item>LT</item> |
| 182 |
<item>GT</item> |
| 183 |
</list> |
| 184 |
<contexts> |
| 185 |
<context name="Normal" attribute="Normal" lineEndContext="#stay"> |
| 186 |
<!-- pragmas, currydoc, comments --> |
| 187 |
<StringDetect attribute="Pragma" context="Pragma" String="{-#" beginRegion="Pragma" /> |
| 188 |
<Detect2Chars attribute="Comment" context="Multiline Comment" char="{" char1="-" beginRegion="Multiline Comment" /> |
| 189 |
<StringDetect attribute="Currydoc" context="Currydoc" String="&currydoc;" /> |
| 190 |
<Detect2Chars attribute="Comment" context="Comment" char="-" char1="-" /> |
| 191 |
|
| 192 |
<!-- keywords, Prelude entities --> |
| 193 |
<keyword attribute="Keyword" context="#stay" String="keywords" /> |
| 194 |
<keyword attribute="Prelude Function" context="#stay" String="Prelude Func" /> |
| 195 |
<keyword attribute="Prelude Type" context="#stay" String="Prelude Type" /> |
| 196 |
<keyword attribute="Prelude Constructor" context="#stay" String="Prelude Cons" /> |
| 197 |
<RegExpr attribute="Keyword" context="Import" String="import\s+(?:qualified)?" /> |
| 198 |
|
| 199 |
<!-- Literals --> |
| 200 |
<Float attribute="Float" context="#stay" /> |
| 201 |
<RegExpr attribute="Octal" context="#stay" String="0[oO]&octal;" /> |
| 202 |
<HlCHex attribute="Hex" context="#stay" /> |
| 203 |
<Int attribute="Decimal" context="#stay" /> |
| 204 |
<DetectChar attribute="Char" context="Char" char="'" /> |
| 205 |
<DetectChar attribute="String" context="String" char=""" /> |
| 206 |
|
| 207 |
<!-- Others --> |
| 208 |
<RegExpr attribute="Special Symbol" context="#stay" String="(?:::|:=|:>|\->|<\-|\.\.)" /> |
| 209 |
<RegExpr attribute="Signature" context="#stay" String="\s*&prefixIdent;\s*(?:,\s*&prefixIdent;)*\s*(?=::[^&infixchar;])" /> |
| 210 |
<RegExpr attribute="Function" context="#stay" String="&qualify;&ident;" /> |
| 211 |
<RegExpr attribute="Operator" context="#stay" String="&qualify;[&infixchar;]+" /> |
| 212 |
<RegExpr attribute="Type, Constructor" context="#stay" String="&qualify;&type;" /> |
| 213 |
<DetectChar attribute="Infix Application" context="Infix" char="`" /> |
| 214 |
|
| 215 |
<!-- Folding of braces --> |
| 216 |
<DetectChar char="(" context="#stay" beginRegion="nested" attribute="Braces" /> |
| 217 |
<DetectChar char=")" context="#stay" endRegion="nested" attribute="Braces" /> |
| 218 |
<DetectChar char="[" context="#stay" beginRegion="list" attribute="Braces" /> |
| 219 |
<DetectChar char="]" context="#stay" endRegion="list" attribute="Braces" /> |
| 220 |
<DetectChar char="{" context="#stay" beginRegion="curly" attribute="Braces" /> |
| 221 |
<DetectChar char="}" context="#stay" endRegion="curly" attribute="Braces" /> |
| 222 |
</context> |
| 223 |
|
| 224 |
<!-- Pragma --> |
| 225 |
<context name="Pragma" attribute="Pragma" lineEndContext="#stay" > |
| 226 |
<StringDetect attribute="Pragma" context="#pop" String="#-}" endRegion="Pragma" /> |
| 227 |
</context> |
| 228 |
|
| 229 |
<!-- Multiline comment --> |
| 230 |
<context name="Multiline Comment" attribute="Comment" lineEndContext="#stay" > |
| 231 |
<Detect2Chars attribute="Comment" context="#pop" char="-" char1="}" endRegion="Multiline Comment" /> |
| 232 |
<IncludeRules context="##Comments" /> |
| 233 |
</context> |
| 234 |
|
| 235 |
<!-- Currydoc --> |
| 236 |
<context name="Currydoc" attribute="Currydoc" lineEndContext="#pop" /> |
| 237 |
|
| 238 |
<!-- Single line comment --> |
| 239 |
<context name="Comment" attribute="Comment" lineEndContext="#pop"> |
| 240 |
<IncludeRules context="##Comments" /> |
| 241 |
</context> |
| 242 |
|
| 243 |
<!-- Import section --> |
| 244 |
<context name="Import" attribute="Normal" lineEndContext="#pop" > |
| 245 |
<!-- pragmas, currydoc, comments --> |
| 246 |
<StringDetect attribute="Pragma" context="Pragma" String="{-#" beginRegion="Pragma" /> |
| 247 |
<Detect2Chars attribute="Comment" context="Multiline Comment" char="{" char1="-" beginRegion="Multiline Comment" /> |
| 248 |
<StringDetect attribute="Currydoc" context="Currydoc" String="&currydoc;" /> |
| 249 |
<Detect2Chars attribute="Comment" context="Comment" char="-" char1="-" /> |
| 250 |
|
| 251 |
<RegExpr attribute="Type, Constructor" context="#stay" String="&qualify;&type;" /> |
| 252 |
<Detect2Chars attribute="Keyword" context="#stay" char="a" char1="s" /> |
| 253 |
<StringDetect attribute="Keyword" context="#stay" String="hiding" /> |
| 254 |
<!-- Pop context at open paren to highlight imported entities --> |
| 255 |
<DetectChar attribute="Braces" context="#pop" char="(" beginRegion="nested" /> |
| 256 |
<RegExpr attribute="Syntax Error" context="#stay" String="\S+" /> |
| 257 |
</context> |
| 258 |
|
| 259 |
<!-- A single characters, with escape sequences --> |
| 260 |
<context name="Char" attribute="Char" lineEndContext="CharSyntaxError" > |
| 261 |
<DetectChar attribute="Syntax Error" context="#pop" char="'" /> |
| 262 |
<DetectChar attribute="Char" context="CharEscape" char="\" /> |
| 263 |
<RegExpr attribute="Char" context="CharEnd" String="[^'&backslash;]" /> |
| 264 |
</context> |
| 265 |
|
| 266 |
<!-- Character escape sequence --> |
| 267 |
<context name="CharEscape" attribute="Char" lineEndContext="#pop!CharSyntaxError" > |
| 268 |
<AnyChar attribute="Char" context="#pop!CharEnd" String="&escSeqChar;" /> |
| 269 |
<RegExpr attribute="Char" context="#pop!CharEnd" String="o&octal;|&decimal;|x&hexadecimal;|&escSeqCntrl;|&escSeqAscii;" /> |
| 270 |
<RegExpr attribute="Syntax Error" context="#pop!CharEnd" String="." /> |
| 271 |
</context> |
| 272 |
|
| 273 |
<!-- Ending quote of character literal --> |
| 274 |
<context name="CharEnd" attribute="Char" lineEndContext="#pop!CharSyntaxError" > |
| 275 |
<DetectChar attribute="Char" context="#pop#pop" char="'" /> |
| 276 |
<RegExpr attribute="Syntax Error" context="#stay" String="." /> |
| 277 |
</context> |
| 278 |
|
| 279 |
<!-- Character syntax error: Newline inside literal --> |
| 280 |
<context name="CharSyntaxError" attribute="Syntax Error" lineEndContext="#stay" > |
| 281 |
<DetectChar attribute="Syntax Error" context="#pop#pop" char="'" /> |
| 282 |
</context> |
| 283 |
|
| 284 |
<!-- A string, with escape sequences --> |
| 285 |
<context name="String" attribute="String" lineEndContext="StringSyntaxError" > |
| 286 |
<DetectChar attribute="String" context="#pop" char=""" /> |
| 287 |
<DetectChar attribute="String Escape" context="StringEscape" char="\" /> |
| 288 |
<RegExpr attribute="String" context="#stay" String="[^"&backslash;]*" /> |
| 289 |
</context> |
| 290 |
|
| 291 |
<!-- String escape sequence --> |
| 292 |
<context name="StringEscape" attribute="String" lineEndContext="StringGap" > |
| 293 |
<AnyChar attribute="String Escape" context="#pop" String="&escSeqChar;&" /> |
| 294 |
<RegExpr attribute="String Escape" context="#pop" String="o&octal;|&decimal;|x&hexadecimal;|&escSeqCntrl;|&escSeqAscii;" /> |
| 295 |
<DetectSpaces attribute="String Escape" context="StringGap" /> |
| 296 |
<RegExpr attribute="Syntax Error" context="#pop" String="." /> |
| 297 |
</context> |
| 298 |
|
| 299 |
<context name="StringGap" attribute="String" lineEndContext="#stay" > |
| 300 |
<DetectSpaces attribute="String Escape" context="#stay" /> |
| 301 |
<DetectChar attribute="String Escape" context="#pop#pop#pop!String" char="\" /> |
| 302 |
<DetectChar attribute="Syntax Error" context="#pop#pop#pop" char=""" /> |
| 303 |
<RegExpr attribute="Syntax Error" context="#stay" String="." /> |
| 304 |
</context> |
| 305 |
|
| 306 |
<!-- String syntax error: Newline inside literal --> |
| 307 |
<context name="StringSyntaxError" attribute="Syntax Error" lineEndContext="#stay" > |
| 308 |
<DetectChar attribute="Syntax Error" context="#pop#pop" char=""" /> |
| 309 |
</context> |
| 310 |
|
| 311 |
<!-- Infix application --> |
| 312 |
<context name="Infix" attribute="Infix Application" lineEndContext="#stay" > |
| 313 |
<DetectChar attribute="Infix Application" context="#pop" char="`"/> |
| 314 |
</context> |
| 315 |
</contexts> |
| 316 |
|
| 317 |
<itemDatas> |
| 318 |
<itemData name="Normal" defStyleNum="dsNormal" spellChecking="false" /> |
| 319 |
|
| 320 |
<!-- Comments --> |
| 321 |
<itemData name="Pragma" defStyleNum="dsOthers" spellChecking="false" /> |
| 322 |
<itemData name="Comment" defStyleNum="dsComment" /> |
| 323 |
<itemData name="Currydoc" defStyleNum="dsDocumentation" /> |
| 324 |
|
| 325 |
<!-- Keywords, predefined entities --> |
| 326 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false" /> |
| 327 |
<itemData name="Prelude Type" defStyleNum="dsDataType" spellChecking="false" /> |
| 328 |
<itemData name="Prelude Function" defStyleNum="dsFunction" spellChecking="false" /> |
| 329 |
<itemData name="Prelude Constructor" defStyleNum="dsKeyword" spellChecking="false" /> |
| 330 |
|
| 331 |
<!-- Literals --> |
| 332 |
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false" /> |
| 333 |
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false" /> |
| 334 |
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false" /> |
| 335 |
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false" /> |
| 336 |
<itemData name="Char" defStyleNum="dsChar" spellChecking="false" /> |
| 337 |
<itemData name="String Escape" defStyleNum="dsChar" spellChecking="false" /> |
| 338 |
<itemData name="String" defStyleNum="dsString" /> |
| 339 |
|
| 340 |
<!-- Others --> |
| 341 |
<itemData name="Braces" defStyleNum="dsNormal" spellChecking="false" /> |
| 342 |
<itemData name="Signature" defStyleNum="dsOthers" spellChecking="false" /> |
| 343 |
<itemData name="Function" defStyleNum="dsNormal" spellChecking="false" /> |
| 344 |
<itemData name="Operator" defStyleNum="dsFunction" spellChecking="false" /> |
| 345 |
<itemData name="Type, Constructor" defStyleNum="dsDataType" spellChecking="false" /> |
| 346 |
<itemData name="Special Symbol" defStyleNum="dsOthers" spellChecking="false" /> |
| 347 |
<itemData name="Infix Application" defStyleNum="dsOthers" spellChecking="false" /> |
| 348 |
<itemData name="Syntax Error" defStyleNum="dsError" spellChecking="false" /> |
| 349 |
</itemDatas> |
| 350 |
</highlighting> |
| 351 |
<general> |
| 352 |
<folding indentationsensitive="1"/> |
| 353 |
<comments> |
| 354 |
<comment name="singleLine" start="--" position="afterwhitespace" /> |
| 355 |
<comment name="multiLine" start="{-" end="-}" region="Multiline Comment" /> |
| 356 |
</comments> |
| 357 |
<keywords casesensitive="1" /> |
| 358 |
</general> |
| 359 |
</language> |
| 360 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |