@willbooster/tree-sitter-haskell 6.0.2 → 6.0.4
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 +3 -78
- 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,8 +330,6 @@
|
|
|
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
|
|
@@ -388,16 +345,12 @@
|
|
|
388
345
|
|
|
389
346
|
(constructor) @constructor
|
|
390
347
|
|
|
391
|
-
; True or False
|
|
392
348
|
((constructor) @boolean
|
|
393
349
|
(#any-of? @boolean "True" "False"))
|
|
394
350
|
|
|
395
|
-
; otherwise (= True)
|
|
396
351
|
((variable) @boolean
|
|
397
352
|
(#eq? @boolean "otherwise"))
|
|
398
353
|
|
|
399
|
-
; ----------------------------------------------------------------------------
|
|
400
|
-
; Quasi-quotes
|
|
401
354
|
(quoter) @function.call
|
|
402
355
|
|
|
403
356
|
(quasiquote
|
|
@@ -415,34 +368,12 @@
|
|
|
415
368
|
(#eq? @_name "qq")
|
|
416
369
|
(quasiquote_body) @string)
|
|
417
370
|
|
|
418
|
-
; namespaced quasi-quoter
|
|
419
371
|
(quasiquote
|
|
420
372
|
(_
|
|
421
373
|
(module) @module
|
|
422
374
|
.
|
|
423
375
|
(variable) @function.call))
|
|
424
376
|
|
|
425
|
-
; Highlighting of quasiquote_body for other languages is handled by injections.scm
|
|
426
|
-
; ----------------------------------------------------------------------------
|
|
427
|
-
; Exceptions/error handling
|
|
428
|
-
((variable) @keyword.exception
|
|
429
|
-
(#any-of? @keyword.exception
|
|
430
|
-
"error" "undefined" "try" "tryJust" "tryAny" "catch" "catches" "catchJust" "handle" "handleJust"
|
|
431
|
-
"throw" "throwIO" "throwTo" "throwError" "ioError" "mask" "mask_" "uninterruptibleMask"
|
|
432
|
-
"uninterruptibleMask_" "bracket" "bracket_" "bracketOnErrorSource" "finally" "fail"
|
|
433
|
-
"onException" "expectationFailure"))
|
|
434
|
-
|
|
435
|
-
; ----------------------------------------------------------------------------
|
|
436
|
-
; Debugging
|
|
437
|
-
((variable) @keyword.debug
|
|
438
|
-
(#any-of? @keyword.debug
|
|
439
|
-
"trace" "traceId" "traceShow" "traceShowId" "traceWith" "traceShowWith" "traceStack" "traceIO"
|
|
440
|
-
"traceM" "traceShowM" "traceEvent" "traceEventWith" "traceEventIO" "flushEventLog" "traceMarker"
|
|
441
|
-
"traceMarkerIO"))
|
|
442
|
-
|
|
443
|
-
; ----------------------------------------------------------------------------
|
|
444
|
-
; Fields
|
|
445
|
-
|
|
446
377
|
(field_name
|
|
447
378
|
(variable) @variable.member)
|
|
448
379
|
|
|
@@ -452,14 +383,8 @@
|
|
|
452
383
|
(children
|
|
453
384
|
(variable) @variable.member))
|
|
454
385
|
|
|
455
|
-
|
|
456
|
-
; ----------------------------------------------------------------------------
|
|
457
|
-
; Spell checking
|
|
458
386
|
(comment) @spell
|
|
459
387
|
|
|
460
|
-
; ----------------------------------------------------------------------------
|
|
461
|
-
; Calls through grouped names
|
|
462
|
-
|
|
463
388
|
(expression/apply
|
|
464
389
|
function: (parenthesized_name
|
|
465
390
|
[
|
package/tree-sitter-haskell.wasm
CHANGED
|
Binary file
|