tm-grammars 0.0.0

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