| 1 |
{ |
| 2 |
"fileTypes": ["hs", "hs-boot", "hsig"], |
| 3 |
"keyEquivalent": "^~H", |
| 4 |
"name": "haskell", |
| 5 |
"patterns": [ |
| 6 |
{ |
| 7 |
"include": "#liquid_haskell" |
| 8 |
}, |
| 9 |
{ |
| 10 |
"include": "#comment_like" |
| 11 |
}, |
| 12 |
{ |
| 13 |
"include": "#numeric_literals" |
| 14 |
}, |
| 15 |
{ |
| 16 |
"include": "#string_literal" |
| 17 |
}, |
| 18 |
{ |
| 19 |
"include": "#char_literal" |
| 20 |
}, |
| 21 |
{ |
| 22 |
"match": "(?<!@|#)-\\}", |
| 23 |
"name": "invalid" |
| 24 |
}, |
| 25 |
{ |
| 26 |
"match": "(\\()\\s*(\\))", |
| 27 |
"name": "constant.language.unit.haskell", |
| 28 |
"captures": { |
| 29 |
"1": { |
| 30 |
"name": "punctuation.paren.haskell" |
| 31 |
}, |
| 32 |
"2": { |
| 33 |
"name": "punctuation.paren.haskell" |
| 34 |
} |
| 35 |
} |
| 36 |
}, |
| 37 |
{ |
| 38 |
"match": "(\\()(#)\\s*(#)(\\))", |
| 39 |
"name": "constant.language.unit.unboxed.haskell", |
| 40 |
"captures": { |
| 41 |
"1": { |
| 42 |
"name": "punctuation.paren.haskell" |
| 43 |
}, |
| 44 |
"2": { |
| 45 |
"name": "keyword.operator.hash.haskell" |
| 46 |
}, |
| 47 |
"3": { |
| 48 |
"name": "keyword.operator.hash.haskell" |
| 49 |
}, |
| 50 |
"4": { |
| 51 |
"name": "punctuation.paren.haskell" |
| 52 |
} |
| 53 |
} |
| 54 |
}, |
| 55 |
{ |
| 56 |
"match": "(\\()\\s*,[\\s,]*(\\))", |
| 57 |
"name": "support.constant.tuple.haskell", |
| 58 |
"captures": { |
| 59 |
"1": { |
| 60 |
"name": "punctuation.paren.haskell" |
| 61 |
}, |
| 62 |
"2": { |
| 63 |
"name": "punctuation.paren.haskell" |
| 64 |
} |
| 65 |
} |
| 66 |
}, |
| 67 |
{ |
| 68 |
"match": "(\\()(#)\\s*,[\\s,]*(#)(\\))", |
| 69 |
"name": "support.constant.tuple.unboxed.haskell", |
| 70 |
"captures": { |
| 71 |
"1": { |
| 72 |
"name": "punctuation.paren.haskell" |
| 73 |
}, |
| 74 |
"2": { |
| 75 |
"name": "keyword.operator.hash.haskell" |
| 76 |
}, |
| 77 |
"3": { |
| 78 |
"name": "keyword.operator.hash.haskell" |
| 79 |
}, |
| 80 |
"4": { |
| 81 |
"name": "punctuation.paren.haskell" |
| 82 |
} |
| 83 |
} |
| 84 |
}, |
| 85 |
{ |
| 86 |
"match": "(\\[)\\s*(\\])", |
| 87 |
"name": "constant.language.empty-list.haskell", |
| 88 |
"captures": { |
| 89 |
"1": { |
| 90 |
"name": "punctuation.bracket.haskell" |
| 91 |
}, |
| 92 |
"2": { |
| 93 |
"name": "punctuation.bracket.haskell" |
| 94 |
} |
| 95 |
} |
| 96 |
}, |
| 97 |
{ |
| 98 |
"begin": "(\\b(?<!')(module)|^(signature))(\\b(?!'))", |
| 99 |
"beginCaptures": { |
| 100 |
"2": { |
| 101 |
"name": "keyword.other.module.haskell" |
| 102 |
}, |
| 103 |
"3": { |
| 104 |
"name": "keyword.other.signature.haskell" |
| 105 |
} |
| 106 |
}, |
| 107 |
"end": "(?=\\b(?<!')where\\b(?!'))", |
| 108 |
"name": "meta.declaration.module.haskell", |
| 109 |
"patterns": [ |
| 110 |
{ |
| 111 |
"include": "#comment_like" |
| 112 |
}, |
| 113 |
{ |
| 114 |
"include": "#module_name" |
| 115 |
}, |
| 116 |
{ |
| 117 |
"include": "#module_exports" |
| 118 |
}, |
| 119 |
{ |
| 120 |
"match": "[a-z]+", |
| 121 |
"name": "invalid" |
| 122 |
} |
| 123 |
] |
| 124 |
}, |
| 125 |
{ |
| 126 |
"include": "#ffi" |
| 127 |
}, |
| 128 |
{ |
| 129 |
"begin": "^(\\s*)(class)(\\b(?!'))", |
| 130 |
"beginCaptures": { |
| 131 |
"2": { |
| 132 |
"name": "keyword.other.class.haskell" |
| 133 |
} |
| 134 |
}, |
| 135 |
"end": "(?x) # Detect end of class declaration:\n # 'where' keyword\n (?=(?<!')\\bwhere\\b(?!')) \n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )", |
| 136 |
"name": "meta.declaration.class.haskell", |
| 137 |
"patterns": [ |
| 138 |
{ |
| 139 |
"include": "#comment_like" |
| 140 |
}, |
| 141 |
{ |
| 142 |
"include": "#where" |
| 143 |
}, |
| 144 |
{ |
| 145 |
"include": "#type_signature" |
| 146 |
} |
| 147 |
] |
| 148 |
}, |
| 149 |
{ |
| 150 |
"begin": "(?x)\n ^(\\s*)(data|newtype)(?:\\s+(instance))?\\s+\n # Keep consuming characters until:\n ((?:(?!\n # the equals symbol or the start of a single-line comment, or\n (?: \n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n (?:=|--+)\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n )\n # the \"where\" or \"deriving\" keywords, or\n | (?:\\b(?<!')(?:where|deriving)\\b(?!'))\n # the start of a block comment.\n | {-\n #\n ).)*)\n (?=\\b(?<!'')where\\b(?!''))", |
| 151 |
"beginCaptures": { |
| 152 |
"2": { |
| 153 |
"name": "keyword.other.$2.haskell" |
| 154 |
}, |
| 155 |
"3": { |
| 156 |
"name": "keyword.other.instance.haskell" |
| 157 |
}, |
| 158 |
"4": { |
| 159 |
"patterns": [ |
| 160 |
{ |
| 161 |
"include": "#type_signature" |
| 162 |
} |
| 163 |
] |
| 164 |
} |
| 165 |
}, |
| 166 |
"name": "meta.declaration.$2.generalized.haskell", |
| 167 |
"end": "(?x) # Detect end of data declaration:\n # Deriving clause\n (?=(?<!')\\bderiving\\b(?!')) \n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 168 |
"patterns": [ |
| 169 |
{ |
| 170 |
"include": "#comment_like" |
| 171 |
}, |
| 172 |
{ |
| 173 |
"begin": "(?x)\n (?<!')\\b(where)\n \\s*(\\{)(?!-)", |
| 174 |
"end": "(\\})", |
| 175 |
"beginCaptures": { |
| 176 |
"1": { |
| 177 |
"name": "keyword.other.where.haskell" |
| 178 |
}, |
| 179 |
"2": { |
| 180 |
"name": "punctuation.brace.haskell" |
| 181 |
} |
| 182 |
}, |
| 183 |
"endCaptures": { |
| 184 |
"1": { |
| 185 |
"name": "punctuation.brace.haskell" |
| 186 |
} |
| 187 |
}, |
| 188 |
"patterns": [ |
| 189 |
{ |
| 190 |
"include": "#comment_like" |
| 191 |
}, |
| 192 |
{ |
| 193 |
"include": "#gadt_constructor" |
| 194 |
}, |
| 195 |
{ |
| 196 |
"match": ";", |
| 197 |
"name": "punctuation.semicolon.haskell" |
| 198 |
} |
| 199 |
] |
| 200 |
}, |
| 201 |
{ |
| 202 |
"match": "\\b(?<!')(where)\\b(?!')", |
| 203 |
"name": "keyword.other.where.haskell" |
| 204 |
}, |
| 205 |
{ |
| 206 |
"include": "#deriving" |
| 207 |
}, |
| 208 |
{ |
| 209 |
"include": "#gadt_constructor" |
| 210 |
} |
| 211 |
] |
| 212 |
}, |
| 213 |
{ |
| 214 |
"include": "#role_annotation" |
| 215 |
}, |
| 216 |
{ |
| 217 |
"name": "meta.declaration.pattern.type.haskell", |
| 218 |
"begin": "^(\\s*)(pattern)\\s+(.*?)\\s+(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])", |
| 219 |
"beginCaptures": { |
| 220 |
"2": { |
| 221 |
"name": "keyword.other.pattern.haskell" |
| 222 |
}, |
| 223 |
"3": { |
| 224 |
"patterns": [ |
| 225 |
{ |
| 226 |
"include": "#comma" |
| 227 |
}, |
| 228 |
{ |
| 229 |
"include": "#data_constructor" |
| 230 |
} |
| 231 |
] |
| 232 |
}, |
| 233 |
"4": { |
| 234 |
"name": "keyword.operator.double-colon.haskell" |
| 235 |
} |
| 236 |
}, |
| 237 |
"end": "(?x) # Detect end of pattern type definition by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 238 |
"patterns": [ |
| 239 |
{ |
| 240 |
"include": "#type_signature" |
| 241 |
} |
| 242 |
] |
| 243 |
}, |
| 244 |
{ |
| 245 |
"name": "meta.declaration.pattern.haskell", |
| 246 |
"begin": "^\\s*(pattern)\\b(?!')", |
| 247 |
"captures": { |
| 248 |
"1": { |
| 249 |
"name": "keyword.other.pattern.haskell" |
| 250 |
} |
| 251 |
}, |
| 252 |
"end": "(?x) # Detect end of pattern type definition by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 253 |
"patterns": [ |
| 254 |
{ |
| 255 |
"include": "$self" |
| 256 |
} |
| 257 |
] |
| 258 |
}, |
| 259 |
{ |
| 260 |
"begin": "(?x)\n # Data declaration\n ^(\\s*)(data|newtype)(?:\\s+(family|instance))?\\s+\n # Keep consuming characters until:\n (((?!\n # the equals symbol or the start of a single-line comment, or\n (?: \n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n (?:=|--+)\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n )\n # the \"where\" or \"deriving\" keywords, or\n | (?:\\b(?<!')(?:where|deriving)\\b(?!'))\n # the start of a block comment.\n | {-\n #\n ).)*)", |
| 261 |
"beginCaptures": { |
| 262 |
"2": { |
| 263 |
"name": "keyword.other.$2.haskell" |
| 264 |
}, |
| 265 |
"3": { |
| 266 |
"name": "keyword.other.$3.haskell" |
| 267 |
}, |
| 268 |
"4": { |
| 269 |
"patterns": [ |
| 270 |
{ |
| 271 |
"include": "#type_signature" |
| 272 |
} |
| 273 |
] |
| 274 |
} |
| 275 |
}, |
| 276 |
"name": "meta.declaration.$2.algebraic.haskell", |
| 277 |
"end": "(?x) # Detect end of data declaration: \n # Decreasing indentation\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )", |
| 278 |
"patterns": [ |
| 279 |
{ |
| 280 |
"include": "#comment_like" |
| 281 |
}, |
| 282 |
{ |
| 283 |
"include": "#deriving" |
| 284 |
}, |
| 285 |
{ |
| 286 |
"include": "#forall" |
| 287 |
}, |
| 288 |
{ |
| 289 |
"include": "#adt_constructor" |
| 290 |
}, |
| 291 |
{ |
| 292 |
"include": "#context" |
| 293 |
}, |
| 294 |
{ |
| 295 |
"include": "#record_decl" |
| 296 |
}, |
| 297 |
{ |
| 298 |
"include": "#type_signature" |
| 299 |
} |
| 300 |
] |
| 301 |
}, |
| 302 |
{ |
| 303 |
"name": "meta.declaration.type.family.haskell", |
| 304 |
"begin": "(?x)\n # Type family\n ^(\\s*)(type)\\s+(family)\\b(?!')\n # Keep consuming characters until:\n (((?!\n # the equals symbol or the start of a single-line comment, or\n (?: \n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n (?:=|--+)\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n )\n # the \"where\" keyword, or\n | \\b(?<!')where\\b(?!')\n # the start of a block comment.\n | {-\n #\n ).)*)", |
| 305 |
"beginCaptures": { |
| 306 |
"2": { |
| 307 |
"name": "keyword.other.type.haskell" |
| 308 |
}, |
| 309 |
"3": { |
| 310 |
"name": "keyword.other.family.haskell" |
| 311 |
}, |
| 312 |
"4": { |
| 313 |
"patterns": [ |
| 314 |
{ |
| 315 |
"include": "#comment_like" |
| 316 |
}, |
| 317 |
{ |
| 318 |
"include": "#where" |
| 319 |
}, |
| 320 |
{ |
| 321 |
"include": "#type_signature" |
| 322 |
} |
| 323 |
] |
| 324 |
} |
| 325 |
}, |
| 326 |
"end": "(?x) # Detect end of type family by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 327 |
"patterns": [ |
| 328 |
{ |
| 329 |
"include": "#comment_like" |
| 330 |
}, |
| 331 |
{ |
| 332 |
"include": "#where" |
| 333 |
}, |
| 334 |
{ |
| 335 |
"include": "#type_signature" |
| 336 |
} |
| 337 |
] |
| 338 |
}, |
| 339 |
{ |
| 340 |
"name": "meta.declaration.type.haskell", |
| 341 |
"begin": "(?x)\n # Type declaration\n ^(\\s*)(type)(?:\\s+(instance))?\\s+\n # Keep consuming characters until:\n (((?!\n # the equals symbol, the start of a single-line comment, or a type signature\n (?: \n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n (?:=|--+|::|∷)\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n )\n # the start of a block comment.\n | {-\n #\n ).)*)", |
| 342 |
"beginCaptures": { |
| 343 |
"2": { |
| 344 |
"name": "keyword.other.type.haskell" |
| 345 |
}, |
| 346 |
"3": { |
| 347 |
"name": "keyword.other.instance.haskell" |
| 348 |
}, |
| 349 |
"4": { |
| 350 |
"patterns": [ |
| 351 |
{ |
| 352 |
"include": "#type_signature" |
| 353 |
} |
| 354 |
] |
| 355 |
} |
| 356 |
}, |
| 357 |
"end": "(?x) # Detect end of type definition by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 358 |
"patterns": [ |
| 359 |
{ |
| 360 |
"include": "#type_signature" |
| 361 |
} |
| 362 |
] |
| 363 |
}, |
| 364 |
{ |
| 365 |
"begin": "^(\\s*)(instance)(\\b(?!'))", |
| 366 |
"beginCaptures": { |
| 367 |
"2": { |
| 368 |
"name": "keyword.other.instance.haskell" |
| 369 |
} |
| 370 |
}, |
| 371 |
"end": "(?x) # Detect end of instance declaration:\n # 'where' keyword\n (?=\\b(?<!')(where)\\b(?!'))\n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 372 |
"name": "meta.declaration.instance.haskell", |
| 373 |
"patterns": [ |
| 374 |
{ |
| 375 |
"include": "#comment_like" |
| 376 |
}, |
| 377 |
{ |
| 378 |
"include": "#where" |
| 379 |
}, |
| 380 |
{ |
| 381 |
"include": "#type_signature" |
| 382 |
} |
| 383 |
] |
| 384 |
}, |
| 385 |
{ |
| 386 |
"begin": "^(\\s*)(import)(\\b(?!'))", |
| 387 |
"beginCaptures": { |
| 388 |
"2": { |
| 389 |
"name": "keyword.other.import.haskell" |
| 390 |
} |
| 391 |
}, |
| 392 |
"end": "(?x) # Detect end of import\n # 'where' keyword\n (?=\\b(?<!')(where)\\b(?!'))\n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 393 |
"name": "meta.import.haskell", |
| 394 |
"patterns": [ |
| 395 |
{ |
| 396 |
"include": "#comment_like" |
| 397 |
}, |
| 398 |
{ |
| 399 |
"include": "#where" |
| 400 |
}, |
| 401 |
{ |
| 402 |
"match": "(qualified|as|hiding)", |
| 403 |
"captures": { |
| 404 |
"1": { |
| 405 |
"name": "keyword.other.$1.haskell" |
| 406 |
} |
| 407 |
} |
| 408 |
}, |
| 409 |
{ |
| 410 |
"include": "#module_name" |
| 411 |
}, |
| 412 |
{ |
| 413 |
"include": "#module_exports" |
| 414 |
} |
| 415 |
] |
| 416 |
}, |
| 417 |
{ |
| 418 |
"include": "#deriving" |
| 419 |
}, |
| 420 |
{ |
| 421 |
"include": "#layout_herald" |
| 422 |
}, |
| 423 |
{ |
| 424 |
"include": "#keyword" |
| 425 |
}, |
| 426 |
{ |
| 427 |
"match": "^\\s*(infix[lr]?)\\s+(.*)", |
| 428 |
"captures": { |
| 429 |
"1": { |
| 430 |
"name": "keyword.other.$1.haskell" |
| 431 |
}, |
| 432 |
"2": { |
| 433 |
"patterns": [ |
| 434 |
{ |
| 435 |
"include": "#comment_like" |
| 436 |
}, |
| 437 |
{ |
| 438 |
"include": "#integer_literals" |
| 439 |
}, |
| 440 |
{ |
| 441 |
"include": "#infix_op" |
| 442 |
} |
| 443 |
] |
| 444 |
} |
| 445 |
}, |
| 446 |
"name": "meta.fixity-declaration.haskell" |
| 447 |
}, |
| 448 |
{ |
| 449 |
"include": "#overloaded_label" |
| 450 |
}, |
| 451 |
{ |
| 452 |
"include": "#type_application" |
| 453 |
}, |
| 454 |
{ |
| 455 |
"include": "#reserved_symbol" |
| 456 |
}, |
| 457 |
{ |
| 458 |
"include": "#fun_decl" |
| 459 |
}, |
| 460 |
{ |
| 461 |
"include": "#qualifier" |
| 462 |
}, |
| 463 |
{ |
| 464 |
"include": "#data_constructor" |
| 465 |
}, |
| 466 |
{ |
| 467 |
"include": "#start_type_signature" |
| 468 |
}, |
| 469 |
{ |
| 470 |
"include": "#prefix_op" |
| 471 |
}, |
| 472 |
{ |
| 473 |
"include": "#infix_op" |
| 474 |
}, |
| 475 |
{ |
| 476 |
"begin": "(\\()(#)\\s", |
| 477 |
"end": "(#)(\\))", |
| 478 |
"beginCaptures": { |
| 479 |
"1": { |
| 480 |
"name": "punctuation.paren.haskell" |
| 481 |
}, |
| 482 |
"2": { |
| 483 |
"name": "keyword.operator.hash.haskell" |
| 484 |
} |
| 485 |
}, |
| 486 |
"endCaptures": { |
| 487 |
"1": { |
| 488 |
"name": "keyword.operator.hash.haskell" |
| 489 |
}, |
| 490 |
"2": { |
| 491 |
"name": "punctuation.paren.haskell" |
| 492 |
} |
| 493 |
}, |
| 494 |
"patterns": [ |
| 495 |
{ |
| 496 |
"include": "#comma" |
| 497 |
}, |
| 498 |
{ |
| 499 |
"include": "$self" |
| 500 |
} |
| 501 |
] |
| 502 |
}, |
| 503 |
{ |
| 504 |
"begin": "(\\()", |
| 505 |
"end": "(\\))", |
| 506 |
"beginCaptures": { |
| 507 |
"1": { |
| 508 |
"name": "punctuation.paren.haskell" |
| 509 |
} |
| 510 |
}, |
| 511 |
"endCaptures": { |
| 512 |
"1": { |
| 513 |
"name": "punctuation.paren.haskell" |
| 514 |
} |
| 515 |
}, |
| 516 |
"patterns": [ |
| 517 |
{ |
| 518 |
"include": "#comma" |
| 519 |
}, |
| 520 |
{ |
| 521 |
"include": "$self" |
| 522 |
} |
| 523 |
] |
| 524 |
}, |
| 525 |
{ |
| 526 |
"include": "#quasi_quote" |
| 527 |
}, |
| 528 |
{ |
| 529 |
"begin": "(\\[)", |
| 530 |
"end": "(\\])", |
| 531 |
"beginCaptures": { |
| 532 |
"1": { |
| 533 |
"name": "punctuation.bracket.haskell" |
| 534 |
} |
| 535 |
}, |
| 536 |
"endCaptures": { |
| 537 |
"1": { |
| 538 |
"name": "punctuation.bracket.haskell" |
| 539 |
} |
| 540 |
}, |
| 541 |
"patterns": [ |
| 542 |
{ |
| 543 |
"include": "#comma" |
| 544 |
}, |
| 545 |
{ |
| 546 |
"include": "$self" |
| 547 |
} |
| 548 |
] |
| 549 |
}, |
| 550 |
{ |
| 551 |
"include": "#record" |
| 552 |
} |
| 553 |
], |
| 554 |
"repository": { |
| 555 |
"block_comment": { |
| 556 |
"applyEndPatternLast": 1, |
| 557 |
"begin": "\\{-", |
| 558 |
"captures": { |
| 559 |
"0": { |
| 560 |
"name": "punctuation.definition.comment.haskell" |
| 561 |
} |
| 562 |
}, |
| 563 |
"end": "-\\}", |
| 564 |
"name": "comment.block.haskell", |
| 565 |
"patterns": [ |
| 566 |
{ |
| 567 |
"include": "#block_comment" |
| 568 |
} |
| 569 |
] |
| 570 |
}, |
| 571 |
"comments": { |
| 572 |
"patterns": [ |
| 573 |
{ |
| 574 |
"begin": "^(\\s*)(--\\s[\\|\\$])", |
| 575 |
"beginCaptures": { |
| 576 |
"2": { |
| 577 |
"name": "punctuation.whitespace.comment.leading.haskell" |
| 578 |
} |
| 579 |
}, |
| 580 |
"end": "(?=^(?!\\1--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])))", |
| 581 |
"name": "comment.block.documentation.haskell" |
| 582 |
}, |
| 583 |
{ |
| 584 |
"begin": "(^[ \\t]+)?(--\\s[\\^\\*])", |
| 585 |
"beginCaptures": { |
| 586 |
"1": { |
| 587 |
"name": "punctuation.whitespace.comment.leading.haskell" |
| 588 |
} |
| 589 |
}, |
| 590 |
"end": "\\n", |
| 591 |
"name": "comment.line.documentation.haskell" |
| 592 |
}, |
| 593 |
{ |
| 594 |
"applyEndPatternLast": 1, |
| 595 |
"begin": "\\{-\\s?[\\|\\$\\*\\^]", |
| 596 |
"captures": { |
| 597 |
"0": { |
| 598 |
"name": "punctuation.definition.comment.haskell" |
| 599 |
} |
| 600 |
}, |
| 601 |
"end": "-\\}", |
| 602 |
"name": "comment.block.documentation.haskell", |
| 603 |
"patterns": [ |
| 604 |
{ |
| 605 |
"include": "#block_comment" |
| 606 |
} |
| 607 |
] |
| 608 |
}, |
| 609 |
{ |
| 610 |
"begin": "(^[ \\t]+)?(?=--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))", |
| 611 |
"beginCaptures": { |
| 612 |
"1": { |
| 613 |
"name": "punctuation.whitespace.comment.leading.haskell" |
| 614 |
} |
| 615 |
}, |
| 616 |
"comment": "Operators may begin with '--' as long as they are not entirely composed of '-' characters. This means comments can't be immediately followed by an allowable operator character.", |
| 617 |
"end": "(?!\\G)", |
| 618 |
"patterns": [ |
| 619 |
{ |
| 620 |
"begin": "--", |
| 621 |
"beginCaptures": { |
| 622 |
"0": { |
| 623 |
"name": "punctuation.definition.comment.haskell" |
| 624 |
} |
| 625 |
}, |
| 626 |
"end": "\\n", |
| 627 |
"name": "comment.line.double-dash.haskell" |
| 628 |
} |
| 629 |
] |
| 630 |
}, |
| 631 |
{ |
| 632 |
"include": "#block_comment" |
| 633 |
} |
| 634 |
] |
| 635 |
}, |
| 636 |
"comment_like": { |
| 637 |
"patterns": [ |
| 638 |
{ |
| 639 |
"include": "#cpp" |
| 640 |
}, |
| 641 |
{ |
| 642 |
"include": "#pragma" |
| 643 |
}, |
| 644 |
{ |
| 645 |
"include": "#comments" |
| 646 |
} |
| 647 |
] |
| 648 |
}, |
| 649 |
"cpp": { |
| 650 |
"captures": { |
| 651 |
"1": { |
| 652 |
"name": "punctuation.definition.preprocessor.c" |
| 653 |
} |
| 654 |
}, |
| 655 |
"comment": "In addition to Haskell's \"native\" syntax, GHC permits the C preprocessor to be run on a source file.", |
| 656 |
"match": "^(#).*$", |
| 657 |
"name": "meta.preprocessor.c" |
| 658 |
}, |
| 659 |
"where": { |
| 660 |
"patterns": [ |
| 661 |
{ |
| 662 |
"begin": "(?x)\n (?<!')\\b(where)\n \\s*(\\{)(?!-)", |
| 663 |
"end": "(\\})", |
| 664 |
"beginCaptures": { |
| 665 |
"1": { |
| 666 |
"name": "keyword.other.where.haskell" |
| 667 |
}, |
| 668 |
"2": { |
| 669 |
"name": "punctuation.brace.haskell" |
| 670 |
} |
| 671 |
}, |
| 672 |
"endCaptures": { |
| 673 |
"1": { |
| 674 |
"name": "punctuation.brace.haskell" |
| 675 |
} |
| 676 |
}, |
| 677 |
"patterns": [ |
| 678 |
{ |
| 679 |
"include": "$self" |
| 680 |
}, |
| 681 |
{ |
| 682 |
"match": ";", |
| 683 |
"name": "punctuation.semicolon.haskell" |
| 684 |
} |
| 685 |
] |
| 686 |
}, |
| 687 |
{ |
| 688 |
"match": "\\b(?<!')(where)\\b(?!')", |
| 689 |
"name": "keyword.other.where.haskell" |
| 690 |
} |
| 691 |
] |
| 692 |
}, |
| 693 |
"layout_herald": { |
| 694 |
"begin": "(?x)\n (?<!')\\b(?:(where|let|m?do)|(of))\n \\s*(\\{)(?!-)", |
| 695 |
"end": "(\\})", |
| 696 |
"beginCaptures": { |
| 697 |
"1": { |
| 698 |
"name": "keyword.other.$1.haskell" |
| 699 |
}, |
| 700 |
"2": { |
| 701 |
"name": "keyword.control.of.haskell" |
| 702 |
}, |
| 703 |
"3": { |
| 704 |
"name": "punctuation.brace.haskell" |
| 705 |
} |
| 706 |
}, |
| 707 |
"endCaptures": { |
| 708 |
"1": { |
| 709 |
"name": "punctuation.brace.haskell" |
| 710 |
} |
| 711 |
}, |
| 712 |
"patterns": [ |
| 713 |
{ |
| 714 |
"include": "$self" |
| 715 |
}, |
| 716 |
{ |
| 717 |
"match": ";", |
| 718 |
"name": "punctuation.semicolon.haskell" |
| 719 |
} |
| 720 |
] |
| 721 |
}, |
| 722 |
"keyword": { |
| 723 |
"match": "\\b(?<!')(?:(where|let|in|default)|(m?do|if|then|else|case|of|proc|rec))\\b(?!')", |
| 724 |
"captures": { |
| 725 |
"1": { |
| 726 |
"name": "keyword.other.$1.haskell" |
| 727 |
}, |
| 728 |
"2": { |
| 729 |
"name": "keyword.control.$2.haskell" |
| 730 |
} |
| 731 |
} |
| 732 |
}, |
| 733 |
"deriving": { |
| 734 |
"patterns": [ |
| 735 |
{ |
| 736 |
"begin": "^(\\s*)(deriving)\\s+(?:(via|stock|newtype|anyclass)\\s+)?", |
| 737 |
"beginCaptures": { |
| 738 |
"2": { |
| 739 |
"name": "keyword.other.deriving.haskell" |
| 740 |
}, |
| 741 |
"3": { |
| 742 |
"name": "keyword.other.deriving.strategy.$3.haskell" |
| 743 |
} |
| 744 |
}, |
| 745 |
"end": "(?x) # Detect end of deriving statement\n # Decreasing indentation\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )", |
| 746 |
"patterns": [ |
| 747 |
{ |
| 748 |
"include": "#comment_like" |
| 749 |
}, |
| 750 |
{ |
| 751 |
"match": "(?<!')\\b(instance)\\b(?!')", |
| 752 |
"name": "keyword.other.instance.haskell" |
| 753 |
}, |
| 754 |
{ |
| 755 |
"match": "(?<!')\\b(via|stock|newtype|anyclass)\\b(?!')", |
| 756 |
"captures": { |
| 757 |
"1": { |
| 758 |
"name": "keyword.other.deriving.strategy.$1.haskell" |
| 759 |
} |
| 760 |
} |
| 761 |
}, |
| 762 |
{ |
| 763 |
"include": "#type_signature" |
| 764 |
} |
| 765 |
], |
| 766 |
"name": "meta.deriving.haskell" |
| 767 |
}, |
| 768 |
{ |
| 769 |
"begin": "(deriving)(?:\\s+(stock|newtype|anyclass))?\\s*(\\()", |
| 770 |
"beginCaptures": { |
| 771 |
"1": { |
| 772 |
"name": "keyword.other.deriving.haskell" |
| 773 |
}, |
| 774 |
"2": { |
| 775 |
"name": "keyword.other.deriving.strategy.$2.haskell" |
| 776 |
}, |
| 777 |
"3": { |
| 778 |
"name": "punctuation.paren.haskell" |
| 779 |
} |
| 780 |
}, |
| 781 |
"end": "(\\))", |
| 782 |
"endCaptures": { |
| 783 |
"1": { |
| 784 |
"name": "punctuation.paren.haskell" |
| 785 |
} |
| 786 |
}, |
| 787 |
"name": "meta.deriving.haskell", |
| 788 |
"patterns": [ |
| 789 |
{ |
| 790 |
"include": "#type_signature" |
| 791 |
} |
| 792 |
] |
| 793 |
}, |
| 794 |
{ |
| 795 |
"match": "(?x)\n (deriving)(?:\\s+(stock|newtype|anyclass))?\\s+\n ([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\n (\\s+(via)\\s+(.*)$)?\n", |
| 796 |
"captures": { |
| 797 |
"1": { |
| 798 |
"name": "keyword.other.deriving.haskell" |
| 799 |
}, |
| 800 |
"2": { |
| 801 |
"name": "keyword.other.deriving.strategy.$2.haskell" |
| 802 |
}, |
| 803 |
"3": { |
| 804 |
"patterns": [ |
| 805 |
{ |
| 806 |
"include": "#type_signature" |
| 807 |
} |
| 808 |
] |
| 809 |
}, |
| 810 |
"5": { |
| 811 |
"name": "keyword.other.deriving.strategy.via.haskell" |
| 812 |
}, |
| 813 |
"6": { |
| 814 |
"patterns": [ |
| 815 |
{ |
| 816 |
"include": "#type_signature" |
| 817 |
} |
| 818 |
] |
| 819 |
} |
| 820 |
}, |
| 821 |
"name": "meta.deriving.haskell" |
| 822 |
}, |
| 823 |
{ |
| 824 |
"match": "(?<!')\\b(via)\\b(?!')", |
| 825 |
"name": "keyword.other.deriving.strategy.via.haskell" |
| 826 |
} |
| 827 |
] |
| 828 |
}, |
| 829 |
"prefix_op": { |
| 830 |
"patterns": [ |
| 831 |
{ |
| 832 |
"comment": "An operator cannot be composed entirely of '-' characters; instead, it should be matched as a comment.\n", |
| 833 |
"match": "(?x)\n (\\()\\s*(?!(?:--+|\\.\\.)\\))(\\#+|[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+(?<!\\#))\\s*(\\))", |
| 834 |
"captures": { |
| 835 |
"1": { |
| 836 |
"name": "punctuation.paren.haskell" |
| 837 |
}, |
| 838 |
"2": { |
| 839 |
"name": "entity.name.function.infix.haskell" |
| 840 |
}, |
| 841 |
"3": { |
| 842 |
"name": "punctuation.paren.haskell" |
| 843 |
} |
| 844 |
} |
| 845 |
} |
| 846 |
] |
| 847 |
}, |
| 848 |
"infix_op": { |
| 849 |
"patterns": [ |
| 850 |
{ |
| 851 |
"match": "(?x)\n ((?:(?<!'')('')?[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'']*\\.)*)\n (\\#+|[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+(?<!\\#))", |
| 852 |
"comment": "In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.\n", |
| 853 |
"captures": { |
| 854 |
"1": { |
| 855 |
"name": "keyword.operator.promotion.haskell" |
| 856 |
}, |
| 857 |
"2": { |
| 858 |
"name": "entity.name.namespace.haskell" |
| 859 |
}, |
| 860 |
"3": { |
| 861 |
"name": "keyword.operator.infix.haskell" |
| 862 |
} |
| 863 |
} |
| 864 |
}, |
| 865 |
{ |
| 866 |
"match": "(`)((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'']*\\.)*)([\\p{Ll}\\p{Lu}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'']*)(`)", |
| 867 |
"captures": { |
| 868 |
"1": { |
| 869 |
"name": "punctuation.backtick.haskell" |
| 870 |
}, |
| 871 |
"2": { |
| 872 |
"name": "entity.name.namespace.haskell" |
| 873 |
}, |
| 874 |
"3": { |
| 875 |
"patterns": [ |
| 876 |
{ |
| 877 |
"include": "#data_constructor" |
| 878 |
} |
| 879 |
] |
| 880 |
}, |
| 881 |
"4": { |
| 882 |
"name": "punctuation.backtick.haskell" |
| 883 |
} |
| 884 |
}, |
| 885 |
"comment": "In case this regex seems unusual for an infix operator, note that Haskell\nallows any ordinary function application (elem 4 [1..10]) to be rewritten\nas an infix expression (4 `elem` [1..10]).\n", |
| 886 |
"name": "keyword.operator.function.infix.haskell" |
| 887 |
} |
| 888 |
] |
| 889 |
}, |
| 890 |
"module_exports": { |
| 891 |
"begin": "\\(", |
| 892 |
"beginCaptures": { |
| 893 |
"0": { |
| 894 |
"name": "punctuation.paren.haskell" |
| 895 |
} |
| 896 |
}, |
| 897 |
"end": "\\)", |
| 898 |
"endCaptures": { |
| 899 |
"0": { |
| 900 |
"name": "punctuation.paren.haskell" |
| 901 |
} |
| 902 |
}, |
| 903 |
"applyEndPatternLast": 1, |
| 904 |
"name": "meta.declaration.exports.haskell", |
| 905 |
"patterns": [ |
| 906 |
{ |
| 907 |
"include": "#comment_like" |
| 908 |
}, |
| 909 |
{ |
| 910 |
"match": "\\b(?<!')(module)\\b(?!')", |
| 911 |
"captures": { |
| 912 |
"1": { |
| 913 |
"name": "keyword.other.module.haskell" |
| 914 |
} |
| 915 |
} |
| 916 |
}, |
| 917 |
{ |
| 918 |
"include": "#comma" |
| 919 |
}, |
| 920 |
{ |
| 921 |
"include": "#export_constructs" |
| 922 |
}, |
| 923 |
{ |
| 924 |
"begin": "\\(", |
| 925 |
"beginCaptures": { |
| 926 |
"0": { |
| 927 |
"name": "punctuation.paren.haskell" |
| 928 |
} |
| 929 |
}, |
| 930 |
"end": "\\)", |
| 931 |
"endCaptures": { |
| 932 |
"0": { |
| 933 |
"name": "punctuation.paren.haskell" |
| 934 |
} |
| 935 |
}, |
| 936 |
"patterns": [ |
| 937 |
{ |
| 938 |
"include": "#comment_like" |
| 939 |
}, |
| 940 |
{ |
| 941 |
"include": "#record_wildcard" |
| 942 |
}, |
| 943 |
{ |
| 944 |
"include": "#export_constructs" |
| 945 |
}, |
| 946 |
{ |
| 947 |
"include": "#comma" |
| 948 |
} |
| 949 |
] |
| 950 |
} |
| 951 |
] |
| 952 |
}, |
| 953 |
"export_constructs": { |
| 954 |
"patterns": [ |
| 955 |
{ |
| 956 |
"include": "#comment_like" |
| 957 |
}, |
| 958 |
{ |
| 959 |
"begin": "\\b(?<!')(pattern)\\b(?!')", |
| 960 |
"beginCaptures": { |
| 961 |
"1": { |
| 962 |
"name": "keyword.other.pattern.haskell" |
| 963 |
} |
| 964 |
}, |
| 965 |
"end": "(?x)\n # Data constructor\n ([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\n # Prefix form of symbolic constructor\n | (\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))", |
| 966 |
"endCaptures": { |
| 967 |
"1": { |
| 968 |
"name": "constant.other.haskell" |
| 969 |
}, |
| 970 |
"2": { |
| 971 |
"name": "punctuation.paren.haskell" |
| 972 |
}, |
| 973 |
"3": { |
| 974 |
"name": "constant.other.operator.haskell" |
| 975 |
}, |
| 976 |
"4": { |
| 977 |
"name": "punctuation.paren.haskell" |
| 978 |
} |
| 979 |
}, |
| 980 |
"patterns": [ |
| 981 |
{ |
| 982 |
"include": "#comment_like" |
| 983 |
} |
| 984 |
] |
| 985 |
}, |
| 986 |
{ |
| 987 |
"begin": "\\b(?<!')(type)\\b(?!')", |
| 988 |
"beginCaptures": { |
| 989 |
"1": { |
| 990 |
"name": "keyword.other.type.haskell" |
| 991 |
} |
| 992 |
}, |
| 993 |
"end": "(?x)\n # Type name\n ([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\n # Prefix form of type operator\n | (\\()\\s*([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))", |
| 994 |
"endCaptures": { |
| 995 |
"1": { |
| 996 |
"name": "storage.type.haskell" |
| 997 |
}, |
| 998 |
"2": { |
| 999 |
"name": "punctuation.paren.haskell" |
| 1000 |
}, |
| 1001 |
"3": { |
| 1002 |
"name": "storage.type.operator.haskell" |
| 1003 |
}, |
| 1004 |
"4": { |
| 1005 |
"name": "punctuation.paren.haskell" |
| 1006 |
} |
| 1007 |
}, |
| 1008 |
"patterns": [ |
| 1009 |
{ |
| 1010 |
"include": "#comment_like" |
| 1011 |
} |
| 1012 |
] |
| 1013 |
}, |
| 1014 |
{ |
| 1015 |
"match": "(?<!')\\b[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", |
| 1016 |
"name": "entity.name.function.haskell" |
| 1017 |
}, |
| 1018 |
{ |
| 1019 |
"match": "(?<!')\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", |
| 1020 |
"name": "storage.type.haskell" |
| 1021 |
}, |
| 1022 |
{ |
| 1023 |
"include": "#record_wildcard" |
| 1024 |
}, |
| 1025 |
{ |
| 1026 |
"include": "#reserved_symbol" |
| 1027 |
}, |
| 1028 |
{ |
| 1029 |
"include": "#prefix_op" |
| 1030 |
} |
| 1031 |
] |
| 1032 |
}, |
| 1033 |
"comma": { |
| 1034 |
"match": ",", |
| 1035 |
"name": "punctuation.separator.comma.haskell" |
| 1036 |
}, |
| 1037 |
"module_name": { |
| 1038 |
"match": "(?<conid>[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(\\.\\g<conid>)?)", |
| 1039 |
"name": "entity.name.namespace.haskell" |
| 1040 |
}, |
| 1041 |
"pragma": { |
| 1042 |
"begin": "\\{-#", |
| 1043 |
"end": "#-\\}", |
| 1044 |
"name": "meta.preprocessor.haskell", |
| 1045 |
"patterns": [ |
| 1046 |
{ |
| 1047 |
"begin": "(?xi) \\b(?<!')(LANGUAGE)\\b(?!')", |
| 1048 |
"end": "(?=#-\\})", |
| 1049 |
"beginCaptures": { |
| 1050 |
"1": { |
| 1051 |
"name": "keyword.other.preprocessor.pragma.haskell" |
| 1052 |
} |
| 1053 |
}, |
| 1054 |
"patterns": [ |
| 1055 |
{ |
| 1056 |
"match": "(?x)\n (?:No)?\n (?:AutoDeriveTypeable|DatatypeContexts|DoRec|IncoherentInstances|MonadFailDesugaring|MonoPatBinds|NullaryTypeClasses|OverlappingInstances|PatternSignatures|RecordPuns|RelaxedPolyRec)", |
| 1057 |
"name": "invalid.deprecated" |
| 1058 |
}, |
| 1059 |
{ |
| 1060 |
"match": "(?x)\n (\n (?:No)?\n (?:AllowAmbiguousTypes|AlternativeLayoutRule|AlternativeLayoutRuleTransitional|Arrows|BangPatterns|BinaryLiterals|CApiFFI|CPP|CUSKs|ConstrainedClassMethods|ConstraintKinds|DataKinds|DefaultSignatures|DeriveAnyClass|DeriveDataTypeable|DeriveFoldable|DeriveFunctor|DeriveGeneric|DeriveLift|DeriveTraversable|DerivingStrategies|DerivingVia|DisambiguateRecordFields|DoAndIfThenElse|BlockArguments|DuplicateRecordFields|EmptyCase|EmptyDataDecls|EmptyDataDeriving|ExistentialQuantification|ExplicitForAll|ExplicitNamespaces|ExtendedDefaultRules|FlexibleContexts|FlexibleInstances|ForeignFunctionInterface|FunctionalDependencies|GADTSyntax|GADTs|GHCForeignImportPrim|Generali(?:s|z)edNewtypeDeriving|ImplicitParams|ImplicitPrelude|ImportQualifiedPost|ImpredicativeTypes|TypeFamilyDependencies|InstanceSigs|ApplicativeDo|InterruptibleFFI|JavaScriptFFI|KindSignatures|LambdaCase|LiberalTypeSynonyms|MagicHash|MonadComprehensions|MonoLocalBinds|MonomorphismRestriction|MultiParamTypeClasses|MultiWayIf|NumericUnderscores|NPlusKPatterns|NamedFieldPuns|NamedWildCards|NegativeLiterals|HexFloatLiterals|NondecreasingIndentation|NumDecimals|OverloadedLabels|OverloadedLists|OverloadedStrings|PackageImports|ParallelArrays|ParallelListComp|PartialTypeSignatures|PatternGuards|PatternSynonyms|PolyKinds|PolymorphicComponents|QuantifiedConstraints|PostfixOperators|QuasiQuotes|Rank2Types|RankNTypes|RebindableSyntax|RecordWildCards|RecursiveDo|RelaxedLayout|RoleAnnotations|ScopedTypeVariables|StandaloneDeriving|StarIsType|StaticPointers|Strict|StrictData|TemplateHaskell|TemplateHaskellQuotes|StandaloneKindSignatures|TraditionalRecordSyntax|TransformListComp|TupleSections|TypeApplications|TypeInType|TypeFamilies|TypeOperators|TypeSynonymInstances|UnboxedTuples|UnboxedSums|UndecidableInstances|UndecidableSuperClasses|UnicodeSyntax|UnliftedFFITypes|UnliftedNewtypes|ViewPatterns)\n )", |
| 1061 |
"captures": { |
| 1062 |
"1": { |
| 1063 |
"name": "keyword.other.preprocessor.extension.haskell" |
| 1064 |
} |
| 1065 |
} |
| 1066 |
}, |
| 1067 |
{ |
| 1068 |
"include": "#comma" |
| 1069 |
} |
| 1070 |
] |
| 1071 |
}, |
| 1072 |
{ |
| 1073 |
"begin": "(?xi)\n \\b(?<!')(SPECIALI(?:S|Z)E)\n (?:\n \\s*( \\[ [^\\[\\]]* \\])?\\s*\n |\\s+\n )\n (instance)\\b(?!')", |
| 1074 |
"end": "(?=#-\\})", |
| 1075 |
"beginCaptures": { |
| 1076 |
"1": { |
| 1077 |
"name": "keyword.other.preprocessor.pragma.haskell" |
| 1078 |
}, |
| 1079 |
"2": { |
| 1080 |
"patterns": [ |
| 1081 |
{ |
| 1082 |
"include": "#inline_phase" |
| 1083 |
} |
| 1084 |
] |
| 1085 |
}, |
| 1086 |
"3": { |
| 1087 |
"name": "keyword.other.instance.haskell" |
| 1088 |
} |
| 1089 |
}, |
| 1090 |
"patterns": [ |
| 1091 |
{ |
| 1092 |
"include": "#type_signature" |
| 1093 |
} |
| 1094 |
] |
| 1095 |
}, |
| 1096 |
{ |
| 1097 |
"begin": "(?xi)\n \\b(?<!')(SPECIALI(?:S|Z)E)\\b(?!')\n (?:\\s+(INLINE)\\b(?!'))?\n (?:\\s*(\\[ [^\\[\\]]* \\])?)\n \\s*", |
| 1098 |
"end": "(?=#-\\})", |
| 1099 |
"beginCaptures": { |
| 1100 |
"1": { |
| 1101 |
"name": "keyword.other.preprocessor.pragma.haskell" |
| 1102 |
}, |
| 1103 |
"2": { |
| 1104 |
"name": "keyword.other.preprocessor.pragma.haskell" |
| 1105 |
}, |
| 1106 |
"3": { |
| 1107 |
"patterns": [ |
| 1108 |
{ |
| 1109 |
"include": "#inline_phase" |
| 1110 |
} |
| 1111 |
] |
| 1112 |
} |
| 1113 |
}, |
| 1114 |
"patterns": [ |
| 1115 |
{ |
| 1116 |
"include": "$self" |
| 1117 |
} |
| 1118 |
] |
| 1119 |
}, |
| 1120 |
{ |
| 1121 |
"match": "(?xi) \\b(?<!')\n (LANGUAGE|OPTIONS_GHC|INCLUDE\n |MINIMAL|UNPACK|OVERLAPS|INCOHERENT\n |NOUNPACK|SOURCE|OVERLAPPING|OVERLAPPABLE|INLINE\n |NOINLINE|INLINE?ABLE|CONLIKE|LINE|COLUMN|RULES\n |COMPLETE)\\b(?!')", |
| 1122 |
"name": "keyword.other.preprocessor.haskell" |
| 1123 |
}, |
| 1124 |
{ |
| 1125 |
"begin": "(?i)\\b(DEPRECATED|WARNING)\\b", |
| 1126 |
"beginCaptures": { |
| 1127 |
"1": { |
| 1128 |
"name": "keyword.other.preprocessor.pragma.haskell" |
| 1129 |
} |
| 1130 |
}, |
| 1131 |
"end": "(?=#-\\})", |
| 1132 |
"patterns": [ |
| 1133 |
{ |
| 1134 |
"include": "#string_literal" |
| 1135 |
} |
| 1136 |
] |
| 1137 |
} |
| 1138 |
] |
| 1139 |
}, |
| 1140 |
"liquid_haskell": { |
| 1141 |
"name": "block.liquidhaskell.haskell", |
| 1142 |
"begin": "\\{-@", |
| 1143 |
"end": "@-\\}", |
| 1144 |
"patterns": [ |
| 1145 |
{ |
| 1146 |
"include": "$self" |
| 1147 |
} |
| 1148 |
] |
| 1149 |
}, |
| 1150 |
"context": { |
| 1151 |
"match": "(?x)\n (.*)\n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\n (=>|⇒)\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\n", |
| 1152 |
"captures": { |
| 1153 |
"1": { |
| 1154 |
"patterns": [ |
| 1155 |
{ |
| 1156 |
"include": "#comment_like" |
| 1157 |
}, |
| 1158 |
{ |
| 1159 |
"include": "#type_signature" |
| 1160 |
} |
| 1161 |
] |
| 1162 |
}, |
| 1163 |
"2": { |
| 1164 |
"name": "keyword.operator.big-arrow.haskell" |
| 1165 |
} |
| 1166 |
} |
| 1167 |
}, |
| 1168 |
"data_constructor": { |
| 1169 |
"match": "\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?![\\.'\\w])", |
| 1170 |
"name": "constant.other.haskell" |
| 1171 |
}, |
| 1172 |
"qualifier": { |
| 1173 |
"match": "\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.", |
| 1174 |
"name": "entity.name.namespace.haskell" |
| 1175 |
}, |
| 1176 |
"record_decl": { |
| 1177 |
"begin": "({)(?!-)", |
| 1178 |
"beginCaptures": { |
| 1179 |
"1": { |
| 1180 |
"name": "punctuation.brace.haskell" |
| 1181 |
} |
| 1182 |
}, |
| 1183 |
"end": "(?<!-)(})", |
| 1184 |
"endCaptures": { |
| 1185 |
"1": { |
| 1186 |
"name": "punctuation.brace.haskell" |
| 1187 |
} |
| 1188 |
}, |
| 1189 |
"name": "meta.record.definition.haskell", |
| 1190 |
"patterns": [ |
| 1191 |
{ |
| 1192 |
"include": "#comment_like" |
| 1193 |
}, |
| 1194 |
{ |
| 1195 |
"include": "#record_decl_field" |
| 1196 |
} |
| 1197 |
] |
| 1198 |
}, |
| 1199 |
"record": { |
| 1200 |
"begin": "({)(?!-)", |
| 1201 |
"beginCaptures": { |
| 1202 |
"1": { |
| 1203 |
"name": "punctuation.brace.haskell" |
| 1204 |
} |
| 1205 |
}, |
| 1206 |
"end": "(?<!-)(})", |
| 1207 |
"endCaptures": { |
| 1208 |
"1": { |
| 1209 |
"name": "punctuation.brace.haskell" |
| 1210 |
} |
| 1211 |
}, |
| 1212 |
"name": "meta.record.haskell", |
| 1213 |
"patterns": [ |
| 1214 |
{ |
| 1215 |
"include": "#comment_like" |
| 1216 |
}, |
| 1217 |
{ |
| 1218 |
"include": "#record_field" |
| 1219 |
} |
| 1220 |
] |
| 1221 |
}, |
| 1222 |
"record_decl_field": { |
| 1223 |
"begin": "(?x)\n (?:([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\n |(\\()\\s*([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))\n )\n", |
| 1224 |
"end": "(,)|(?=})", |
| 1225 |
"beginCaptures": { |
| 1226 |
"1": { |
| 1227 |
"name": "variable.other.member.definition.haskell" |
| 1228 |
}, |
| 1229 |
"2": { |
| 1230 |
"name": "punctuation.paren.haskell" |
| 1231 |
}, |
| 1232 |
"3": { |
| 1233 |
"name": "variable.other.member.definition.haskell" |
| 1234 |
}, |
| 1235 |
"4": { |
| 1236 |
"name": "punctuation.paren.haskell" |
| 1237 |
} |
| 1238 |
}, |
| 1239 |
"endCaptures": { |
| 1240 |
"1": { |
| 1241 |
"name": "punctuation.comma.haskell" |
| 1242 |
} |
| 1243 |
}, |
| 1244 |
"patterns": [ |
| 1245 |
{ |
| 1246 |
"include": "#comment_like" |
| 1247 |
}, |
| 1248 |
{ |
| 1249 |
"include": "#comma" |
| 1250 |
}, |
| 1251 |
{ |
| 1252 |
"include": "#double_colon" |
| 1253 |
}, |
| 1254 |
{ |
| 1255 |
"include": "#type_signature" |
| 1256 |
}, |
| 1257 |
{ |
| 1258 |
"include": "#record_decl_field" |
| 1259 |
} |
| 1260 |
] |
| 1261 |
}, |
| 1262 |
"record_wildcard": { |
| 1263 |
"match": "(?x)\n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\n (\\.\\.)\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])", |
| 1264 |
"captures": { |
| 1265 |
"1": { |
| 1266 |
"name": "variable.other.member.wildcard.haskell" |
| 1267 |
} |
| 1268 |
} |
| 1269 |
}, |
| 1270 |
"record_field": { |
| 1271 |
"patterns": [ |
| 1272 |
{ |
| 1273 |
"begin": "(?x)\n (?:([\\p{Ll}\\p{Lu}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\.']*)\n |(\\()\\s*([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))\n )\n", |
| 1274 |
"end": "(,)|(?=})", |
| 1275 |
"beginCaptures": { |
| 1276 |
"1": { |
| 1277 |
"name": "variable.other.member.haskell", |
| 1278 |
"patterns": [ |
| 1279 |
{ |
| 1280 |
"include": "#qualifier" |
| 1281 |
} |
| 1282 |
] |
| 1283 |
}, |
| 1284 |
"2": { |
| 1285 |
"name": "punctuation.paren.haskell" |
| 1286 |
}, |
| 1287 |
"3": { |
| 1288 |
"name": "variable.other.member.haskell" |
| 1289 |
}, |
| 1290 |
"4": { |
| 1291 |
"name": "punctuation.paren.haskell" |
| 1292 |
} |
| 1293 |
}, |
| 1294 |
"endCaptures": { |
| 1295 |
"1": { |
| 1296 |
"name": "punctuation.comma.haskell" |
| 1297 |
} |
| 1298 |
}, |
| 1299 |
"patterns": [ |
| 1300 |
{ |
| 1301 |
"include": "#comment_like" |
| 1302 |
}, |
| 1303 |
{ |
| 1304 |
"include": "#comma" |
| 1305 |
}, |
| 1306 |
{ |
| 1307 |
"include": "$self" |
| 1308 |
} |
| 1309 |
] |
| 1310 |
}, |
| 1311 |
{ |
| 1312 |
"include": "#record_wildcard" |
| 1313 |
} |
| 1314 |
] |
| 1315 |
}, |
| 1316 |
"role_annotation": { |
| 1317 |
"patterns": [ |
| 1318 |
{ |
| 1319 |
"begin": "^(\\s*)(type)\\s+(role)\\b(?!')", |
| 1320 |
"beginCaptures": { |
| 1321 |
"2": { |
| 1322 |
"name": "keyword.other.type.haskell" |
| 1323 |
}, |
| 1324 |
"3": { |
| 1325 |
"name": "keyword.other.role.haskell" |
| 1326 |
} |
| 1327 |
}, |
| 1328 |
"end": "(?x) # Detect end of block by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )", |
| 1329 |
"name": "meta.role-annotation.haskell", |
| 1330 |
"patterns": [ |
| 1331 |
{ |
| 1332 |
"include": "#comment_like" |
| 1333 |
}, |
| 1334 |
{ |
| 1335 |
"include": "#type_constructor" |
| 1336 |
}, |
| 1337 |
{ |
| 1338 |
"match": "\\b(?<!')(nominal|representational|phantom)\\b(?!')", |
| 1339 |
"captures": { |
| 1340 |
"1": { |
| 1341 |
"name": "keyword.other.role.$1.haskell" |
| 1342 |
} |
| 1343 |
} |
| 1344 |
} |
| 1345 |
] |
| 1346 |
} |
| 1347 |
] |
| 1348 |
}, |
| 1349 |
"fun_decl": { |
| 1350 |
"begin": "(?x)^(\\s*)\n (?<fn>\n (?:\n [\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\#*\n | \\(\\s*\n (?!--+\\))\n [\\p{S}\\p{P}&&[^(),:;\\[\\]`{}_\"']]\n [\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*\n \\s*\\)\n )\n (?:\\s*,\\s*\\g<fn>)?\n )\n \\s*(?<![\\p{S}\\p{P}&&[^\\),;\\]`}_\"']])(::|∷)(?![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])\n", |
| 1351 |
"beginCaptures": { |
| 1352 |
"2": { |
| 1353 |
"name": "entity.name.function.haskell", |
| 1354 |
"patterns": [ |
| 1355 |
{ |
| 1356 |
"include": "#reserved_symbol" |
| 1357 |
}, |
| 1358 |
{ |
| 1359 |
"include": "#prefix_op" |
| 1360 |
} |
| 1361 |
] |
| 1362 |
}, |
| 1363 |
"3": { |
| 1364 |
"name": "keyword.operator.double-colon.haskell" |
| 1365 |
} |
| 1366 |
}, |
| 1367 |
"name": "meta.function.type-declaration.haskell", |
| 1368 |
"patterns": [ |
| 1369 |
{ |
| 1370 |
"include": "#type_signature" |
| 1371 |
} |
| 1372 |
], |
| 1373 |
"end": "(?x)\n # End of type annotation:\n # To the left of a reserved symbolic keyword such as = or <-\n (?= \n # non-symbolic character\n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\n # symbolic keyword except (->)\n ((<-|←)|(=)|(-<|↢)|(-<<|⤛))\n # non-symbolic character\n ([(),;\\[\\]`{}_\"']|[^\\p{S}\\p{P}])\n )\n # Decreasing indentation:\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n" |
| 1374 |
}, |
| 1375 |
"adt_constructor": { |
| 1376 |
"patterns": [ |
| 1377 |
{ |
| 1378 |
"include": "#comment_like" |
| 1379 |
}, |
| 1380 |
{ |
| 1381 |
"begin": "(?x)\n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol\n (?:(=)|(\\|))\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]) # non-symbol", |
| 1382 |
"beginCaptures": { |
| 1383 |
"1": { |
| 1384 |
"name": "keyword.operator.eq.haskell" |
| 1385 |
}, |
| 1386 |
"2": { |
| 1387 |
"name": "keyword.operator.pipe.haskell" |
| 1388 |
} |
| 1389 |
}, |
| 1390 |
"end": "(?x)\n (?:\\G|^)\\s* # Enforce starting condition to avoid catastrophic backtracking (https://github.com/JustusAdam/language-haskell/issues/161)\n (?: # Infix data constructor\n # First argument\n (?:\n # Simple type\n (?<!')\\b((?:[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'\\.])+)\n # Type inside balanced parentheses\n | ('? # Optional promotion tick\n (?<paren>\n \\( # Opening parenthesis\n (?:\n [^\\(\\)]* # Match non-parentheses\n | \\g<paren> # or recurse into further depth\n )*\n \\) # Closing parenthesis\n )\n )\n # Type inside balanced brackets\n | ('? # Optional promotion tick\n (?<brac>\n \\( # Opening bracket\n (?:\n [^\\[\\]]* # Match non-brackets\n | \\g<brac> # or recurse into further depth\n )*\n \\] # Closing bracket\n )\n )\n ) \n # Then either\n \\s*\n # - a symbolic infix constructor, or\n (?:(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)\n # - an alphabetic infix constructor\n | (`)([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(`)\n )\n\n ) # Otherwise, prefix data constructor, either:\n | # - an alphabetic data constructor e.g. \"Cons_123\"\n (?:(?<!')\\b([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*))\n | # - a symbolic (prefix) data constructor\n (\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\))", |
| 1391 |
"endCaptures": { |
| 1392 |
"1": { |
| 1393 |
"patterns": [ |
| 1394 |
{ |
| 1395 |
"include": "#type_signature" |
| 1396 |
} |
| 1397 |
] |
| 1398 |
}, |
| 1399 |
"2": { |
| 1400 |
"patterns": [ |
| 1401 |
{ |
| 1402 |
"include": "#type_signature" |
| 1403 |
} |
| 1404 |
] |
| 1405 |
}, |
| 1406 |
"4": { |
| 1407 |
"patterns": [ |
| 1408 |
{ |
| 1409 |
"include": "#type_signature" |
| 1410 |
} |
| 1411 |
] |
| 1412 |
}, |
| 1413 |
"6": { |
| 1414 |
"name": "constant.other.operator.haskell" |
| 1415 |
}, |
| 1416 |
"7": { |
| 1417 |
"name": "punctuation.backtick.haskell" |
| 1418 |
}, |
| 1419 |
"8": { |
| 1420 |
"name": "constant.other.haskell" |
| 1421 |
}, |
| 1422 |
"9": { |
| 1423 |
"name": "punctuation.backtick.haskell" |
| 1424 |
}, |
| 1425 |
"10": { |
| 1426 |
"name": "constant.other.haskell" |
| 1427 |
}, |
| 1428 |
"11": { |
| 1429 |
"name": "punctuation.paren.haskell" |
| 1430 |
}, |
| 1431 |
"12": { |
| 1432 |
"name": "constant.other.operator.haskell" |
| 1433 |
}, |
| 1434 |
"13": { |
| 1435 |
"name": "punctuation.paren.haskell" |
| 1436 |
} |
| 1437 |
}, |
| 1438 |
"patterns": [ |
| 1439 |
{ |
| 1440 |
"include": "#comment_like" |
| 1441 |
}, |
| 1442 |
{ |
| 1443 |
"include": "#deriving" |
| 1444 |
}, |
| 1445 |
{ |
| 1446 |
"include": "#record_decl" |
| 1447 |
}, |
| 1448 |
{ |
| 1449 |
"include": "#forall" |
| 1450 |
}, |
| 1451 |
{ |
| 1452 |
"include": "#context" |
| 1453 |
} |
| 1454 |
] |
| 1455 |
} |
| 1456 |
] |
| 1457 |
}, |
| 1458 |
"gadt_constructor": { |
| 1459 |
"patterns": [ |
| 1460 |
{ |
| 1461 |
"begin": "(?x)\n ^(\\s*)\n (?:\n (\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\n |(\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\))\n )", |
| 1462 |
"beginCaptures": { |
| 1463 |
"2": { |
| 1464 |
"name": "constant.other.haskell" |
| 1465 |
}, |
| 1466 |
"3": { |
| 1467 |
"name": "punctuation.paren.haskell" |
| 1468 |
}, |
| 1469 |
"4": { |
| 1470 |
"name": "constant.other.operator.haskell" |
| 1471 |
}, |
| 1472 |
"5": { |
| 1473 |
"name": "punctuation.paren.haskell" |
| 1474 |
} |
| 1475 |
}, |
| 1476 |
"end": "(?x)\n # GADT constructor ends\n (?=\\b(?<!'')deriving\\b(?!')) \n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 1477 |
"patterns": [ |
| 1478 |
{ |
| 1479 |
"include": "#comment_like" |
| 1480 |
}, |
| 1481 |
{ |
| 1482 |
"include": "#deriving" |
| 1483 |
}, |
| 1484 |
{ |
| 1485 |
"include": "#double_colon" |
| 1486 |
}, |
| 1487 |
{ |
| 1488 |
"include": "#record_decl" |
| 1489 |
}, |
| 1490 |
{ |
| 1491 |
"include": "#type_signature" |
| 1492 |
} |
| 1493 |
] |
| 1494 |
}, |
| 1495 |
{ |
| 1496 |
"begin": "(?x)\n (\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}]*) # named constructor\n |(\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\)) # prefix operator", |
| 1497 |
"beginCaptures": { |
| 1498 |
"1": { |
| 1499 |
"name": "constant.other.haskell" |
| 1500 |
}, |
| 1501 |
"2": { |
| 1502 |
"name": "punctuation.paren.haskell" |
| 1503 |
}, |
| 1504 |
"3": { |
| 1505 |
"name": "constant.other.operator.haskell" |
| 1506 |
}, |
| 1507 |
"4": { |
| 1508 |
"name": "punctuation.paren.haskell" |
| 1509 |
} |
| 1510 |
}, |
| 1511 |
"end": "$", |
| 1512 |
"patterns": [ |
| 1513 |
{ |
| 1514 |
"include": "#comment_like" |
| 1515 |
}, |
| 1516 |
{ |
| 1517 |
"include": "#deriving" |
| 1518 |
}, |
| 1519 |
{ |
| 1520 |
"include": "#double_colon" |
| 1521 |
}, |
| 1522 |
{ |
| 1523 |
"include": "#record_decl" |
| 1524 |
}, |
| 1525 |
{ |
| 1526 |
"include": "#type_signature" |
| 1527 |
} |
| 1528 |
] |
| 1529 |
} |
| 1530 |
] |
| 1531 |
}, |
| 1532 |
"type_application": { |
| 1533 |
"patterns": [ |
| 1534 |
{ |
| 1535 |
"begin": "(?<=[\\s,;\\[\\]{}\"])(@)(')?(\\()", |
| 1536 |
"beginCaptures": { |
| 1537 |
"1": { |
| 1538 |
"name": "keyword.operator.prefix.at.haskell" |
| 1539 |
}, |
| 1540 |
"2": { |
| 1541 |
"name": "keyword.operator.promotion.haskell" |
| 1542 |
}, |
| 1543 |
"3": { |
| 1544 |
"name": "punctuation.paren.haskell" |
| 1545 |
} |
| 1546 |
}, |
| 1547 |
"end": "\\)", |
| 1548 |
"endCaptures": { |
| 1549 |
"0": { |
| 1550 |
"name": "punctuation.paren.haskell" |
| 1551 |
} |
| 1552 |
}, |
| 1553 |
"name": "meta.type-application.haskell", |
| 1554 |
"patterns": [ |
| 1555 |
{ |
| 1556 |
"include": "#type_signature" |
| 1557 |
} |
| 1558 |
] |
| 1559 |
}, |
| 1560 |
{ |
| 1561 |
"begin": "(?<=[\\s,;\\[\\]{}\"])(@)(')?(\\[)", |
| 1562 |
"beginCaptures": { |
| 1563 |
"1": { |
| 1564 |
"name": "keyword.operator.prefix.at.haskell" |
| 1565 |
}, |
| 1566 |
"2": { |
| 1567 |
"name": "keyword.operator.promotion.haskell" |
| 1568 |
}, |
| 1569 |
"3": { |
| 1570 |
"name": "punctuation.bracket.haskell" |
| 1571 |
} |
| 1572 |
}, |
| 1573 |
"end": "\\]", |
| 1574 |
"name": "meta.type-application.haskell", |
| 1575 |
"endCaptures": { |
| 1576 |
"0": { |
| 1577 |
"name": "punctuation.bracket.haskell" |
| 1578 |
} |
| 1579 |
}, |
| 1580 |
"patterns": [ |
| 1581 |
{ |
| 1582 |
"include": "#type_signature" |
| 1583 |
} |
| 1584 |
] |
| 1585 |
}, |
| 1586 |
{ |
| 1587 |
"begin": "(?<=[\\s,;\\[\\]{}\"])(@)(?=\\\")", |
| 1588 |
"beginCaptures": { |
| 1589 |
"1": { |
| 1590 |
"name": "keyword.operator.prefix.at.haskell" |
| 1591 |
} |
| 1592 |
}, |
| 1593 |
"end": "(?<=\\\")", |
| 1594 |
"name": "meta.type-application.haskell", |
| 1595 |
"patterns": [ |
| 1596 |
{ |
| 1597 |
"include": "#string_literal" |
| 1598 |
} |
| 1599 |
] |
| 1600 |
}, |
| 1601 |
{ |
| 1602 |
"begin": "(?<=[\\s,;\\[\\]{}\"])(@)(?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])", |
| 1603 |
"beginCaptures": { |
| 1604 |
"1": { |
| 1605 |
"name": "keyword.operator.prefix.at.haskell" |
| 1606 |
} |
| 1607 |
}, |
| 1608 |
"end": "(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])", |
| 1609 |
"name": "meta.type-application.haskell", |
| 1610 |
"patterns": [ |
| 1611 |
{ |
| 1612 |
"include": "#type_signature" |
| 1613 |
} |
| 1614 |
] |
| 1615 |
} |
| 1616 |
] |
| 1617 |
}, |
| 1618 |
"type_signature": { |
| 1619 |
"patterns": [ |
| 1620 |
{ |
| 1621 |
"include": "#comment_like" |
| 1622 |
}, |
| 1623 |
{ |
| 1624 |
"match": "(')?(\\()\\s*(\\))", |
| 1625 |
"captures": { |
| 1626 |
"1": { |
| 1627 |
"name": "keyword.operator.promotion.haskell" |
| 1628 |
}, |
| 1629 |
"2": { |
| 1630 |
"name": "punctuation.paren.haskell" |
| 1631 |
}, |
| 1632 |
"3": { |
| 1633 |
"name": "punctuation.paren.haskell" |
| 1634 |
} |
| 1635 |
}, |
| 1636 |
"name": "support.constant.unit.haskell" |
| 1637 |
}, |
| 1638 |
{ |
| 1639 |
"match": "(\\()(#)\\s*(#)(\\))", |
| 1640 |
"name": "support.constant.unit.unboxed.haskell", |
| 1641 |
"captures": { |
| 1642 |
"1": { |
| 1643 |
"name": "punctuation.paren.haskell" |
| 1644 |
}, |
| 1645 |
"2": { |
| 1646 |
"name": "keyword.operator.hash.haskell" |
| 1647 |
}, |
| 1648 |
"3": { |
| 1649 |
"name": "keyword.operator.hash.haskell" |
| 1650 |
}, |
| 1651 |
"4": { |
| 1652 |
"name": "punctuation.paren.haskell" |
| 1653 |
} |
| 1654 |
} |
| 1655 |
}, |
| 1656 |
{ |
| 1657 |
"match": "(')?(\\()\\s*,[\\s,]*(\\))", |
| 1658 |
"captures": { |
| 1659 |
"1": { |
| 1660 |
"name": "keyword.operator.promotion.haskell" |
| 1661 |
}, |
| 1662 |
"2": { |
| 1663 |
"name": "punctuation.paren.haskell" |
| 1664 |
}, |
| 1665 |
"3": { |
| 1666 |
"name": "punctuation.paren.haskell" |
| 1667 |
} |
| 1668 |
}, |
| 1669 |
"name": "support.constant.tuple.haskell" |
| 1670 |
}, |
| 1671 |
{ |
| 1672 |
"match": "(\\()(#)\\s*(#)(\\))", |
| 1673 |
"name": "support.constant.unit.unboxed.haskell", |
| 1674 |
"captures": { |
| 1675 |
"1": { |
| 1676 |
"name": "punctuation.paren.haskell" |
| 1677 |
}, |
| 1678 |
"2": { |
| 1679 |
"name": "keyword.operator.hash.haskell" |
| 1680 |
}, |
| 1681 |
"3": { |
| 1682 |
"name": "keyword.operator.hash.haskell" |
| 1683 |
}, |
| 1684 |
"4": { |
| 1685 |
"name": "punctuation.paren.haskell" |
| 1686 |
} |
| 1687 |
} |
| 1688 |
}, |
| 1689 |
{ |
| 1690 |
"match": "(\\()(#)\\s*,[\\s,]*(#)(\\))", |
| 1691 |
"captures": { |
| 1692 |
"1": { |
| 1693 |
"name": "punctuation.paren.haskell" |
| 1694 |
}, |
| 1695 |
"2": { |
| 1696 |
"name": "keyword.operator.hash.haskell" |
| 1697 |
}, |
| 1698 |
"3": { |
| 1699 |
"name": "keyword.operator.hash.haskell" |
| 1700 |
}, |
| 1701 |
"4": { |
| 1702 |
"name": "punctuation.paren.haskell" |
| 1703 |
} |
| 1704 |
}, |
| 1705 |
"name": "support.constant.tuple.unboxed.haskell" |
| 1706 |
}, |
| 1707 |
{ |
| 1708 |
"match": "(')?(\\[)\\s*(\\])", |
| 1709 |
"captures": { |
| 1710 |
"1": { |
| 1711 |
"name": "keyword.operator.promotion.haskell" |
| 1712 |
}, |
| 1713 |
"2": { |
| 1714 |
"name": "punctuation.bracket.haskell" |
| 1715 |
}, |
| 1716 |
"3": { |
| 1717 |
"name": "punctuation.bracket.haskell" |
| 1718 |
} |
| 1719 |
}, |
| 1720 |
"name": "support.constant.empty-list.haskell" |
| 1721 |
}, |
| 1722 |
{ |
| 1723 |
"include": "#integer_literals" |
| 1724 |
}, |
| 1725 |
{ |
| 1726 |
"match": "(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])", |
| 1727 |
"name": "keyword.operator.double-colon.haskell" |
| 1728 |
}, |
| 1729 |
{ |
| 1730 |
"include": "#forall" |
| 1731 |
}, |
| 1732 |
{ |
| 1733 |
"match": "=>|⇒", |
| 1734 |
"name": "keyword.operator.big-arrow.haskell" |
| 1735 |
}, |
| 1736 |
{ |
| 1737 |
"include": "#string_literal" |
| 1738 |
}, |
| 1739 |
{ |
| 1740 |
"match": "'[^']'", |
| 1741 |
"name": "invalid" |
| 1742 |
}, |
| 1743 |
{ |
| 1744 |
"include": "#type_application" |
| 1745 |
}, |
| 1746 |
{ |
| 1747 |
"include": "#reserved_symbol" |
| 1748 |
}, |
| 1749 |
{ |
| 1750 |
"include": "#type_operator" |
| 1751 |
}, |
| 1752 |
{ |
| 1753 |
"include": "#type_constructor" |
| 1754 |
}, |
| 1755 |
{ |
| 1756 |
"begin": "(\\()(#)", |
| 1757 |
"end": "(#)(\\))", |
| 1758 |
"beginCaptures": { |
| 1759 |
"1": { |
| 1760 |
"name": "punctuation.paren.haskell" |
| 1761 |
}, |
| 1762 |
"2": { |
| 1763 |
"name": "keyword.operator.hash.haskell" |
| 1764 |
} |
| 1765 |
}, |
| 1766 |
"endCaptures": { |
| 1767 |
"1": { |
| 1768 |
"name": "keyword.operator.hash.haskell" |
| 1769 |
}, |
| 1770 |
"2": { |
| 1771 |
"name": "punctuation.paren.haskell" |
| 1772 |
} |
| 1773 |
}, |
| 1774 |
"patterns": [ |
| 1775 |
{ |
| 1776 |
"include": "#comma" |
| 1777 |
}, |
| 1778 |
{ |
| 1779 |
"include": "#type_signature" |
| 1780 |
} |
| 1781 |
] |
| 1782 |
}, |
| 1783 |
{ |
| 1784 |
"begin": "(')?(\\()", |
| 1785 |
"end": "(\\))", |
| 1786 |
"beginCaptures": { |
| 1787 |
"1": { |
| 1788 |
"name": "keyword.operator.promotion.haskell" |
| 1789 |
}, |
| 1790 |
"2": { |
| 1791 |
"name": "punctuation.paren.haskell" |
| 1792 |
} |
| 1793 |
}, |
| 1794 |
"endCaptures": { |
| 1795 |
"1": { |
| 1796 |
"name": "punctuation.paren.haskell" |
| 1797 |
} |
| 1798 |
}, |
| 1799 |
"patterns": [ |
| 1800 |
{ |
| 1801 |
"include": "#comma" |
| 1802 |
}, |
| 1803 |
{ |
| 1804 |
"include": "#type_signature" |
| 1805 |
} |
| 1806 |
] |
| 1807 |
}, |
| 1808 |
{ |
| 1809 |
"begin": "(')?(\\[)", |
| 1810 |
"end": "(\\])", |
| 1811 |
"beginCaptures": { |
| 1812 |
"1": { |
| 1813 |
"name": "keyword.operator.promotion.haskell" |
| 1814 |
}, |
| 1815 |
"2": { |
| 1816 |
"name": "punctuation.bracket.haskell" |
| 1817 |
} |
| 1818 |
}, |
| 1819 |
"endCaptures": { |
| 1820 |
"1": { |
| 1821 |
"name": "punctuation.bracket.haskell" |
| 1822 |
} |
| 1823 |
}, |
| 1824 |
"patterns": [ |
| 1825 |
{ |
| 1826 |
"include": "#comma" |
| 1827 |
}, |
| 1828 |
{ |
| 1829 |
"include": "#type_signature" |
| 1830 |
} |
| 1831 |
] |
| 1832 |
}, |
| 1833 |
{ |
| 1834 |
"include": "#type_variable" |
| 1835 |
} |
| 1836 |
] |
| 1837 |
}, |
| 1838 |
"double_colon": { |
| 1839 |
"match": "\\s*(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\\s*", |
| 1840 |
"captures": { |
| 1841 |
"1": { |
| 1842 |
"name": "keyword.operator.double-colon.haskell" |
| 1843 |
} |
| 1844 |
} |
| 1845 |
}, |
| 1846 |
"start_type_signature": { |
| 1847 |
"patterns": [ |
| 1848 |
{ |
| 1849 |
"begin": "^(\\s*)(::|∷)(?![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])\\s*", |
| 1850 |
"beginCaptures": { |
| 1851 |
"2": { |
| 1852 |
"name": "keyword.operator.double-colon.haskell" |
| 1853 |
} |
| 1854 |
}, |
| 1855 |
"end": "(?x)\n # End type annotation when seeing one of:\n (?=\n \\#?\\) # closing parenthesis\n |\\] # closing bracket\n |, # comma\n |(?<!')\\b(in|then|else|of)\\b(?!') # keyword\n | # symbolic keyword except (->)\n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\n (?:\n (\\\\|λ)\n |(<-|←)\n |(=)\n |(-<|↢)\n |(-<<|⤛)\n )\n ([(),;\\[\\]`{}_\"']|[^\\p{S}\\p{P}])\n |(\\#|@)-\\} # End of annotation block (LiquidHaskell or pragma)\n # Decreasing indentation:\n | (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s*\\S # - equally indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n )", |
| 1856 |
"patterns": [ |
| 1857 |
{ |
| 1858 |
"include": "#type_signature" |
| 1859 |
} |
| 1860 |
], |
| 1861 |
"name": "meta.type-declaration.haskell" |
| 1862 |
}, |
| 1863 |
{ |
| 1864 |
"begin": "(?<![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])(::|∷)(?![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])", |
| 1865 |
"beginCaptures": { |
| 1866 |
"1": { |
| 1867 |
"name": "keyword.operator.double-colon.haskell" |
| 1868 |
} |
| 1869 |
}, |
| 1870 |
"end": "(?x)\n # End type annotation when seeing one of:\n (?=\n \\#?\\) # closing parenthesis\n |\\] # closing bracket\n |, # comma\n |\\b(?<!')(in|then|else|of)\\b(?!') # keyword\n |(\\#|@)-\\} # End of annotation block (LiquidHaskell or pragma)\n | # symbolic keyword except (->)\n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\n (?:\n (\\\\|λ)\n |(<-|←)\n |(=)\n |(-<|↢)\n |(-<<|⤛)\n )\n ([(),;\\[\\]`{}_\"']|[^\\p{S}\\p{P}])\n # Indentation \n |(?=\\}|;) # Explicit indentation\n |$ # End of line\n )", |
| 1871 |
"patterns": [ |
| 1872 |
{ |
| 1873 |
"include": "#type_signature" |
| 1874 |
} |
| 1875 |
] |
| 1876 |
} |
| 1877 |
] |
| 1878 |
}, |
| 1879 |
"type_variable": { |
| 1880 |
"match": "\\b(?<!')(?!(?:forall|deriving)\\b(?!'))[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", |
| 1881 |
"name": "variable.other.generic-type.haskell" |
| 1882 |
}, |
| 1883 |
"type_constructor": { |
| 1884 |
"patterns": [ |
| 1885 |
{ |
| 1886 |
"match": "(?x)\n # Optional promotion tick\n (')?\n # Optional qualified name\n ((?:\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)\n # Type constructor proper\n (\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)", |
| 1887 |
"captures": { |
| 1888 |
"1": { |
| 1889 |
"name": "keyword.operator.promotion.haskell" |
| 1890 |
}, |
| 1891 |
"2": { |
| 1892 |
"name": "entity.name.namespace.haskell" |
| 1893 |
}, |
| 1894 |
"3": { |
| 1895 |
"name": "storage.type.haskell" |
| 1896 |
} |
| 1897 |
} |
| 1898 |
}, |
| 1899 |
{ |
| 1900 |
"match": "(?x)\n # Optional promotion tick\n (')?\n # Opening parenthesis\n (\\()\\s*\n # Optional qualified name\n ((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)\n # Type operator proper\n ([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\n # Closing parenthesis\n \\s*(\\))", |
| 1901 |
"captures": { |
| 1902 |
"1": { |
| 1903 |
"name": "keyword.operator.promotion.haskell" |
| 1904 |
}, |
| 1905 |
"2": { |
| 1906 |
"name": "punctuation.paren.haskell" |
| 1907 |
}, |
| 1908 |
"3": { |
| 1909 |
"name": "entity.name.namespace.haskell" |
| 1910 |
}, |
| 1911 |
"4": { |
| 1912 |
"name": "storage.type.operator.haskell" |
| 1913 |
}, |
| 1914 |
"5": { |
| 1915 |
"name": "punctuation.paren.haskell" |
| 1916 |
} |
| 1917 |
} |
| 1918 |
} |
| 1919 |
] |
| 1920 |
}, |
| 1921 |
"overloaded_label": { |
| 1922 |
"patterns": [ |
| 1923 |
{ |
| 1924 |
"match": "(?x) \n (?<![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^(,;\\[`{]]) # Disallow closing characters\n (\\#)\n (?:\n # String\n (\"(?:\\\\\"|[^\"])*\")\n # Sequence of allowed label identifiers\n |[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'\\.]+\n )", |
| 1925 |
"captures": { |
| 1926 |
"1": { |
| 1927 |
"name": "keyword.operator.prefix.hash.haskell" |
| 1928 |
}, |
| 1929 |
"2": { |
| 1930 |
"patterns": [ |
| 1931 |
{ |
| 1932 |
"include": "#string_literal" |
| 1933 |
} |
| 1934 |
] |
| 1935 |
} |
| 1936 |
}, |
| 1937 |
"name": "entity.name.label.haskell" |
| 1938 |
} |
| 1939 |
] |
| 1940 |
}, |
| 1941 |
"reserved_symbol": { |
| 1942 |
"patterns": [ |
| 1943 |
{ |
| 1944 |
"match": "(?x)\n (?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'']])\n (?:\n (\\.\\.)\n |(:)\n |(=)\n |(\\\\) # λ not reserved as it is a letter\n |(\\|)\n |(<-|←)\n |(->|→)\n |(-<|↢)\n |(-<<|⤛)\n |(>-|⤚)\n |(>>-|⤜)\n |(∀)\n )\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'']])", |
| 1945 |
"captures": { |
| 1946 |
"1": { |
| 1947 |
"name": "keyword.operator.double-dot.haskell" |
| 1948 |
}, |
| 1949 |
"2": { |
| 1950 |
"name": "keyword.operator.colon.haskell" |
| 1951 |
}, |
| 1952 |
"3": { |
| 1953 |
"name": "keyword.operator.eq.haskell" |
| 1954 |
}, |
| 1955 |
"4": { |
| 1956 |
"name": "keyword.operator.lambda.haskell" |
| 1957 |
}, |
| 1958 |
"5": { |
| 1959 |
"name": "keyword.operator.pipe.haskell" |
| 1960 |
}, |
| 1961 |
"6": { |
| 1962 |
"name": "keyword.operator.arrow.left.haskell" |
| 1963 |
}, |
| 1964 |
"7": { |
| 1965 |
"name": "keyword.operator.arrow.haskell" |
| 1966 |
}, |
| 1967 |
"8": { |
| 1968 |
"name": "keyword.operator.arrow.left.tail.haskell" |
| 1969 |
}, |
| 1970 |
"9": { |
| 1971 |
"name": "keyword.operator.arrow.left.tail.double.haskell" |
| 1972 |
}, |
| 1973 |
"10": { |
| 1974 |
"name": "keyword.operator.arrow.tail.haskell" |
| 1975 |
}, |
| 1976 |
"11": { |
| 1977 |
"name": "keyword.operator.arrow.tail.double.haskell" |
| 1978 |
}, |
| 1979 |
"12": { |
| 1980 |
"name": "keyword.other.forall.haskell" |
| 1981 |
} |
| 1982 |
} |
| 1983 |
}, |
| 1984 |
{ |
| 1985 |
"match": "(?x)\n (?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^\\#,;\\[`{]]) # Require closing characters\n (\\#+)\n (?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^),;\\]`}]]) # Disallow opening character", |
| 1986 |
"captures": { |
| 1987 |
"1": { |
| 1988 |
"name": "keyword.operator.postfix.hash.haskell" |
| 1989 |
} |
| 1990 |
} |
| 1991 |
}, |
| 1992 |
{ |
| 1993 |
"match": "(?x)\n (?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\)\\}\\]]) # Require closing characters\n (@)\n (?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\(\\[\\{]) # Require opening character", |
| 1994 |
"captures": { |
| 1995 |
"1": { |
| 1996 |
"name": "keyword.operator.infix.tight.at.haskell" |
| 1997 |
} |
| 1998 |
} |
| 1999 |
}, |
| 2000 |
{ |
| 2001 |
"match": "(?x)\n (?<![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^(,;\\[`{]]) # Disallow closing characters\n (?:(~)|(!)|(-)|(\\$)|(\\$\\$))\n (?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\(\\{\\[]) # Require opening character (non operator symbol)", |
| 2002 |
"captures": { |
| 2003 |
"1": { |
| 2004 |
"name": "keyword.operator.prefix.tilde.haskell" |
| 2005 |
}, |
| 2006 |
"2": { |
| 2007 |
"name": "keyword.operator.prefix.bang.haskell" |
| 2008 |
}, |
| 2009 |
"3": { |
| 2010 |
"name": "keyword.operator.prefix.minus.haskell" |
| 2011 |
}, |
| 2012 |
"4": { |
| 2013 |
"name": "keyword.operator.prefix.dollar.haskell" |
| 2014 |
}, |
| 2015 |
"5": { |
| 2016 |
"name": "keyword.operator.prefix.double-dollar.haskell" |
| 2017 |
} |
| 2018 |
} |
| 2019 |
} |
| 2020 |
] |
| 2021 |
}, |
| 2022 |
"type_operator": { |
| 2023 |
"patterns": [ |
| 2024 |
{ |
| 2025 |
"match": "(?x)\n # Optional promotion tick\n (?:(?<!')('))?\n # Optional qualified name\n ((?:\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)\n # Type operator proper\n (?![#@]?-})(\\#+|[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+(?<!\\#))\n #((?:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']&&[^#@]]|[@#](?!-}))+)", |
| 2026 |
"captures": { |
| 2027 |
"1": { |
| 2028 |
"name": "keyword.operator.promotion.haskell" |
| 2029 |
}, |
| 2030 |
"2": { |
| 2031 |
"name": "entity.name.namespace.haskell" |
| 2032 |
}, |
| 2033 |
"3": { |
| 2034 |
"name": "storage.type.operator.infix.haskell" |
| 2035 |
} |
| 2036 |
} |
| 2037 |
}, |
| 2038 |
{ |
| 2039 |
"match": "(?x)\n # Optional promotion tick\n (')?\n # Opening backtick\n (\\`)\n # Optional qualified name\n ((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)\n # Type constructor proper\n ([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\n # Closing backtick\n (`)", |
| 2040 |
"captures": { |
| 2041 |
"1": { |
| 2042 |
"name": "keyword.operator.promotion.haskell" |
| 2043 |
}, |
| 2044 |
"2": { |
| 2045 |
"name": "punctuation.backtick.haskell" |
| 2046 |
}, |
| 2047 |
"3": { |
| 2048 |
"name": "entity.name.namespace.haskell" |
| 2049 |
}, |
| 2050 |
"4": { |
| 2051 |
"name": "storage.type.infix.haskell" |
| 2052 |
}, |
| 2053 |
"5": { |
| 2054 |
"name": "punctuation.backtick.haskell" |
| 2055 |
} |
| 2056 |
} |
| 2057 |
} |
| 2058 |
] |
| 2059 |
}, |
| 2060 |
"forall": { |
| 2061 |
"begin": "\\b(?<!')(forall|∀)\\b(?!')", |
| 2062 |
"end": "(\\.)|(->|→)", |
| 2063 |
"beginCaptures": { |
| 2064 |
"1": { |
| 2065 |
"name": "keyword.other.forall.haskell" |
| 2066 |
} |
| 2067 |
}, |
| 2068 |
"endCaptures": { |
| 2069 |
"1": { |
| 2070 |
"name": "keyword.operator.period.haskell" |
| 2071 |
}, |
| 2072 |
"2": { |
| 2073 |
"name": "keyword.operator.arrow.haskell" |
| 2074 |
} |
| 2075 |
}, |
| 2076 |
"patterns": [ |
| 2077 |
{ |
| 2078 |
"include": "#comment_like" |
| 2079 |
}, |
| 2080 |
{ |
| 2081 |
"include": "#type_variable" |
| 2082 |
}, |
| 2083 |
{ |
| 2084 |
"include": "#type_signature" |
| 2085 |
} |
| 2086 |
] |
| 2087 |
}, |
| 2088 |
"string_literal": { |
| 2089 |
"begin": "\"", |
| 2090 |
"beginCaptures": { |
| 2091 |
"0": { |
| 2092 |
"name": "punctuation.definition.string.begin.haskell" |
| 2093 |
} |
| 2094 |
}, |
| 2095 |
"end": "\"", |
| 2096 |
"endCaptures": { |
| 2097 |
"0": { |
| 2098 |
"name": "punctuation.definition.string.end.haskell" |
| 2099 |
} |
| 2100 |
}, |
| 2101 |
"name": "string.quoted.double.haskell", |
| 2102 |
"patterns": [ |
| 2103 |
{ |
| 2104 |
"match": "\\\\(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|[abfnrtv\\\\\\\"'\\&])", |
| 2105 |
"name": "constant.character.escape.haskell" |
| 2106 |
}, |
| 2107 |
{ |
| 2108 |
"match": "\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+", |
| 2109 |
"name": "constant.character.escape.octal.haskell" |
| 2110 |
}, |
| 2111 |
{ |
| 2112 |
"match": "\\\\\\^[A-Z@\\[\\]\\\\\\^_]", |
| 2113 |
"name": "constant.character.escape.control.haskell" |
| 2114 |
}, |
| 2115 |
{ |
| 2116 |
"begin": "\\\\\\s", |
| 2117 |
"beginCaptures": { |
| 2118 |
"0": { |
| 2119 |
"name": "constant.character.escape.begin.haskell" |
| 2120 |
} |
| 2121 |
}, |
| 2122 |
"end": "\\\\", |
| 2123 |
"endCaptures": { |
| 2124 |
"0": { |
| 2125 |
"name": "constant.character.escape.end.haskell" |
| 2126 |
} |
| 2127 |
}, |
| 2128 |
"patterns": [ |
| 2129 |
{ |
| 2130 |
"match": "\\S+", |
| 2131 |
"name": "invalid.illegal.character-not-allowed-here.haskell" |
| 2132 |
} |
| 2133 |
] |
| 2134 |
} |
| 2135 |
] |
| 2136 |
}, |
| 2137 |
"char_literal": { |
| 2138 |
"captures": { |
| 2139 |
"1": { |
| 2140 |
"name": "punctuation.definition.string.begin.haskell" |
| 2141 |
}, |
| 2142 |
"2": { |
| 2143 |
"name": "constant.character.escape.haskell" |
| 2144 |
}, |
| 2145 |
"3": { |
| 2146 |
"name": "constant.character.escape.octal.haskell" |
| 2147 |
}, |
| 2148 |
"4": { |
| 2149 |
"name": "constant.character.escape.hexadecimal.haskell" |
| 2150 |
}, |
| 2151 |
"5": { |
| 2152 |
"name": "constant.character.escape.control.haskell" |
| 2153 |
}, |
| 2154 |
"6": { |
| 2155 |
"name": "punctuation.definition.string.end.haskell" |
| 2156 |
} |
| 2157 |
}, |
| 2158 |
"match": "(?x)\n (?<![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])\n (')\n (?:\n [\\ -\\[\\]-~] # Basic Char\n | (\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE\n |DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS\n |US|SP|DEL|[abfnrtv\\\\\\\"'\\\\&])) # Escapes\n | (\\\\o[0-7]+) # Octal Escapes\n | (\\\\x[0-9A-Fa-f]+) # Hexadecimal Escapes\n | (\\\\\\^[A-Z@\\[\\]\\\\\\^_]) # Control Chars\n )\n (')\n", |
| 2159 |
"name": "string.quoted.single.haskell" |
| 2160 |
}, |
| 2161 |
"float_literals": { |
| 2162 |
"comment": "Floats are decimal or hexadecimal", |
| 2163 |
"match": "(?x)\n \\b(?<!')\n (?: # Decimal\n ([0-9][_0-9]*\\.[0-9][_0-9]*(?:[eE][-+]?[0-9][_0-9]*)?\n |[0-9][_0-9]*[eE][-+]?[0-9][_0-9]*\n )\n | # Hexadecimal\n (0[xX]_*[0-9a-fA-F][_0-9a-fA-F]*\\.[0-9a-fA-F][_0-9a-fA-F]*(?:[pP][-+]?[0-9][_0-9]*)?\n |0[xX]_*[0-9a-fA-F][_0-9a-fA-F]*[pP][-+]?[0-9][_0-9]*\n )\n )\\b(?!')", |
| 2164 |
"captures": { |
| 2165 |
"1": { |
| 2166 |
"name": "constant.numeric.floating.decimal.haskell" |
| 2167 |
}, |
| 2168 |
"2": { |
| 2169 |
"name": "constant.numeric.floating.hexadecimal.haskell" |
| 2170 |
} |
| 2171 |
} |
| 2172 |
}, |
| 2173 |
"integer_literals": { |
| 2174 |
"match": "(?x)\n \\b(?<!')\n (?:\n ([0-9][_0-9]*) # Decimal integer\n | (0[xX]_*[0-9a-fA-F][_0-9a-fA-F]*) # Hexadecimal integer\n | (0[oO]_*[0-7][_0-7]*) # Octal integer\n | (0[bB]_*[01][_01]*) # Binary integer\n )\n \\b(?!')", |
| 2175 |
"captures": { |
| 2176 |
"1": { |
| 2177 |
"name": "constant.numeric.integral.decimal.haskell" |
| 2178 |
}, |
| 2179 |
"2": { |
| 2180 |
"name": "constant.numeric.integral.hexadecimal.haskell" |
| 2181 |
}, |
| 2182 |
"3": { |
| 2183 |
"name": "constant.numeric.integral.octal.haskell" |
| 2184 |
}, |
| 2185 |
"4": { |
| 2186 |
"name": "constant.numeric.integral.binary.haskell" |
| 2187 |
} |
| 2188 |
} |
| 2189 |
}, |
| 2190 |
"numeric_literals": { |
| 2191 |
"patterns": [ |
| 2192 |
{ |
| 2193 |
"include": "#float_literals" |
| 2194 |
}, |
| 2195 |
{ |
| 2196 |
"include": "#integer_literals" |
| 2197 |
} |
| 2198 |
] |
| 2199 |
}, |
| 2200 |
"ffi": { |
| 2201 |
"begin": "^(\\s*)(foreign)\\s+(import|export)\\s+", |
| 2202 |
"beginCaptures": { |
| 2203 |
"2": { |
| 2204 |
"name": "keyword.other.foreign.haskell" |
| 2205 |
}, |
| 2206 |
"3": { |
| 2207 |
"name": "keyword.other.$3.haskell" |
| 2208 |
} |
| 2209 |
}, |
| 2210 |
"name": "meta.$3.foreign.haskell", |
| 2211 |
"end": "(?x) # Detect end of FFI block by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n", |
| 2212 |
"patterns": [ |
| 2213 |
{ |
| 2214 |
"include": "#comment_like" |
| 2215 |
}, |
| 2216 |
{ |
| 2217 |
"match": "\\b(?<!')(ccall|cplusplus|dotnet|jvm|stdcall|prim|capi)\\s+", |
| 2218 |
"captures": { |
| 2219 |
"1": { |
| 2220 |
"name": "keyword.other.calling-convention.$1.haskell" |
| 2221 |
} |
| 2222 |
} |
| 2223 |
}, |
| 2224 |
{ |
| 2225 |
"begin": "(?=\")|(?=\\b(?<!')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\b(?!'))", |
| 2226 |
"end": "(?=(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))", |
| 2227 |
"patterns": [ |
| 2228 |
{ |
| 2229 |
"include": "#comment_like" |
| 2230 |
}, |
| 2231 |
{ |
| 2232 |
"match": "(?x)\n \\b(?<!')(safe|unsafe|interruptible)\\b(?!')\n \\s*\n (\"(?:\\\\\"|[^\"])*\")?\n \\s*\n (?:\n (?:\\b(?<!'')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\b(?!'))\n |(?:\\(\\s*(?!--+\\))([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*\\))\n )\n", |
| 2233 |
"captures": { |
| 2234 |
"1": { |
| 2235 |
"name": "keyword.other.safety.$1.haskell" |
| 2236 |
}, |
| 2237 |
"2": { |
| 2238 |
"name": "entity.name.foreign.haskell", |
| 2239 |
"patterns": [ |
| 2240 |
{ |
| 2241 |
"include": "#string_literal" |
| 2242 |
} |
| 2243 |
] |
| 2244 |
}, |
| 2245 |
"3": { |
| 2246 |
"name": "entity.name.function.haskell" |
| 2247 |
}, |
| 2248 |
"4": { |
| 2249 |
"name": "entity.name.function.infix.haskell" |
| 2250 |
} |
| 2251 |
} |
| 2252 |
}, |
| 2253 |
{ |
| 2254 |
"match": "(?x)\n \\b(?<!')(safe|unsafe|interruptible)\\b(?!')\n \\s*\n (\"(?:\\\\\"|[^\"])*\")?\n \\s*$\n", |
| 2255 |
"captures": { |
| 2256 |
"1": { |
| 2257 |
"name": "keyword.other.safety.$1.haskell" |
| 2258 |
}, |
| 2259 |
"2": { |
| 2260 |
"name": "entity.name.foreign.haskell", |
| 2261 |
"patterns": [ |
| 2262 |
{ |
| 2263 |
"include": "#string_literal" |
| 2264 |
} |
| 2265 |
] |
| 2266 |
} |
| 2267 |
} |
| 2268 |
}, |
| 2269 |
{ |
| 2270 |
"match": "(?x)\n \"(?:\\\\\"|[^\"])*\"", |
| 2271 |
"captures": { |
| 2272 |
"0": { |
| 2273 |
"name": "entity.name.foreign.haskell", |
| 2274 |
"patterns": [ |
| 2275 |
{ |
| 2276 |
"include": "#string_literal" |
| 2277 |
} |
| 2278 |
] |
| 2279 |
} |
| 2280 |
} |
| 2281 |
}, |
| 2282 |
{ |
| 2283 |
"match": "(?x)\n (?:\\b(?<!'')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\b(?!'))\n |(?:(\\()\\s*(?!--+\\))([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\)))\n", |
| 2284 |
"captures": { |
| 2285 |
"1": { |
| 2286 |
"name": "entity.name.function.haskell" |
| 2287 |
}, |
| 2288 |
"2": { |
| 2289 |
"name": "punctuation.paren.haskell" |
| 2290 |
}, |
| 2291 |
"3": { |
| 2292 |
"name": "entity.name.function.infix.haskell" |
| 2293 |
}, |
| 2294 |
"4": { |
| 2295 |
"name": "punctuation.paren.haskell" |
| 2296 |
} |
| 2297 |
} |
| 2298 |
} |
| 2299 |
] |
| 2300 |
}, |
| 2301 |
{ |
| 2302 |
"include": "#double_colon" |
| 2303 |
}, |
| 2304 |
{ |
| 2305 |
"include": "#type_signature" |
| 2306 |
} |
| 2307 |
] |
| 2308 |
}, |
| 2309 |
"inline_phase": { |
| 2310 |
"begin": "\\[", |
| 2311 |
"beginCaptures": { |
| 2312 |
"0": { |
| 2313 |
"name": "punctuation.bracket.haskell" |
| 2314 |
} |
| 2315 |
}, |
| 2316 |
"end": "\\]", |
| 2317 |
"endCaptures": { |
| 2318 |
"0": { |
| 2319 |
"name": "punctuation.bracket.haskell" |
| 2320 |
} |
| 2321 |
}, |
| 2322 |
"name": "meta.inlining-phase.haskell", |
| 2323 |
"patterns": [ |
| 2324 |
{ |
| 2325 |
"match": "~", |
| 2326 |
"name": "punctuation.tilde.haskell" |
| 2327 |
}, |
| 2328 |
{ |
| 2329 |
"include": "#integer_literals" |
| 2330 |
}, |
| 2331 |
{ |
| 2332 |
"match": "\\w*", |
| 2333 |
"name": "invalid" |
| 2334 |
} |
| 2335 |
] |
| 2336 |
}, |
| 2337 |
"quasi_quote": { |
| 2338 |
"patterns": [ |
| 2339 |
{ |
| 2340 |
"begin": "(?x)\n (\\[)\n (e|d|p)?\n (\\|\\|?)", |
| 2341 |
"beginCaptures": { |
| 2342 |
"1": { |
| 2343 |
"name": "keyword.operator.quasi-quotation.begin.haskell" |
| 2344 |
}, |
| 2345 |
"2": { |
| 2346 |
"name": "entity.name.quasi-quoter.haskell" |
| 2347 |
}, |
| 2348 |
"3": { |
| 2349 |
"name": "keyword.operator.quasi-quotation.begin.haskell" |
| 2350 |
} |
| 2351 |
}, |
| 2352 |
"end": "\\3\\]", |
| 2353 |
"endCaptures": { |
| 2354 |
"0": { |
| 2355 |
"name": "keyword.operator.quasi-quotation.end.haskell" |
| 2356 |
} |
| 2357 |
}, |
| 2358 |
"name": "meta.quasi-quotation.haskell", |
| 2359 |
"patterns": [ |
| 2360 |
{ |
| 2361 |
"include": "$self" |
| 2362 |
} |
| 2363 |
] |
| 2364 |
}, |
| 2365 |
{ |
| 2366 |
"begin": "(?x)\n (\\[)\n (t)\n (\\|\\|?)", |
| 2367 |
"beginCaptures": { |
| 2368 |
"1": { |
| 2369 |
"name": "keyword.operator.quasi-quotation.begin.haskell" |
| 2370 |
}, |
| 2371 |
"2": { |
| 2372 |
"name": "entity.name.quasi-quoter.haskell" |
| 2373 |
}, |
| 2374 |
"3": { |
| 2375 |
"name": "keyword.operator.quasi-quotation.begin.haskell" |
| 2376 |
} |
| 2377 |
}, |
| 2378 |
"end": "\\3\\]", |
| 2379 |
"endCaptures": { |
| 2380 |
"0": { |
| 2381 |
"name": "keyword.operator.quasi-quotation.end.haskell" |
| 2382 |
} |
| 2383 |
}, |
| 2384 |
"name": "meta.quasi-quotation.haskell", |
| 2385 |
"patterns": [ |
| 2386 |
{ |
| 2387 |
"include": "#type_signature" |
| 2388 |
} |
| 2389 |
] |
| 2390 |
}, |
| 2391 |
{ |
| 2392 |
"begin": "(?x)\n (\\[)\n (?:(\\$\\$)|(\\$))?\n ((?:[^\\s\\p{S}\\p{P}]|[\\.'_])*)\n (\\|\\|?)", |
| 2393 |
"beginCaptures": { |
| 2394 |
"1": { |
| 2395 |
"name": "keyword.operator.quasi-quotation.begin.haskell" |
| 2396 |
}, |
| 2397 |
"2": { |
| 2398 |
"name": "keyword.operator.prefix.double-dollar.haskell" |
| 2399 |
}, |
| 2400 |
"3": { |
| 2401 |
"name": "keyword.operator.prefix.dollar.haskell" |
| 2402 |
}, |
| 2403 |
"4": { |
| 2404 |
"patterns": [ |
| 2405 |
{ |
| 2406 |
"include": "#qualifier" |
| 2407 |
} |
| 2408 |
], |
| 2409 |
"name": "entity.name.quasi-quoter.haskell" |
| 2410 |
}, |
| 2411 |
"5": { |
| 2412 |
"name": "keyword.operator.quasi-quotation.begin.haskell" |
| 2413 |
} |
| 2414 |
}, |
| 2415 |
"end": "\\5\\]", |
| 2416 |
"endCaptures": { |
| 2417 |
"0": { |
| 2418 |
"name": "keyword.operator.quasi-quotation.end.haskell" |
| 2419 |
} |
| 2420 |
}, |
| 2421 |
"name": "meta.quasi-quotation.haskell" |
| 2422 |
} |
| 2423 |
] |
| 2424 |
} |
| 2425 |
}, |
| 2426 |
"scopeName": "source.haskell", |
| 2427 |
"uuid": "5C034675-1F6D-497E-8073-369D37E2FD7D" |
| 2428 |
} |
| 2429 |
|