@willbooster/tree-sitter-haskell 6.0.1 → 6.0.3
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.
- package/package.json +1 -1
- package/queries/highlights.scm +11 -79
- package/tree-sitter-haskell.wasm +0 -0
- package/tree-sitter.json +1 -1
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
; ----------------------------------------------------------------------------
|
|
2
|
-
; Parameters and variables
|
|
3
1
|
; NOTE: These are at the top, so that they have low priority,
|
|
4
2
|
; and don't override destructured parameters
|
|
5
3
|
(variable) @variable
|
|
6
4
|
|
|
7
5
|
(pattern/wildcard) @variable
|
|
8
6
|
|
|
9
|
-
|
|
10
7
|
(decl/function
|
|
11
8
|
patterns: (patterns
|
|
12
9
|
(_) @variable.parameter))
|
|
@@ -19,8 +16,6 @@
|
|
|
19
16
|
(infix
|
|
20
17
|
(pattern) @variable.parameter))
|
|
21
18
|
|
|
22
|
-
; ----------------------------------------------------------------------------
|
|
23
|
-
; Literals and comments
|
|
24
19
|
(integer) @number
|
|
25
20
|
|
|
26
21
|
(negation) @number
|
|
@@ -32,14 +27,12 @@
|
|
|
32
27
|
|
|
33
28
|
(string) @string
|
|
34
29
|
|
|
35
|
-
(unit) @string.special.symbol
|
|
30
|
+
(unit) @string.special.symbol
|
|
36
31
|
|
|
37
32
|
(comment) @comment
|
|
38
33
|
|
|
39
34
|
((haddock) @comment.documentation)
|
|
40
35
|
|
|
41
|
-
; ----------------------------------------------------------------------------
|
|
42
|
-
; Punctuation
|
|
43
36
|
[
|
|
44
37
|
"("
|
|
45
38
|
")"
|
|
@@ -54,11 +47,8 @@
|
|
|
54
47
|
";"
|
|
55
48
|
] @punctuation.delimiter
|
|
56
49
|
|
|
57
|
-
; ----------------------------------------------------------------------------
|
|
58
|
-
; Keywords, operators, includes
|
|
59
50
|
[
|
|
60
51
|
"forall"
|
|
61
|
-
; "∀" ; utf-8 is not cross-platform safe
|
|
62
52
|
] @keyword.repeat
|
|
63
53
|
|
|
64
54
|
(pragma) @keyword.directive
|
|
@@ -97,12 +87,6 @@
|
|
|
97
87
|
"@"
|
|
98
88
|
] @operator
|
|
99
89
|
|
|
100
|
-
; TODO broken, also huh?
|
|
101
|
-
; ((qualified_module
|
|
102
|
-
; (module) @constructor)
|
|
103
|
-
; .
|
|
104
|
-
; (module))
|
|
105
|
-
|
|
106
90
|
(module
|
|
107
91
|
(module_id) @module)
|
|
108
92
|
|
|
@@ -131,8 +115,6 @@
|
|
|
131
115
|
"infixr"
|
|
132
116
|
] @keyword
|
|
133
117
|
|
|
134
|
-
; ----------------------------------------------------------------------------
|
|
135
|
-
; Functions and variables
|
|
136
118
|
[
|
|
137
119
|
(decl/function name: (variable) @function)
|
|
138
120
|
(decl/bind name: (variable) @function)
|
|
@@ -143,8 +125,6 @@
|
|
|
143
125
|
(decl/bind
|
|
144
126
|
name: (variable) @variable)
|
|
145
127
|
|
|
146
|
-
; Consider signatures (and accompanying functions)
|
|
147
|
-
; with only one value on the rhs as variables
|
|
148
128
|
(decl/signature
|
|
149
129
|
name: (variable) @variable
|
|
150
130
|
type: (type))
|
|
@@ -160,7 +140,6 @@
|
|
|
160
140
|
match: (_)
|
|
161
141
|
(#eq? @_name @variable))
|
|
162
142
|
|
|
163
|
-
; but consider a type that involves 'IO' a decl/function
|
|
164
143
|
(decl/signature
|
|
165
144
|
name: (variable) @function
|
|
166
145
|
type: (type/apply
|
|
@@ -190,7 +169,6 @@
|
|
|
190
169
|
(match
|
|
191
170
|
expression: (expression/lambda)))
|
|
192
171
|
|
|
193
|
-
; view patterns
|
|
194
172
|
(view_pattern
|
|
195
173
|
[
|
|
196
174
|
(expression/variable) @function.call
|
|
@@ -198,7 +176,6 @@
|
|
|
198
176
|
(variable) @function.call)
|
|
199
177
|
])
|
|
200
178
|
|
|
201
|
-
; consider infix functions as operators
|
|
202
179
|
(infix_id
|
|
203
180
|
[
|
|
204
181
|
(variable) @operator
|
|
@@ -206,8 +183,6 @@
|
|
|
206
183
|
(variable) @operator)
|
|
207
184
|
])
|
|
208
185
|
|
|
209
|
-
; decl/function calls with an infix operator
|
|
210
|
-
; e.g. func <$> a <*> b
|
|
211
186
|
(infix
|
|
212
187
|
[
|
|
213
188
|
(variable) @function.call
|
|
@@ -218,7 +193,6 @@
|
|
|
218
193
|
.
|
|
219
194
|
(operator))
|
|
220
195
|
|
|
221
|
-
; infix operators applied to variables
|
|
222
196
|
((expression/variable) @variable
|
|
223
197
|
.
|
|
224
198
|
(operator))
|
|
@@ -231,7 +205,6 @@
|
|
|
231
205
|
(variable) @variable)
|
|
232
206
|
])
|
|
233
207
|
|
|
234
|
-
; decl/function calls with infix operators
|
|
235
208
|
([
|
|
236
209
|
(expression/variable) @function.call
|
|
237
210
|
(expression/qualified
|
|
@@ -241,12 +214,11 @@
|
|
|
241
214
|
(operator) @_op
|
|
242
215
|
(#any-of? @_op "$" "<$>" ">>=" "=<<"))
|
|
243
216
|
|
|
244
|
-
; right hand side of infix operator
|
|
245
217
|
((infix
|
|
246
218
|
[
|
|
247
219
|
(operator)
|
|
248
220
|
(infix_id (variable))
|
|
249
|
-
]
|
|
221
|
+
]
|
|
250
222
|
.
|
|
251
223
|
[
|
|
252
224
|
(variable) @function.call
|
|
@@ -257,7 +229,6 @@
|
|
|
257
229
|
(operator) @_op
|
|
258
230
|
(#any-of? @_op "$" "<$>" "=<<"))
|
|
259
231
|
|
|
260
|
-
; decl/function composition, arrows, monadic composition (lhs)
|
|
261
232
|
(
|
|
262
233
|
[
|
|
263
234
|
(expression/variable) @function
|
|
@@ -268,12 +239,11 @@
|
|
|
268
239
|
(operator) @_op
|
|
269
240
|
(#any-of? @_op "." ">>>" "***" ">=>" "<=<"))
|
|
270
241
|
|
|
271
|
-
; right hand side of infix operator
|
|
272
242
|
((infix
|
|
273
243
|
[
|
|
274
244
|
(operator)
|
|
275
245
|
(infix_id (variable))
|
|
276
|
-
]
|
|
246
|
+
]
|
|
277
247
|
.
|
|
278
248
|
[
|
|
279
249
|
(variable) @function
|
|
@@ -284,7 +254,6 @@
|
|
|
284
254
|
(operator) @_op
|
|
285
255
|
(#any-of? @_op "." ">>>" "***" ">=>" "<=<"))
|
|
286
256
|
|
|
287
|
-
; function composition, arrows, monadic composition (rhs)
|
|
288
257
|
((operator) @_op
|
|
289
258
|
.
|
|
290
259
|
[
|
|
@@ -294,7 +263,6 @@
|
|
|
294
263
|
]
|
|
295
264
|
(#any-of? @_op "." ">>>" "***" ">=>" "<=<"))
|
|
296
265
|
|
|
297
|
-
; function defined in terms of a function composition
|
|
298
266
|
(decl/function
|
|
299
267
|
name: (variable) @function
|
|
300
268
|
(match
|
|
@@ -309,8 +277,6 @@
|
|
|
309
277
|
(variable) @function.call)
|
|
310
278
|
])
|
|
311
279
|
|
|
312
|
-
; function compositions, in parentheses, applied
|
|
313
|
-
; lhs
|
|
314
280
|
(apply
|
|
315
281
|
.
|
|
316
282
|
(expression/parens
|
|
@@ -323,7 +289,6 @@
|
|
|
323
289
|
.
|
|
324
290
|
(operator))))
|
|
325
291
|
|
|
326
|
-
; rhs
|
|
327
292
|
(apply
|
|
328
293
|
.
|
|
329
294
|
(expression/parens
|
|
@@ -336,7 +301,6 @@
|
|
|
336
301
|
(variable) @function.call)
|
|
337
302
|
])))
|
|
338
303
|
|
|
339
|
-
; variables being passed to a function call
|
|
340
304
|
(apply
|
|
341
305
|
(_)
|
|
342
306
|
.
|
|
@@ -346,19 +310,14 @@
|
|
|
346
310
|
(variable) @variable)
|
|
347
311
|
])
|
|
348
312
|
|
|
349
|
-
; main is always a function
|
|
350
|
-
; (this prevents `main = undefined` from being highlighted as a variable)
|
|
351
313
|
(decl/bind
|
|
352
314
|
name: (variable) @function
|
|
353
315
|
(#eq? @function "main"))
|
|
354
316
|
|
|
355
|
-
; scoped function types (func :: a -> b)
|
|
356
317
|
(signature
|
|
357
318
|
pattern: (pattern/variable) @function
|
|
358
319
|
type: (quantified_type))
|
|
359
320
|
|
|
360
|
-
; signatures that have a function type
|
|
361
|
-
; + binds that follow them
|
|
362
321
|
(decl/signature
|
|
363
322
|
name: (variable) @function
|
|
364
323
|
type: (quantified_type))
|
|
@@ -371,26 +330,27 @@
|
|
|
371
330
|
(variable) @function)
|
|
372
331
|
(#eq? @function @_name))
|
|
373
332
|
|
|
374
|
-
; ----------------------------------------------------------------------------
|
|
375
|
-
; Types
|
|
376
333
|
(name) @type
|
|
377
334
|
|
|
378
335
|
(type/star) @type
|
|
379
336
|
|
|
380
|
-
|
|
337
|
+
[
|
|
338
|
+
(type/variable)
|
|
339
|
+
(constraint/variable)
|
|
340
|
+
(type_param/variable)
|
|
341
|
+
] @type
|
|
342
|
+
|
|
343
|
+
(fundep (variable) @type)
|
|
344
|
+
(type_family_injectivity (variable) @type)
|
|
381
345
|
|
|
382
346
|
(constructor) @constructor
|
|
383
347
|
|
|
384
|
-
; True or False
|
|
385
348
|
((constructor) @boolean
|
|
386
349
|
(#any-of? @boolean "True" "False"))
|
|
387
350
|
|
|
388
|
-
; otherwise (= True)
|
|
389
351
|
((variable) @boolean
|
|
390
352
|
(#eq? @boolean "otherwise"))
|
|
391
353
|
|
|
392
|
-
; ----------------------------------------------------------------------------
|
|
393
|
-
; Quasi-quotes
|
|
394
354
|
(quoter) @function.call
|
|
395
355
|
|
|
396
356
|
(quasiquote
|
|
@@ -408,34 +368,12 @@
|
|
|
408
368
|
(#eq? @_name "qq")
|
|
409
369
|
(quasiquote_body) @string)
|
|
410
370
|
|
|
411
|
-
; namespaced quasi-quoter
|
|
412
371
|
(quasiquote
|
|
413
372
|
(_
|
|
414
373
|
(module) @module
|
|
415
374
|
.
|
|
416
375
|
(variable) @function.call))
|
|
417
376
|
|
|
418
|
-
; Highlighting of quasiquote_body for other languages is handled by injections.scm
|
|
419
|
-
; ----------------------------------------------------------------------------
|
|
420
|
-
; Exceptions/error handling
|
|
421
|
-
((variable) @keyword.exception
|
|
422
|
-
(#any-of? @keyword.exception
|
|
423
|
-
"error" "undefined" "try" "tryJust" "tryAny" "catch" "catches" "catchJust" "handle" "handleJust"
|
|
424
|
-
"throw" "throwIO" "throwTo" "throwError" "ioError" "mask" "mask_" "uninterruptibleMask"
|
|
425
|
-
"uninterruptibleMask_" "bracket" "bracket_" "bracketOnErrorSource" "finally" "fail"
|
|
426
|
-
"onException" "expectationFailure"))
|
|
427
|
-
|
|
428
|
-
; ----------------------------------------------------------------------------
|
|
429
|
-
; Debugging
|
|
430
|
-
((variable) @keyword.debug
|
|
431
|
-
(#any-of? @keyword.debug
|
|
432
|
-
"trace" "traceId" "traceShow" "traceShowId" "traceWith" "traceShowWith" "traceStack" "traceIO"
|
|
433
|
-
"traceM" "traceShowM" "traceEvent" "traceEventWith" "traceEventIO" "flushEventLog" "traceMarker"
|
|
434
|
-
"traceMarkerIO"))
|
|
435
|
-
|
|
436
|
-
; ----------------------------------------------------------------------------
|
|
437
|
-
; Fields
|
|
438
|
-
|
|
439
377
|
(field_name
|
|
440
378
|
(variable) @variable.member)
|
|
441
379
|
|
|
@@ -445,14 +383,8 @@
|
|
|
445
383
|
(children
|
|
446
384
|
(variable) @variable.member))
|
|
447
385
|
|
|
448
|
-
|
|
449
|
-
; ----------------------------------------------------------------------------
|
|
450
|
-
; Spell checking
|
|
451
386
|
(comment) @spell
|
|
452
387
|
|
|
453
|
-
; ----------------------------------------------------------------------------
|
|
454
|
-
; Calls through grouped names
|
|
455
|
-
|
|
456
388
|
(expression/apply
|
|
457
389
|
function: (parenthesized_name
|
|
458
390
|
[
|
package/tree-sitter-haskell.wasm
CHANGED
|
Binary file
|