@willbooster/tree-sitter-haskell 9.0.0 → 10.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.
- package/README.md +7 -4
- package/grammar/conflicts.js +22 -19
- package/grammar/context.js +8 -9
- package/grammar/exp.js +29 -27
- package/grammar/externals.js +0 -7
- package/grammar/inline.js +7 -0
- package/grammar/pat.js +20 -13
- package/grammar/precedences.js +0 -1
- package/grammar/type.js +13 -10
- package/grammar.js +5 -14
- package/hsc/src/node-types.json +441 -166
- package/package.json +1 -1
- package/queries/highlights.scm +36 -65
- package/queries/locals.scm +3 -3
- package/queries/tags.scm +35 -19
- package/src/node-types.json +441 -166
- package/tree-sitter-haskell.wasm +0 -0
- package/tree-sitter-hsc.wasm +0 -0
- package/tree-sitter.json +1 -1
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
; and don't override destructured parameters
|
|
3
3
|
(variable) @variable
|
|
4
4
|
|
|
5
|
-
[(
|
|
5
|
+
[(pattern_operand/wildcard) (binding_pattern_operand/wildcard)] @variable
|
|
6
6
|
|
|
7
7
|
(function
|
|
8
8
|
patterns: (patterns
|
|
9
9
|
(_) @variable.parameter))
|
|
10
10
|
|
|
11
|
-
(
|
|
11
|
+
(expression_operand/lambda
|
|
12
12
|
(_)+ @variable.parameter
|
|
13
13
|
"->")
|
|
14
14
|
|
|
15
15
|
(function
|
|
16
16
|
(infix
|
|
17
|
-
(
|
|
17
|
+
[(pattern_operand) (infix_chain)] @variable.parameter))
|
|
18
18
|
|
|
19
19
|
(integer) @number
|
|
20
20
|
|
|
21
21
|
(negation) @number
|
|
22
22
|
|
|
23
|
-
(
|
|
23
|
+
(expression_operand/literal
|
|
24
24
|
(float)) @number.float
|
|
25
25
|
|
|
26
26
|
(char) @character
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
[
|
|
72
72
|
(operator)
|
|
73
|
+
(prefix_negation)
|
|
73
74
|
(constructor_operator)
|
|
74
75
|
(all_names)
|
|
75
76
|
(wildcard)
|
|
@@ -127,11 +128,11 @@
|
|
|
127
128
|
|
|
128
129
|
(signature
|
|
129
130
|
name: (variable) @variable
|
|
130
|
-
type: (
|
|
131
|
+
type: [(type_operand) (infix_chain)])
|
|
131
132
|
|
|
132
133
|
((signature
|
|
133
134
|
name: (variable) @_name
|
|
134
|
-
type: (
|
|
135
|
+
type: [(type_operand) (infix_chain)])
|
|
135
136
|
.
|
|
136
137
|
[
|
|
137
138
|
(function name: (variable) @variable)
|
|
@@ -142,13 +143,13 @@
|
|
|
142
143
|
|
|
143
144
|
(signature
|
|
144
145
|
name: (variable) @function
|
|
145
|
-
type: (
|
|
146
|
+
type: (type_operand/apply
|
|
146
147
|
constructor: (name) @_type)
|
|
147
148
|
(#eq? @_type "IO"))
|
|
148
149
|
|
|
149
150
|
((signature
|
|
150
151
|
name: (variable) @_name
|
|
151
|
-
type: (
|
|
152
|
+
type: (type_operand/apply
|
|
152
153
|
constructor: (name) @_type)
|
|
153
154
|
(#eq? @_type "IO"))
|
|
154
155
|
.
|
|
@@ -170,12 +171,12 @@
|
|
|
170
171
|
(bind
|
|
171
172
|
name: (variable) @function
|
|
172
173
|
(match
|
|
173
|
-
expression: (
|
|
174
|
+
expression: (expression_operand/lambda)))
|
|
174
175
|
|
|
175
176
|
(view_pattern
|
|
176
177
|
[
|
|
177
|
-
(
|
|
178
|
-
(
|
|
178
|
+
(expression_operand/variable) @function.call
|
|
179
|
+
(expression_operand/qualified
|
|
179
180
|
(variable) @function.call)
|
|
180
181
|
])
|
|
181
182
|
|
|
@@ -186,7 +187,7 @@
|
|
|
186
187
|
(variable) @operator)
|
|
187
188
|
])
|
|
188
189
|
|
|
189
|
-
(
|
|
190
|
+
(operator_chain
|
|
190
191
|
[
|
|
191
192
|
(variable) @function.call
|
|
192
193
|
(qualified
|
|
@@ -196,72 +197,42 @@
|
|
|
196
197
|
.
|
|
197
198
|
(operator))
|
|
198
199
|
|
|
199
|
-
((
|
|
200
|
+
((expression_operand/variable) @variable
|
|
200
201
|
.
|
|
201
202
|
(operator))
|
|
202
203
|
|
|
203
204
|
((operator)
|
|
204
205
|
.
|
|
205
206
|
[
|
|
206
|
-
(
|
|
207
|
-
(
|
|
207
|
+
(expression_operand/variable) @variable
|
|
208
|
+
(expression_operand/qualified
|
|
208
209
|
(variable) @variable)
|
|
209
210
|
])
|
|
210
211
|
|
|
211
212
|
([
|
|
212
|
-
(
|
|
213
|
-
(
|
|
213
|
+
(expression_operand/variable) @function.call
|
|
214
|
+
(expression_operand/qualified
|
|
214
215
|
(variable) @function.call)
|
|
215
216
|
]
|
|
216
217
|
.
|
|
217
218
|
(operator) @_op
|
|
218
219
|
(#any-of? @_op "$" "<$>" ">>=" "=<<"))
|
|
219
220
|
|
|
220
|
-
((infix
|
|
221
|
-
[
|
|
222
|
-
(operator)
|
|
223
|
-
(infix_id (variable))
|
|
224
|
-
]
|
|
225
|
-
.
|
|
226
|
-
[
|
|
227
|
-
(variable) @function.call
|
|
228
|
-
(qualified
|
|
229
|
-
(variable) @function.call)
|
|
230
|
-
])
|
|
231
|
-
.
|
|
232
|
-
(operator) @_op
|
|
233
|
-
(#any-of? @_op "$" "<$>" "=<<"))
|
|
234
|
-
|
|
235
221
|
(
|
|
236
222
|
[
|
|
237
|
-
(
|
|
238
|
-
(
|
|
223
|
+
(expression_operand/variable) @function
|
|
224
|
+
(expression_operand/qualified
|
|
239
225
|
(variable) @function)
|
|
240
226
|
]
|
|
241
227
|
.
|
|
242
228
|
(operator) @_op
|
|
243
229
|
(#any-of? @_op "." ">>>" "***" ">=>" "<=<"))
|
|
244
230
|
|
|
245
|
-
((infix
|
|
246
|
-
[
|
|
247
|
-
(operator)
|
|
248
|
-
(infix_id (variable))
|
|
249
|
-
]
|
|
250
|
-
.
|
|
251
|
-
[
|
|
252
|
-
(variable) @function
|
|
253
|
-
(qualified
|
|
254
|
-
(variable) @function)
|
|
255
|
-
])
|
|
256
|
-
.
|
|
257
|
-
(operator) @_op
|
|
258
|
-
(#any-of? @_op "." ">>>" "***" ">=>" "<=<"))
|
|
259
|
-
|
|
260
231
|
((operator) @_op
|
|
261
232
|
.
|
|
262
233
|
[
|
|
263
|
-
(
|
|
264
|
-
(
|
|
234
|
+
(expression_operand/variable) @function
|
|
235
|
+
(expression_operand/qualified
|
|
265
236
|
(variable) @function)
|
|
266
237
|
]
|
|
267
238
|
(#any-of? @_op "." ">>>" "***" ">=>" "<=<"))
|
|
@@ -269,21 +240,21 @@
|
|
|
269
240
|
(function
|
|
270
241
|
name: (variable) @function
|
|
271
242
|
(match
|
|
272
|
-
expression: (
|
|
243
|
+
expression: (operator_chain
|
|
273
244
|
operator: (operator) @_op
|
|
274
245
|
(#any-of? @_op "." ">>>" "***" ">=>" "<=<"))))
|
|
275
246
|
|
|
276
247
|
(apply
|
|
277
248
|
[
|
|
278
|
-
(
|
|
279
|
-
(
|
|
249
|
+
(expression_operand/variable) @function.call
|
|
250
|
+
(expression_operand/qualified
|
|
280
251
|
(variable) @function.call)
|
|
281
252
|
])
|
|
282
253
|
|
|
283
254
|
(apply
|
|
284
255
|
.
|
|
285
|
-
(
|
|
286
|
-
(
|
|
256
|
+
(expression_operand/parens
|
|
257
|
+
(operator_chain
|
|
287
258
|
[
|
|
288
259
|
(variable) @function.call
|
|
289
260
|
(qualified
|
|
@@ -294,8 +265,8 @@
|
|
|
294
265
|
|
|
295
266
|
(apply
|
|
296
267
|
.
|
|
297
|
-
(
|
|
298
|
-
(
|
|
268
|
+
(expression_operand/parens
|
|
269
|
+
(operator_chain
|
|
299
270
|
(operator)
|
|
300
271
|
.
|
|
301
272
|
[
|
|
@@ -308,8 +279,8 @@
|
|
|
308
279
|
(_)
|
|
309
280
|
.
|
|
310
281
|
[
|
|
311
|
-
(
|
|
312
|
-
(
|
|
282
|
+
(expression_operand/variable) @variable
|
|
283
|
+
(expression_operand/qualified
|
|
313
284
|
(variable) @variable)
|
|
314
285
|
])
|
|
315
286
|
|
|
@@ -318,7 +289,7 @@
|
|
|
318
289
|
(#eq? @function "main"))
|
|
319
290
|
|
|
320
291
|
(signature
|
|
321
|
-
pattern: [(
|
|
292
|
+
pattern: [(pattern_operand/variable) (binding_pattern_operand/variable)] @function
|
|
322
293
|
type: (quantified_type))
|
|
323
294
|
|
|
324
295
|
(signature
|
|
@@ -335,11 +306,11 @@
|
|
|
335
306
|
|
|
336
307
|
(name) @type
|
|
337
308
|
|
|
338
|
-
(
|
|
309
|
+
(type_operand/star) @type
|
|
339
310
|
|
|
340
311
|
[
|
|
341
|
-
(
|
|
342
|
-
(
|
|
312
|
+
(type_operand/variable)
|
|
313
|
+
(constraint_operand/variable)
|
|
343
314
|
(type_param/variable)
|
|
344
315
|
] @type
|
|
345
316
|
|
|
@@ -388,7 +359,7 @@
|
|
|
388
359
|
|
|
389
360
|
(comment) @spell
|
|
390
361
|
|
|
391
|
-
(
|
|
362
|
+
(expression_operand/apply
|
|
392
363
|
function: (parenthesized_name
|
|
393
364
|
[
|
|
394
365
|
(variable) @function.call
|
package/queries/locals.scm
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(signature name: (variable)) @local.definition
|
|
2
2
|
(function name: (variable)) @local.definition
|
|
3
|
-
[(
|
|
4
|
-
(
|
|
5
|
-
(
|
|
3
|
+
[(pattern_operand/variable) (binding_pattern_operand/variable)] @local.definition
|
|
4
|
+
(expression_operand/variable) @local.reference
|
|
5
|
+
(expression_operand/parenthesized_name (variable) @local.reference)
|
|
6
6
|
(_ name: (parenthesized_name (variable) @local.definition))
|
package/queries/tags.scm
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
(parenthesized_name [(variable) @name (prefix_id (operator) @name)])
|
|
16
16
|
]) @definition.variable)
|
|
17
17
|
|
|
18
|
-
(
|
|
19
|
-
(
|
|
20
|
-
(
|
|
18
|
+
(binding_pattern_operand/variable) @name @definition.variable
|
|
19
|
+
(binding_pattern_operand/prefix_id (operator) @name) @definition.variable
|
|
20
|
+
(binding_pattern_operand/as bind: (variable) @name) @definition.variable
|
|
21
21
|
|
|
22
22
|
(binding_field_pattern/field_pattern
|
|
23
23
|
!pattern
|
|
@@ -110,13 +110,21 @@
|
|
|
110
110
|
(prefix_id [(operator) @name (constructor_operator) @name])
|
|
111
111
|
(prefix_id (qualified id: [(operator) @name (constructor_operator) @name]))
|
|
112
112
|
]) @reference.implementation
|
|
113
|
-
(instance head: (
|
|
114
|
-
(
|
|
115
|
-
(
|
|
116
|
-
(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
(instance head: (infix_chain
|
|
114
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
115
|
+
. operand: (_)
|
|
116
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
117
|
+
. operator: [
|
|
118
|
+
(constructor_operator) @name
|
|
119
|
+
(operator) @name
|
|
120
|
+
(infix_id (name) @name)
|
|
121
|
+
(qualified id: [(constructor_operator) @name (operator) @name])
|
|
122
|
+
(infix_id (qualified id: (name) @name))
|
|
123
|
+
]
|
|
124
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
125
|
+
. operand: (_)
|
|
126
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
127
|
+
.)) @reference.implementation
|
|
120
128
|
|
|
121
129
|
(deriving_instance name: [
|
|
122
130
|
(name) @name
|
|
@@ -124,18 +132,26 @@
|
|
|
124
132
|
(prefix_id [(operator) @name (constructor_operator) @name])
|
|
125
133
|
(prefix_id (qualified id: [(operator) @name (constructor_operator) @name]))
|
|
126
134
|
]) @reference.implementation
|
|
127
|
-
(deriving_instance head: (
|
|
128
|
-
(
|
|
129
|
-
(
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
(deriving_instance head: (infix_chain
|
|
136
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
137
|
+
. operand: (_)
|
|
138
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
139
|
+
. operator: [
|
|
140
|
+
(constructor_operator) @name
|
|
141
|
+
(operator) @name
|
|
142
|
+
(infix_id (name) @name)
|
|
143
|
+
(qualified id: [(constructor_operator) @name (operator) @name])
|
|
144
|
+
(infix_id (qualified id: (name) @name))
|
|
145
|
+
]
|
|
146
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
147
|
+
. operand: (_)
|
|
148
|
+
. [(cpp) (comment) (haddock) (pragma)]*
|
|
149
|
+
.)) @reference.implementation
|
|
134
150
|
|
|
135
151
|
(foreign_import
|
|
136
152
|
signature: (signature name: [(variable) @name (prefix_id (operator) @name)])) @definition.function
|
|
137
153
|
|
|
138
|
-
(
|
|
154
|
+
(expression_operand/apply
|
|
139
155
|
function: [
|
|
140
156
|
(variable) @name
|
|
141
157
|
(qualified id: (variable) @name)
|
|
@@ -149,7 +165,7 @@
|
|
|
149
165
|
])
|
|
150
166
|
]) @reference.call
|
|
151
167
|
|
|
152
|
-
(
|
|
168
|
+
(operator_chain
|
|
153
169
|
operator: [
|
|
154
170
|
(operator) @name
|
|
155
171
|
(infix_id (variable) @name)
|