| 1 |
{ |
| 2 |
"fileTypes": ["purs"], |
| 3 |
"name": "purescript", |
| 4 |
"scopeName": "source.purescript", |
| 5 |
"macros": { |
| 6 |
"functionNameOne": "[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", |
| 7 |
"classNameOne": "[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", |
| 8 |
"functionName": "(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", |
| 9 |
"className": "[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*", |
| 10 |
"operatorChar": "[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]", |
| 11 |
"operator": "[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+", |
| 12 |
"operatorFun": "(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+\\))", |
| 13 |
"character": "(?:[ -\\[\\]-~]|(\\\\(?: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\\\\\\\"'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))", |
| 14 |
"classConstraint": "(?:(?:([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s+)(?:(?<classConstraint>(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(?:\\s*(?:\\s+)\\s*\\g<classConstraint>)?)))", |
| 15 |
"functionTypeDeclaration": "([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\s*(::|∷)", |
| 16 |
"ctorArgs": "(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?:[\\w()'→⇒\\[\\],]|->|=>)+\\s*)+)", |
| 17 |
"ctor": "(?:(?:\\b([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s+)(?:(?<ctorArgs>(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?:[\\w()'→⇒\\[\\],]|->|=>)+\\s*)+))(?:\\s*(?:\\s+)\\s*\\g<ctorArgs>)?)?))", |
| 18 |
"typeDecl": ".+?", |
| 19 |
"indentChar": "[ \\t]", |
| 20 |
"indentBlockEnd": "^(?!\\1[ \\t]|[ \\t]*$)", |
| 21 |
"maybeBirdTrack": "^" |
| 22 |
}, |
| 23 |
"patterns": [ |
| 24 |
{ |
| 25 |
"name": "keyword.operator.function.infix.purescript", |
| 26 |
"match": "(`)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(`)", |
| 27 |
"captures": { |
| 28 |
"1": { |
| 29 |
"name": "punctuation.definition.entity.purescript" |
| 30 |
}, |
| 31 |
"2": { |
| 32 |
"name": "punctuation.definition.entity.purescript" |
| 33 |
} |
| 34 |
} |
| 35 |
}, |
| 36 |
{ |
| 37 |
"name": "meta.declaration.module.purescript", |
| 38 |
"begin": "^\\s*\\b(module)(?!')\\b", |
| 39 |
"end": "(where)", |
| 40 |
"beginCaptures": { |
| 41 |
"1": { |
| 42 |
"name": "keyword.other.purescript" |
| 43 |
} |
| 44 |
}, |
| 45 |
"endCaptures": { |
| 46 |
"1": { |
| 47 |
"name": "keyword.other.purescript" |
| 48 |
} |
| 49 |
}, |
| 50 |
"patterns": [ |
| 51 |
{ |
| 52 |
"include": "#comments" |
| 53 |
}, |
| 54 |
{ |
| 55 |
"include": "#module_name" |
| 56 |
}, |
| 57 |
{ |
| 58 |
"include": "#module_exports" |
| 59 |
}, |
| 60 |
{ |
| 61 |
"name": "invalid.purescript", |
| 62 |
"match": "[a-z]+" |
| 63 |
} |
| 64 |
] |
| 65 |
}, |
| 66 |
{ |
| 67 |
"name": "meta.declaration.typeclass.purescript", |
| 68 |
"begin": "^\\s*\\b(class)(?!')\\b", |
| 69 |
"end": "\\b(where)\\b|$", |
| 70 |
"beginCaptures": { |
| 71 |
"1": { |
| 72 |
"name": "storage.type.class.purescript" |
| 73 |
} |
| 74 |
}, |
| 75 |
"endCaptures": { |
| 76 |
"1": { |
| 77 |
"name": "keyword.other.purescript" |
| 78 |
} |
| 79 |
}, |
| 80 |
"patterns": [ |
| 81 |
{ |
| 82 |
"include": "#type_signature" |
| 83 |
} |
| 84 |
] |
| 85 |
}, |
| 86 |
{ |
| 87 |
"name": "meta.declaration.instance.purescript", |
| 88 |
"begin": "^\\s*\\b(else\\s+)?(derive\\s+)?(newtype\\s+)?(instance)(?!')\\b", |
| 89 |
"end": "\\b(where)\\b|$", |
| 90 |
"contentName": "meta.type-signature.purescript", |
| 91 |
"beginCaptures": { |
| 92 |
"1": { |
| 93 |
"name": "keyword.other.purescript" |
| 94 |
}, |
| 95 |
"2": { |
| 96 |
"name": "keyword.other.purescript" |
| 97 |
}, |
| 98 |
"3": { |
| 99 |
"name": "keyword.other.purescript" |
| 100 |
}, |
| 101 |
"4": { |
| 102 |
"name": "keyword.other.purescript" |
| 103 |
} |
| 104 |
}, |
| 105 |
"endCaptures": { |
| 106 |
"1": { |
| 107 |
"name": "keyword.other.purescript" |
| 108 |
} |
| 109 |
}, |
| 110 |
"patterns": [ |
| 111 |
{ |
| 112 |
"include": "#type_signature" |
| 113 |
} |
| 114 |
] |
| 115 |
}, |
| 116 |
{ |
| 117 |
"name": "meta.foreign.data.purescript", |
| 118 |
"begin": "^(\\s*)(foreign)\\s+(import)\\s+(data)\\s+([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)", |
| 119 |
"end": "^(?!\\1[ \\t]|[ \\t]*$)", |
| 120 |
"contentName": "meta.kind-signature.purescript", |
| 121 |
"beginCaptures": { |
| 122 |
"2": { |
| 123 |
"name": "keyword.other.purescript" |
| 124 |
}, |
| 125 |
"3": { |
| 126 |
"name": "keyword.other.purescript" |
| 127 |
}, |
| 128 |
"4": { |
| 129 |
"name": "keyword.other.purescript" |
| 130 |
}, |
| 131 |
"5": { |
| 132 |
"name": "entity.name.type.purescript" |
| 133 |
}, |
| 134 |
"6": { |
| 135 |
"name": "keyword.other.double-colon.purescript" |
| 136 |
} |
| 137 |
}, |
| 138 |
"patterns": [ |
| 139 |
{ |
| 140 |
"include": "#double_colon" |
| 141 |
}, |
| 142 |
{ |
| 143 |
"include": "#kind_signature" |
| 144 |
} |
| 145 |
] |
| 146 |
}, |
| 147 |
{ |
| 148 |
"name": "meta.foreign.purescript", |
| 149 |
"begin": "^(\\s*)(foreign)\\s+(import)\\s+([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)", |
| 150 |
"end": "^(?!\\1[ \\t]|[ \\t]*$)", |
| 151 |
"contentName": "meta.type-signature.purescript", |
| 152 |
"beginCaptures": { |
| 153 |
"2": { |
| 154 |
"name": "keyword.other.purescript" |
| 155 |
}, |
| 156 |
"3": { |
| 157 |
"name": "keyword.other.purescript" |
| 158 |
}, |
| 159 |
"4": { |
| 160 |
"name": "entity.name.function.purescript" |
| 161 |
} |
| 162 |
}, |
| 163 |
"patterns": [ |
| 164 |
{ |
| 165 |
"include": "#double_colon" |
| 166 |
}, |
| 167 |
{ |
| 168 |
"include": "#type_signature" |
| 169 |
} |
| 170 |
] |
| 171 |
}, |
| 172 |
{ |
| 173 |
"name": "meta.import.purescript", |
| 174 |
"begin": "^\\s*\\b(import)(?!')\\b", |
| 175 |
"end": "($|(?=--))", |
| 176 |
"beginCaptures": { |
| 177 |
"1": { |
| 178 |
"name": "keyword.other.purescript" |
| 179 |
} |
| 180 |
}, |
| 181 |
"patterns": [ |
| 182 |
{ |
| 183 |
"include": "#module_name" |
| 184 |
}, |
| 185 |
{ |
| 186 |
"include": "#module_exports" |
| 187 |
}, |
| 188 |
{ |
| 189 |
"match": "\\b(as|hiding)\\b", |
| 190 |
"captures": { |
| 191 |
"1": { |
| 192 |
"name": "keyword.other.purescript" |
| 193 |
} |
| 194 |
} |
| 195 |
} |
| 196 |
] |
| 197 |
}, |
| 198 |
{ |
| 199 |
"name": "meta.declaration.type.data.purescript", |
| 200 |
"begin": "^(\\s)*(data|newtype)\\s+(.+?)\\s*(?=\\=|$)", |
| 201 |
"end": "^(?!\\1[ \\t]|[ \\t]*$)", |
| 202 |
"beginCaptures": { |
| 203 |
"2": { |
| 204 |
"name": "storage.type.data.purescript" |
| 205 |
}, |
| 206 |
"3": { |
| 207 |
"name": "meta.type-signature.purescript", |
| 208 |
"patterns": [ |
| 209 |
{ |
| 210 |
"include": "#type_signature" |
| 211 |
} |
| 212 |
] |
| 213 |
} |
| 214 |
}, |
| 215 |
"patterns": [ |
| 216 |
{ |
| 217 |
"include": "#comments" |
| 218 |
}, |
| 219 |
{ |
| 220 |
"match": "=", |
| 221 |
"captures": { |
| 222 |
"0": { |
| 223 |
"name": "keyword.operator.assignment.purescript" |
| 224 |
} |
| 225 |
} |
| 226 |
}, |
| 227 |
{ |
| 228 |
"match": "(?:(?:\\b([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s+)(?:(?<ctorArgs>(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?:[\\w()'→⇒\\[\\],]|->|=>)+\\s*)+))(?:\\s*(?:\\s+)\\s*\\g<ctorArgs>)?)?))", |
| 229 |
"captures": { |
| 230 |
"1": { |
| 231 |
"patterns": [ |
| 232 |
{ |
| 233 |
"include": "#data_ctor" |
| 234 |
} |
| 235 |
] |
| 236 |
}, |
| 237 |
"2": { |
| 238 |
"name": "meta.type-signature.purescript", |
| 239 |
"patterns": [ |
| 240 |
{ |
| 241 |
"include": "#type_signature" |
| 242 |
} |
| 243 |
] |
| 244 |
} |
| 245 |
} |
| 246 |
}, |
| 247 |
{ |
| 248 |
"match": "\\|", |
| 249 |
"captures": { |
| 250 |
"0": { |
| 251 |
"name": "punctuation.separator.pipe.purescript" |
| 252 |
} |
| 253 |
} |
| 254 |
}, |
| 255 |
{ |
| 256 |
"include": "#record_types" |
| 257 |
} |
| 258 |
] |
| 259 |
}, |
| 260 |
{ |
| 261 |
"name": "meta.declaration.type.type.purescript", |
| 262 |
"begin": "^(\\s)*(type)\\s+(.+?)\\s*(?=\\=|$)", |
| 263 |
"end": "^(?!\\1[ \\t]|[ \\t]*$)", |
| 264 |
"contentName": "meta.type-signature.purescript", |
| 265 |
"beginCaptures": { |
| 266 |
"2": { |
| 267 |
"name": "storage.type.data.purescript" |
| 268 |
}, |
| 269 |
"3": { |
| 270 |
"name": "meta.type-signature.purescript", |
| 271 |
"patterns": [ |
| 272 |
{ |
| 273 |
"include": "#type_signature" |
| 274 |
} |
| 275 |
] |
| 276 |
} |
| 277 |
}, |
| 278 |
"patterns": [ |
| 279 |
{ |
| 280 |
"match": "=", |
| 281 |
"captures": { |
| 282 |
"0": { |
| 283 |
"name": "keyword.operator.assignment.purescript" |
| 284 |
} |
| 285 |
} |
| 286 |
}, |
| 287 |
{ |
| 288 |
"include": "#type_signature" |
| 289 |
}, |
| 290 |
{ |
| 291 |
"include": "#record_types" |
| 292 |
}, |
| 293 |
{ |
| 294 |
"include": "#comments" |
| 295 |
} |
| 296 |
] |
| 297 |
}, |
| 298 |
{ |
| 299 |
"name": "keyword.other.purescript", |
| 300 |
"match": "^\\s*\\b(derive|where|data|type|newtype|infix[lr]?|foreign(\\s+import)?(\\s+data)?)(?!')\\b" |
| 301 |
}, |
| 302 |
{ |
| 303 |
"name": "entity.name.function.typed-hole.purescript", |
| 304 |
"match": "\\?(?:[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)" |
| 305 |
}, |
| 306 |
{ |
| 307 |
"name": "storage.type.purescript", |
| 308 |
"match": "^\\s*\\b(data|type|newtype)(?!')\\b" |
| 309 |
}, |
| 310 |
{ |
| 311 |
"name": "keyword.control.purescript", |
| 312 |
"match": "\\b(do|ado|if|then|else|case|of|let|in)(?!('|\\s*(:|=)))\\b" |
| 313 |
}, |
| 314 |
{ |
| 315 |
"name": "constant.numeric.hex.purescript", |
| 316 |
"match": "\\b(?<!\\$)0(x|X)[0-9a-fA-F]+\\b(?!\\$)" |
| 317 |
}, |
| 318 |
{ |
| 319 |
"name": "constant.numeric.decimal.purescript", |
| 320 |
"match": "(?x)\n(?<!\\$)(?:\n (?:\\b[0-9]+(\\.)[0-9]+[eE][+-]?[0-9]+\\b)| # 1.1E+3\n (?:\\b[0-9]+[eE][+-]?[0-9]+\\b)| # 1E+3\n (?:\\b[0-9]+(\\.)[0-9]+\\b)| # 1.1\n (?:\\b[0-9]+\\b(?!\\.)) # 1\n)(?!\\$)", |
| 321 |
"captures": { |
| 322 |
"0": { |
| 323 |
"name": "constant.numeric.decimal.purescript" |
| 324 |
}, |
| 325 |
"1": { |
| 326 |
"name": "meta.delimiter.decimal.period.purescript" |
| 327 |
}, |
| 328 |
"2": { |
| 329 |
"name": "meta.delimiter.decimal.period.purescript" |
| 330 |
}, |
| 331 |
"3": { |
| 332 |
"name": "meta.delimiter.decimal.period.purescript" |
| 333 |
}, |
| 334 |
"4": { |
| 335 |
"name": "meta.delimiter.decimal.period.purescript" |
| 336 |
}, |
| 337 |
"5": { |
| 338 |
"name": "meta.delimiter.decimal.period.purescript" |
| 339 |
}, |
| 340 |
"6": { |
| 341 |
"name": "meta.delimiter.decimal.period.purescript" |
| 342 |
} |
| 343 |
} |
| 344 |
}, |
| 345 |
{ |
| 346 |
"name": "constant.language.boolean.purescript", |
| 347 |
"match": "\\b(true|false)\\b" |
| 348 |
}, |
| 349 |
{ |
| 350 |
"name": "constant.numeric.purescript", |
| 351 |
"match": "\\b(([0-9]+_?)*[0-9]+|0([xX][0-9a-fA-F]+|[oO][0-7]+))\\b" |
| 352 |
}, |
| 353 |
{ |
| 354 |
"name": "string.quoted.triple.purescript", |
| 355 |
"begin": "\"\"\"", |
| 356 |
"end": "\"\"\"", |
| 357 |
"beginCaptures": { |
| 358 |
"0": { |
| 359 |
"name": "punctuation.definition.string.begin.purescript" |
| 360 |
} |
| 361 |
}, |
| 362 |
"endCaptures": { |
| 363 |
"0": { |
| 364 |
"name": "punctuation.definition.string.end.purescript" |
| 365 |
} |
| 366 |
} |
| 367 |
}, |
| 368 |
{ |
| 369 |
"name": "string.quoted.double.purescript", |
| 370 |
"begin": "\"", |
| 371 |
"end": "\"", |
| 372 |
"beginCaptures": { |
| 373 |
"0": { |
| 374 |
"name": "punctuation.definition.string.begin.purescript" |
| 375 |
} |
| 376 |
}, |
| 377 |
"endCaptures": { |
| 378 |
"0": { |
| 379 |
"name": "punctuation.definition.string.end.purescript" |
| 380 |
} |
| 381 |
}, |
| 382 |
"patterns": [ |
| 383 |
{ |
| 384 |
"include": "#characters" |
| 385 |
}, |
| 386 |
{ |
| 387 |
"begin": "\\\\\\s", |
| 388 |
"end": "\\\\", |
| 389 |
"beginCaptures": { |
| 390 |
"0": { |
| 391 |
"name": "markup.other.escape.newline.begin.purescript" |
| 392 |
} |
| 393 |
}, |
| 394 |
"endCaptures": { |
| 395 |
"0": { |
| 396 |
"name": "markup.other.escape.newline.end.purescript" |
| 397 |
} |
| 398 |
}, |
| 399 |
"patterns": [ |
| 400 |
{ |
| 401 |
"match": "\\S+", |
| 402 |
"name": "invalid.illegal.character-not-allowed-here.purescript" |
| 403 |
} |
| 404 |
] |
| 405 |
} |
| 406 |
] |
| 407 |
}, |
| 408 |
{ |
| 409 |
"name": "markup.other.escape.newline.purescript", |
| 410 |
"match": "\\\\$" |
| 411 |
}, |
| 412 |
{ |
| 413 |
"name": "string.quoted.single.purescript", |
| 414 |
"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\\\\\\\"'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_])))(')", |
| 415 |
"captures": { |
| 416 |
"1": { |
| 417 |
"name": "punctuation.definition.string.begin.purescript" |
| 418 |
}, |
| 419 |
"2": { |
| 420 |
"patterns": [ |
| 421 |
{ |
| 422 |
"include": "#characters" |
| 423 |
} |
| 424 |
] |
| 425 |
}, |
| 426 |
"7": { |
| 427 |
"name": "punctuation.definition.string.end.purescript" |
| 428 |
} |
| 429 |
} |
| 430 |
}, |
| 431 |
{ |
| 432 |
"include": "#function_type_declaration" |
| 433 |
}, |
| 434 |
{ |
| 435 |
"match": "\\((?<paren>(?:[^()]|\\(\\g<paren>\\))*)(::|∷)(?<paren2>(?:[^()]|\\(\\g<paren2>\\))*)\\)", |
| 436 |
"captures": { |
| 437 |
"1": { |
| 438 |
"patterns": [ |
| 439 |
{ |
| 440 |
"include": "$self" |
| 441 |
} |
| 442 |
] |
| 443 |
}, |
| 444 |
"2": { |
| 445 |
"name": "keyword.other.double-colon.purescript" |
| 446 |
}, |
| 447 |
"3": { |
| 448 |
"name": "meta.type-signature.purescript", |
| 449 |
"patterns": [ |
| 450 |
{ |
| 451 |
"include": "#type_signature" |
| 452 |
} |
| 453 |
] |
| 454 |
} |
| 455 |
} |
| 456 |
}, |
| 457 |
{ |
| 458 |
"begin": "^(\\s*)(?:(::|∷))", |
| 459 |
"beginCaptures": { |
| 460 |
"2": { |
| 461 |
"name": "keyword.other.double-colon.purescript" |
| 462 |
} |
| 463 |
}, |
| 464 |
"end": "^(?!\\1[ \\t]*|[ \\t]*$)", |
| 465 |
"patterns": [ |
| 466 |
{ |
| 467 |
"include": "#type_signature" |
| 468 |
} |
| 469 |
] |
| 470 |
}, |
| 471 |
{ |
| 472 |
"include": "#data_ctor" |
| 473 |
}, |
| 474 |
{ |
| 475 |
"include": "#comments" |
| 476 |
}, |
| 477 |
{ |
| 478 |
"include": "#infix_op" |
| 479 |
}, |
| 480 |
{ |
| 481 |
"name": "keyword.other.arrow.purescript", |
| 482 |
"match": "\\<-|-\\>" |
| 483 |
}, |
| 484 |
{ |
| 485 |
"name": "keyword.operator.purescript", |
| 486 |
"match": "[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+" |
| 487 |
}, |
| 488 |
{ |
| 489 |
"name": "punctuation.separator.comma.purescript", |
| 490 |
"match": "," |
| 491 |
} |
| 492 |
], |
| 493 |
"repository": { |
| 494 |
"block_comment": { |
| 495 |
"patterns": [ |
| 496 |
{ |
| 497 |
"name": "comment.block.documentation.purescript", |
| 498 |
"begin": "\\{-\\s*\\|", |
| 499 |
"end": "-\\}", |
| 500 |
"applyEndPatternLast": 1, |
| 501 |
"beginCaptures": { |
| 502 |
"0": { |
| 503 |
"name": "punctuation.definition.comment.documentation.purescript" |
| 504 |
} |
| 505 |
}, |
| 506 |
"endCaptures": { |
| 507 |
"0": { |
| 508 |
"name": "punctuation.definition.comment.documentation.purescript" |
| 509 |
} |
| 510 |
}, |
| 511 |
"patterns": [ |
| 512 |
{ |
| 513 |
"include": "#block_comment" |
| 514 |
} |
| 515 |
] |
| 516 |
}, |
| 517 |
{ |
| 518 |
"name": "comment.block.purescript", |
| 519 |
"begin": "\\{-", |
| 520 |
"end": "-\\}", |
| 521 |
"applyEndPatternLast": 1, |
| 522 |
"beginCaptures": { |
| 523 |
"0": { |
| 524 |
"name": "punctuation.definition.comment.purescript" |
| 525 |
} |
| 526 |
}, |
| 527 |
"patterns": [ |
| 528 |
{ |
| 529 |
"include": "#block_comment" |
| 530 |
} |
| 531 |
] |
| 532 |
} |
| 533 |
] |
| 534 |
}, |
| 535 |
"record_types": { |
| 536 |
"patterns": [ |
| 537 |
{ |
| 538 |
"name": "meta.type.record.purescript", |
| 539 |
"begin": "\\{", |
| 540 |
"beginCaptures": { |
| 541 |
"0": { |
| 542 |
"name": "keyword.operator.type.record.begin.purescript" |
| 543 |
} |
| 544 |
}, |
| 545 |
"end": "\\}", |
| 546 |
"endCaptures": { |
| 547 |
"0": { |
| 548 |
"name": "keyword.operator.type.record.end.purescript" |
| 549 |
} |
| 550 |
}, |
| 551 |
"patterns": [ |
| 552 |
{ |
| 553 |
"name": "punctuation.separator.comma.purescript", |
| 554 |
"match": "," |
| 555 |
}, |
| 556 |
{ |
| 557 |
"include": "#record_field_declaration" |
| 558 |
}, |
| 559 |
{ |
| 560 |
"include": "#comments" |
| 561 |
} |
| 562 |
] |
| 563 |
} |
| 564 |
] |
| 565 |
}, |
| 566 |
"comments": { |
| 567 |
"patterns": [ |
| 568 |
{ |
| 569 |
"begin": "(^[ \\t]+)?(?=--+\\s+\\|)", |
| 570 |
"end": "(?!\\G)", |
| 571 |
"beginCaptures": { |
| 572 |
"1": { |
| 573 |
"name": "punctuation.whitespace.comment.leading.purescript" |
| 574 |
} |
| 575 |
}, |
| 576 |
"patterns": [ |
| 577 |
{ |
| 578 |
"name": "comment.line.double-dash.documentation.purescript", |
| 579 |
"begin": "(--+)\\s+(\\|)", |
| 580 |
"end": "\\n", |
| 581 |
"beginCaptures": { |
| 582 |
"1": { |
| 583 |
"name": "punctuation.definition.comment.purescript" |
| 584 |
}, |
| 585 |
"2": { |
| 586 |
"name": "punctuation.definition.comment.documentation.purescript" |
| 587 |
} |
| 588 |
} |
| 589 |
} |
| 590 |
] |
| 591 |
}, |
| 592 |
{ |
| 593 |
"begin": "(^[ \\t]+)?(?=--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))", |
| 594 |
"end": "(?!\\G)", |
| 595 |
"beginCaptures": { |
| 596 |
"1": { |
| 597 |
"name": "punctuation.whitespace.comment.leading.purescript" |
| 598 |
} |
| 599 |
}, |
| 600 |
"patterns": [ |
| 601 |
{ |
| 602 |
"name": "comment.line.double-dash.purescript", |
| 603 |
"begin": "--", |
| 604 |
"end": "\\n", |
| 605 |
"beginCaptures": { |
| 606 |
"0": { |
| 607 |
"name": "punctuation.definition.comment.purescript" |
| 608 |
} |
| 609 |
} |
| 610 |
} |
| 611 |
] |
| 612 |
}, |
| 613 |
{ |
| 614 |
"include": "#block_comment" |
| 615 |
} |
| 616 |
] |
| 617 |
}, |
| 618 |
"characters": { |
| 619 |
"patterns": [ |
| 620 |
{ |
| 621 |
"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\\\\\\\"'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))", |
| 622 |
"captures": { |
| 623 |
"1": { |
| 624 |
"name": "constant.character.escape.purescript" |
| 625 |
}, |
| 626 |
"2": { |
| 627 |
"name": "constant.character.escape.octal.purescript" |
| 628 |
}, |
| 629 |
"3": { |
| 630 |
"name": "constant.character.escape.hexadecimal.purescript" |
| 631 |
}, |
| 632 |
"4": { |
| 633 |
"name": "constant.character.escape.control.purescript" |
| 634 |
} |
| 635 |
} |
| 636 |
} |
| 637 |
] |
| 638 |
}, |
| 639 |
"infix_op": { |
| 640 |
"patterns": [ |
| 641 |
{ |
| 642 |
"name": "entity.name.function.infix.purescript", |
| 643 |
"match": "(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+\\))" |
| 644 |
} |
| 645 |
] |
| 646 |
}, |
| 647 |
"module_exports": { |
| 648 |
"patterns": [ |
| 649 |
{ |
| 650 |
"name": "meta.declaration.exports.purescript", |
| 651 |
"begin": "\\(", |
| 652 |
"end": "\\)", |
| 653 |
"patterns": [ |
| 654 |
{ |
| 655 |
"include": "#comments" |
| 656 |
}, |
| 657 |
{ |
| 658 |
"name": "entity.name.function.purescript", |
| 659 |
"match": "\\b(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*" |
| 660 |
}, |
| 661 |
{ |
| 662 |
"include": "#type_name" |
| 663 |
}, |
| 664 |
{ |
| 665 |
"name": "punctuation.separator.comma.purescript", |
| 666 |
"match": "," |
| 667 |
}, |
| 668 |
{ |
| 669 |
"include": "#infix_op" |
| 670 |
}, |
| 671 |
{ |
| 672 |
"name": "meta.other.constructor-list.purescript", |
| 673 |
"match": "\\(.*?\\)" |
| 674 |
} |
| 675 |
] |
| 676 |
} |
| 677 |
] |
| 678 |
}, |
| 679 |
"module_name": { |
| 680 |
"patterns": [ |
| 681 |
{ |
| 682 |
"name": "support.other.module.purescript", |
| 683 |
"match": "(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)*[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.?" |
| 684 |
} |
| 685 |
] |
| 686 |
}, |
| 687 |
"function_type_declaration": { |
| 688 |
"patterns": [ |
| 689 |
{ |
| 690 |
"name": "meta.function.type-declaration.purescript", |
| 691 |
"begin": "^(\\s*)([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\s*(?:(::|∷)(?!.*<-))", |
| 692 |
"end": "^(?!\\1[ \\t]|[ \\t]*$)", |
| 693 |
"contentName": "meta.type-signature.purescript", |
| 694 |
"beginCaptures": { |
| 695 |
"2": { |
| 696 |
"name": "entity.name.function.purescript" |
| 697 |
}, |
| 698 |
"3": { |
| 699 |
"name": "keyword.other.double-colon.purescript" |
| 700 |
} |
| 701 |
}, |
| 702 |
"patterns": [ |
| 703 |
{ |
| 704 |
"include": "#double_colon" |
| 705 |
}, |
| 706 |
{ |
| 707 |
"include": "#type_signature" |
| 708 |
} |
| 709 |
] |
| 710 |
} |
| 711 |
] |
| 712 |
}, |
| 713 |
"record_field_declaration": { |
| 714 |
"patterns": [ |
| 715 |
{ |
| 716 |
"name": "meta.record-field.type-declaration.purescript", |
| 717 |
"begin": "([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\s*(::|∷)", |
| 718 |
"end": "(?=([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\s*(::|∷)|})", |
| 719 |
"contentName": "meta.type-signature.purescript", |
| 720 |
"beginCaptures": { |
| 721 |
"1": { |
| 722 |
"patterns": [ |
| 723 |
{ |
| 724 |
"name": "entity.other.attribute-name.purescript", |
| 725 |
"match": "(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*" |
| 726 |
} |
| 727 |
] |
| 728 |
}, |
| 729 |
"2": { |
| 730 |
"name": "keyword.other.double-colon.purescript" |
| 731 |
} |
| 732 |
}, |
| 733 |
"patterns": [ |
| 734 |
{ |
| 735 |
"include": "#type_signature" |
| 736 |
}, |
| 737 |
{ |
| 738 |
"include": "#record_types" |
| 739 |
} |
| 740 |
] |
| 741 |
} |
| 742 |
] |
| 743 |
}, |
| 744 |
"kind_signature": { |
| 745 |
"patterns": [ |
| 746 |
{ |
| 747 |
"name": "keyword.other.star.purescript", |
| 748 |
"match": "\\*" |
| 749 |
}, |
| 750 |
{ |
| 751 |
"name": "keyword.other.exclaimation-point.purescript", |
| 752 |
"match": "!" |
| 753 |
}, |
| 754 |
{ |
| 755 |
"name": "keyword.other.pound-sign.purescript", |
| 756 |
"match": "#" |
| 757 |
}, |
| 758 |
{ |
| 759 |
"name": "keyword.other.arrow.purescript", |
| 760 |
"match": "->|→" |
| 761 |
} |
| 762 |
] |
| 763 |
}, |
| 764 |
"type_signature": { |
| 765 |
"patterns": [ |
| 766 |
{ |
| 767 |
"name": "meta.class-constraints.purescript", |
| 768 |
"match": "(?:(?:\\()(?:(?<classConstraints>(?:(?:(?:([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s+)(?:(?<classConstraint>(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(?:\\s*(?:\\s+)\\s*\\g<classConstraint>)?))))(?:\\s*(?:,)\\s*\\g<classConstraints>)?))(?:\\))(?:\\s*(=>|<=|⇐|⇒)))", |
| 769 |
"captures": { |
| 770 |
"1": { |
| 771 |
"patterns": [ |
| 772 |
{ |
| 773 |
"include": "#class_constraint" |
| 774 |
} |
| 775 |
] |
| 776 |
}, |
| 777 |
"4": { |
| 778 |
"name": "keyword.other.big-arrow.purescript" |
| 779 |
} |
| 780 |
} |
| 781 |
}, |
| 782 |
{ |
| 783 |
"name": "meta.class-constraints.purescript", |
| 784 |
"match": "((?:(?:([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s+)(?:(?<classConstraint>(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(?:\\s*(?:\\s+)\\s*\\g<classConstraint>)?))))\\s*(=>|<=|⇐|⇒)", |
| 785 |
"captures": { |
| 786 |
"1": { |
| 787 |
"patterns": [ |
| 788 |
{ |
| 789 |
"include": "#class_constraint" |
| 790 |
} |
| 791 |
] |
| 792 |
}, |
| 793 |
"4": { |
| 794 |
"name": "keyword.other.big-arrow.purescript" |
| 795 |
} |
| 796 |
} |
| 797 |
}, |
| 798 |
{ |
| 799 |
"name": "keyword.other.arrow.purescript", |
| 800 |
"match": "->|→" |
| 801 |
}, |
| 802 |
{ |
| 803 |
"name": "keyword.other.big-arrow.purescript", |
| 804 |
"match": "=>|⇒" |
| 805 |
}, |
| 806 |
{ |
| 807 |
"name": "keyword.other.big-arrow-left.purescript", |
| 808 |
"match": "<=|⇐" |
| 809 |
}, |
| 810 |
{ |
| 811 |
"name": "keyword.other.forall.purescript", |
| 812 |
"match": "forall|∀" |
| 813 |
}, |
| 814 |
{ |
| 815 |
"include": "#generic_type" |
| 816 |
}, |
| 817 |
{ |
| 818 |
"include": "#type_name" |
| 819 |
}, |
| 820 |
{ |
| 821 |
"include": "#comments" |
| 822 |
} |
| 823 |
] |
| 824 |
}, |
| 825 |
"type_name": { |
| 826 |
"patterns": [ |
| 827 |
{ |
| 828 |
"name": "entity.name.type.purescript", |
| 829 |
"match": "\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*" |
| 830 |
} |
| 831 |
] |
| 832 |
}, |
| 833 |
"data_ctor": { |
| 834 |
"patterns": [ |
| 835 |
{ |
| 836 |
"name": "entity.name.tag.purescript", |
| 837 |
"match": "\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*" |
| 838 |
} |
| 839 |
] |
| 840 |
}, |
| 841 |
"generic_type": { |
| 842 |
"patterns": [ |
| 843 |
{ |
| 844 |
"name": "variable.other.generic-type.purescript", |
| 845 |
"match": "\\b(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*" |
| 846 |
} |
| 847 |
] |
| 848 |
}, |
| 849 |
"double_colon": { |
| 850 |
"patterns": [ |
| 851 |
{ |
| 852 |
"name": "keyword.other.double-colon.purescript", |
| 853 |
"match": "(?:::|∷)" |
| 854 |
} |
| 855 |
] |
| 856 |
}, |
| 857 |
"class_constraint": { |
| 858 |
"patterns": [ |
| 859 |
{ |
| 860 |
"name": "meta.class-constraint.purescript", |
| 861 |
"match": "(?:(?:([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s+)(?:(?<classConstraint>(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(?:\\s*(?:\\s+)\\s*\\g<classConstraint>)?)))", |
| 862 |
"captures": { |
| 863 |
"1": { |
| 864 |
"patterns": [ |
| 865 |
{ |
| 866 |
"name": "entity.name.type.purescript", |
| 867 |
"match": "\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*" |
| 868 |
} |
| 869 |
] |
| 870 |
}, |
| 871 |
"2": { |
| 872 |
"patterns": [ |
| 873 |
{ |
| 874 |
"include": "#type_name" |
| 875 |
}, |
| 876 |
{ |
| 877 |
"include": "#generic_type" |
| 878 |
} |
| 879 |
] |
| 880 |
} |
| 881 |
} |
| 882 |
} |
| 883 |
] |
| 884 |
} |
| 885 |
} |
| 886 |
} |
| 887 |
|