| 1 | # Author : Sergei Trofimovich <slyfox@inbox.ru> |
| 2 | # Language : haskell |
| 3 | # |
| 4 | # 'Syntax rules for the C and the C++ programming languages' is taken as base |
| 5 | # (haskell compilers support CPP macros) |
| 6 | # |
| 7 | # haskell keywords and reserved symbols are grabbed from ghc-6.10.1/compiler/parser/Lexer.hs |
| 8 | |
| 9 | context default |
| 10 | |
| 11 | # haskell keywords |
| 12 | |
| 13 | # reserved keywords: |
| 14 | |
| 15 | # unused symbols |
| 16 | keyword whole _\[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\] brightmagenta |
| 17 | |
| 18 | keyword whole as yellow |
| 19 | keyword whole case yellow |
| 20 | keyword whole class yellow |
| 21 | keyword whole data yellow |
| 22 | keyword whole default yellow |
| 23 | keyword whole deriving yellow |
| 24 | keyword whole do yellow |
| 25 | keyword whole else yellow |
| 26 | keyword whole hiding yellow |
| 27 | keyword whole if yellow |
| 28 | keyword whole import yellow |
| 29 | keyword whole in yellow |
| 30 | keyword whole infix yellow |
| 31 | keyword whole infixl yellow |
| 32 | keyword whole infixr yellow |
| 33 | keyword whole instance yellow |
| 34 | keyword whole let yellow |
| 35 | keyword whole module yellow |
| 36 | keyword whole newtype yellow |
| 37 | keyword whole of yellow |
| 38 | keyword whole qualified yellow |
| 39 | keyword whole then yellow |
| 40 | keyword whole type yellow |
| 41 | keyword whole where yellow |
| 42 | |
| 43 | # extension keywords |
| 44 | keyword whole forall yellow |
| 45 | keyword whole mdo yellow |
| 46 | keyword whole family yellow |
| 47 | keyword whole group yellow |
| 48 | keyword whole by yellow |
| 49 | keyword whole using yellow |
| 50 | |
| 51 | # ffi |
| 52 | keyword whole foreign yellow |
| 53 | keyword whole export yellow |
| 54 | keyword whole label yellow |
| 55 | keyword whole dynamic yellow |
| 56 | keyword whole safe yellow |
| 57 | keyword whole threadsafe yellow |
| 58 | keyword whole unsafe yellow |
| 59 | keyword whole stdcall yellow |
| 60 | keyword whole ccall yellow |
| 61 | keyword whole dotnet yellow |
| 62 | |
| 63 | keyword whole rec yellow |
| 64 | keyword whole proc yellow |
| 65 | |
| 66 | # other |
| 67 | keyword . white |
| 68 | # keyword whole .. white |
| 69 | |
| 70 | # unboxed (started from upcase) |
| 71 | keyword whole \{ABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\]# white |
| 72 | # types/modules |
| 73 | keyword whole \{ABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\] white |
| 74 | |
| 75 | # C keywords (TODO: remove unused in haskell source) |
| 76 | keyword whole auto yellow |
| 77 | keyword whole break yellow |
| 78 | keyword whole case yellow |
| 79 | keyword whole char yellow |
| 80 | keyword whole const yellow |
| 81 | keyword whole continue yellow |
| 82 | keyword whole do yellow |
| 83 | keyword whole double yellow |
| 84 | keyword whole else yellow |
| 85 | keyword whole enum yellow |
| 86 | keyword whole extern yellow |
| 87 | keyword whole float yellow |
| 88 | keyword whole for yellow |
| 89 | keyword whole goto yellow |
| 90 | keyword whole if yellow |
| 91 | keyword whole int yellow |
| 92 | keyword whole long yellow |
| 93 | keyword whole register yellow |
| 94 | keyword whole return yellow |
| 95 | keyword whole short yellow |
| 96 | keyword whole signed yellow |
| 97 | keyword whole sizeof yellow |
| 98 | keyword whole static yellow |
| 99 | keyword whole struct yellow |
| 100 | keyword whole switch yellow |
| 101 | keyword whole typedef yellow |
| 102 | keyword whole union yellow |
| 103 | keyword whole unsigned yellow |
| 104 | keyword whole void yellow |
| 105 | keyword whole volatile yellow |
| 106 | keyword whole while yellow |
| 107 | keyword whole asm yellow |
| 108 | keyword whole inline yellow |
| 109 | keyword whole wchar_t yellow |
| 110 | keyword whole ... yellow |
| 111 | keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta |
| 112 | keyword whole \[\s\t\]default yellow |
| 113 | keyword whole linestart \[\s\t\]\{ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\}\[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\]: cyan |
| 114 | |
| 115 | #digits |
| 116 | keyword whole 0\{xX\}\{0123456789abcdefABCDEF\}\[0123456789abcdefABCDEF\] brightgreen |
| 117 | keyword whole \{0123456789\}\[0123456789\] brightgreen |
| 118 | keyword whole \[0123456789\]\.\{0123456789\}\[0123456789\] brightgreen |
| 119 | keyword whole \{0123456789\}\[0123456789\]\.\[0123456789\] brightgreen |
| 120 | keyword whole \{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] brightgreen |
| 121 | keyword whole \{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\] brightgreen |
| 122 | keyword whole \{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{0123456789\}\[0123456789\] brightgreen |
| 123 | keyword whole \{0123456789\}\[0123456789\]\.\{0123456789\}\[0123456789\]\{eE\}\{\-\+\}\{0123456789\}\[0123456789\] brightgreen |
| 124 | |
| 125 | #comments |
| 126 | keyword {- brown |
| 127 | keyword -} brown |
| 128 | keyword -- brown |
| 129 | |
| 130 | keyword \*/ brown |
| 131 | keyword /\* brown |
| 132 | keyword // brown |
| 133 | |
| 134 | keyword '\\\{"abtnvfr\}' brightgreen |
| 135 | |
| 136 | #haskell standalone char escapes |
| 137 | keyword '\\NUL' brightgreen |
| 138 | keyword '\\SOH' brightgreen |
| 139 | keyword '\\STX' brightgreen |
| 140 | keyword '\\ETX' brightgreen |
| 141 | keyword '\\EOT' brightgreen |
| 142 | keyword '\\ENQ' brightgreen |
| 143 | keyword '\\ACK' brightgreen |
| 144 | keyword '\\BEL' brightgreen |
| 145 | keyword '\\BS' brightgreen |
| 146 | keyword '\\HT' brightgreen |
| 147 | keyword '\\LF' brightgreen |
| 148 | keyword '\\VT' brightgreen |
| 149 | keyword '\\FF' brightgreen |
| 150 | keyword '\\CR' brightgreen |
| 151 | keyword '\\SO' brightgreen |
| 152 | keyword '\\SI' brightgreen |
| 153 | keyword '\\DLE' brightgreen |
| 154 | keyword '\\DC1' brightgreen |
| 155 | keyword '\\DC2' brightgreen |
| 156 | keyword '\\DC3' brightgreen |
| 157 | keyword '\\DC4' brightgreen |
| 158 | keyword '\\NAK' brightgreen |
| 159 | keyword '\\SYN' brightgreen |
| 160 | keyword '\\ETB' brightgreen |
| 161 | keyword '\\CAN' brightgreen |
| 162 | keyword '\\EM' brightgreen |
| 163 | keyword '\\SUB' brightgreen |
| 164 | keyword '\\ESC' brightgreen |
| 165 | keyword '\\FS' brightgreen |
| 166 | keyword '\\GS' brightgreen |
| 167 | keyword '\\RS' brightgreen |
| 168 | keyword '\\US' brightgreen |
| 169 | keyword '\\SP' brightgreen |
| 170 | keyword '\\DEL' brightgreen |
| 171 | |
| 172 | keyword '\\\{0123\}\{01234567\}\{01234567\}' brightgreen |
| 173 | keyword '\\'' brightgreen |
| 174 | keyword '\\\\' brightgreen |
| 175 | keyword '\\0' brightgreen |
| 176 | keyword '\{\s!"#$%&()\*\+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\}' brightgreen |
| 177 | |
| 178 | # some punctuation characters |
| 179 | keyword whole $ yellow |
| 180 | keyword whole ! white |
| 181 | keyword whole && white |
| 182 | keyword whole \* yellow |
| 183 | keyword whole \+ yellow |
| 184 | keyword whole / yellow |
| 185 | keyword whole < yellow |
| 186 | keyword whole > yellow |
| 187 | keyword whole ^ white |
| 188 | keyword whole || white |
| 189 | keyword whole | white |
| 190 | |
| 191 | keyword ~ white |
| 192 | keyword , brightcyan |
| 193 | keyword - yellow |
| 194 | keyword : brightcyan |
| 195 | keyword ; yellow |
| 196 | keyword = yellow |
| 197 | keyword { white |
| 198 | keyword } white |
| 199 | keyword [ brightcyan |
| 200 | keyword ] brightcyan |
| 201 | keyword ( brightcyan |
| 202 | keyword ) brightcyan |
| 203 | |
| 204 | # comments |
| 205 | context exclusive /\* \*/ brown |
| 206 | spellcheck |
| 207 | |
| 208 | context exclusive {-# #-} green |
| 209 | spellcheck |
| 210 | |
| 211 | context exclusive {- -} brown |
| 212 | spellcheck |
| 213 | |
| 214 | context exclusive // \n brown |
| 215 | spellcheck |
| 216 | |
| 217 | context exclusive \-\- \n brown |
| 218 | spellcheck |
| 219 | |
| 220 | # C macros |
| 221 | context linestart # \n brightred |
| 222 | keyword \\\n yellow |
| 223 | keyword /\**\*/ brown |
| 224 | keyword //*\n brown |
| 225 | keyword "+" red |
| 226 | keyword <+> red |
| 227 | |
| 228 | |
| 229 | context " " green |
| 230 | spellcheck |
| 231 | |
| 232 | #haskell escapes in ""s |
| 233 | keyword \\NUL brightgreen |
| 234 | keyword \\SOH brightgreen |
| 235 | keyword \\STX brightgreen |
| 236 | keyword \\ETX brightgreen |
| 237 | keyword \\EOT brightgreen |
| 238 | keyword \\ENQ brightgreen |
| 239 | keyword \\ACK brightgreen |
| 240 | keyword \\BEL brightgreen |
| 241 | keyword \\BS brightgreen |
| 242 | keyword \\HT brightgreen |
| 243 | keyword \\LF brightgreen |
| 244 | keyword \\VT brightgreen |
| 245 | keyword \\FF brightgreen |
| 246 | keyword \\CR brightgreen |
| 247 | keyword \\SO brightgreen |
| 248 | keyword \\SI brightgreen |
| 249 | keyword \\DLE brightgreen |
| 250 | keyword \\DC1 brightgreen |
| 251 | keyword \\DC2 brightgreen |
| 252 | keyword \\DC3 brightgreen |
| 253 | keyword \\DC4 brightgreen |
| 254 | keyword \\NAK brightgreen |
| 255 | keyword \\SYN brightgreen |
| 256 | keyword \\ETB brightgreen |
| 257 | keyword \\CAN brightgreen |
| 258 | keyword \\EM brightgreen |
| 259 | keyword \\SUB brightgreen |
| 260 | keyword \\ESC brightgreen |
| 261 | keyword \\FS brightgreen |
| 262 | keyword \\GS brightgreen |
| 263 | keyword \\RS brightgreen |
| 264 | keyword \\US brightgreen |
| 265 | keyword \\SP brightgreen |
| 266 | keyword \\DEL brightgreen |
| 267 | |
| 268 | keyword \\" brightgreen |
| 269 | keyword %% brightgreen |
| 270 | keyword %\[#0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[L\]\{eEfgGoxX\} brightgreen |
| 271 | keyword %\[0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[hl\]\{diuxX\} brightgreen |
| 272 | keyword %\[hl\]n brightgreen |
| 273 | keyword %\[-\]\[0123456789\*\]\[.\]\[0123456789\*\]s brightgreen |
| 274 | keyword %[*] brightgreen |
| 275 | keyword %c brightgreen |
| 276 | keyword %p brightgreen |
| 277 | keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen |
| 278 | keyword \\\\ brightgreen |
| 279 | keyword \\' brightgreen |
| 280 | keyword \\\{abtnvfr\} brightgreen |
| 281 | |
| 282 | # infix binop |
| 283 | context exclusive ` ` white |