github-linguist 4.8.1 → 4.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/grammars/source.css.less.json +1 -1
- data/grammars/source.elixir.json +1 -1
- data/grammars/source.nix.json +1200 -0
- data/grammars/source.purescript.json +4 -73
- data/grammars/text.elixir.json +1 -1
- data/grammars/text.slim.json +5 -11
- data/lib/linguist/heuristics.rb +8 -0
- data/lib/linguist/languages.json +1 -1
- data/lib/linguist/languages.yml +2 -1
- data/lib/linguist/samples.json +151 -77
- data/lib/linguist/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c13554e87b5893582eec8a7abf26158e7f2d951
|
4
|
+
data.tar.gz: 85b01625638b556c629007befaf9f93900431c76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b53490edb878c7f3f1263bb8a2aedf832f64ef55108f17bb520c051d84b8715411024b48242e8915936f896c712d0a601cc8ea36a2ea4cca993bafb3920ebd87
|
7
|
+
data.tar.gz: e70345da5e6e1d7a96d43b98f11805c562cb895c40474af5489e1bbb3c1d3c74a8709efad580fac17532f9deee1119d633115918baf73fc3bfc95b26a2c5fba0
|
data/grammars/source.elixir.json
CHANGED
@@ -326,7 +326,7 @@
|
|
326
326
|
]
|
327
327
|
},
|
328
328
|
{
|
329
|
-
"match": "(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else
|
329
|
+
"match": "(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!:])",
|
330
330
|
"name": "keyword.control.elixir"
|
331
331
|
},
|
332
332
|
{
|
@@ -0,0 +1,1200 @@
|
|
1
|
+
{
|
2
|
+
"fileTypes": [
|
3
|
+
"nix"
|
4
|
+
],
|
5
|
+
"name": "Nix",
|
6
|
+
"patterns": [
|
7
|
+
{
|
8
|
+
"include": "#expression"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"repository": {
|
12
|
+
"attribute-bind": {
|
13
|
+
"patterns": [
|
14
|
+
{
|
15
|
+
"include": "#attribute-name"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"include": "#attribute-bind-from-equals"
|
19
|
+
}
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"attribute-bind-from-equals": {
|
23
|
+
"begin": "\\=",
|
24
|
+
"beginCaptures": {
|
25
|
+
"0": {
|
26
|
+
"name": "keyword.operator.bind.nix"
|
27
|
+
}
|
28
|
+
},
|
29
|
+
"end": "\\;",
|
30
|
+
"endCaptures": {
|
31
|
+
"0": {
|
32
|
+
"name": "punctuation.terminator.bind.nix"
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"patterns": [
|
36
|
+
{
|
37
|
+
"include": "#expression"
|
38
|
+
}
|
39
|
+
]
|
40
|
+
},
|
41
|
+
"attribute-inherit": {
|
42
|
+
"begin": "\\binherit\\b",
|
43
|
+
"beginCaptures": {
|
44
|
+
"0": {
|
45
|
+
"name": "keyword.other.inherit.nix"
|
46
|
+
}
|
47
|
+
},
|
48
|
+
"end": "\\;",
|
49
|
+
"endCaptures": {
|
50
|
+
"0": {
|
51
|
+
"name": "punctuation.terminator.inherit.nix"
|
52
|
+
}
|
53
|
+
},
|
54
|
+
"patterns": [
|
55
|
+
{
|
56
|
+
"begin": "\\(",
|
57
|
+
"beginCaptures": {
|
58
|
+
"0": {
|
59
|
+
"name": "punctuation.section.function.arguments.nix"
|
60
|
+
}
|
61
|
+
},
|
62
|
+
"end": "(?=\\;)",
|
63
|
+
"patterns": [
|
64
|
+
{
|
65
|
+
"begin": "\\)",
|
66
|
+
"beginCaptures": {
|
67
|
+
"0": {
|
68
|
+
"name": "punctuation.section.function.arguments.nix"
|
69
|
+
}
|
70
|
+
},
|
71
|
+
"end": "(?=\\;)",
|
72
|
+
"patterns": [
|
73
|
+
{
|
74
|
+
"include": "#bad-reserved"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"include": "#attribute-name-single"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"include": "#others"
|
81
|
+
}
|
82
|
+
]
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"include": "#expression"
|
86
|
+
}
|
87
|
+
]
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"begin": "(?=[a-zA-Z\\_])",
|
91
|
+
"end": "(?=\\;)",
|
92
|
+
"patterns": [
|
93
|
+
{
|
94
|
+
"include": "#bad-reserved"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"include": "#attribute-name-single"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"include": "#others"
|
101
|
+
}
|
102
|
+
]
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"include": "#others"
|
106
|
+
}
|
107
|
+
]
|
108
|
+
},
|
109
|
+
"attribute-name": {
|
110
|
+
"patterns": [
|
111
|
+
{
|
112
|
+
"match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*",
|
113
|
+
"name": "entity.other.attribute-name.multipart.nix"
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"match": "\\."
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"include": "#string-quoted"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"include": "#interpolation"
|
123
|
+
}
|
124
|
+
]
|
125
|
+
},
|
126
|
+
"attribute-name-single": {
|
127
|
+
"match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*",
|
128
|
+
"name": "entity.other.attribute-name.single.nix"
|
129
|
+
},
|
130
|
+
"attrset-contents": {
|
131
|
+
"patterns": [
|
132
|
+
{
|
133
|
+
"include": "#attribute-inherit"
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"include": "#bad-reserved"
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"include": "#attribute-bind"
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"include": "#others"
|
143
|
+
}
|
144
|
+
]
|
145
|
+
},
|
146
|
+
"attrset-definition": {
|
147
|
+
"begin": "(?=\\{)",
|
148
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
149
|
+
"patterns": [
|
150
|
+
{
|
151
|
+
"begin": "(\\{)",
|
152
|
+
"beginCaptures": {
|
153
|
+
"0": {
|
154
|
+
"name": "punctuation.definition.attrset.nix"
|
155
|
+
}
|
156
|
+
},
|
157
|
+
"end": "(\\})",
|
158
|
+
"endCaptures": {
|
159
|
+
"0": {
|
160
|
+
"name": "punctuation.definition.attrset.nix"
|
161
|
+
}
|
162
|
+
},
|
163
|
+
"patterns": [
|
164
|
+
{
|
165
|
+
"include": "#attrset-contents"
|
166
|
+
}
|
167
|
+
]
|
168
|
+
},
|
169
|
+
{
|
170
|
+
"begin": "(?<=\\})",
|
171
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
172
|
+
"patterns": [
|
173
|
+
{
|
174
|
+
"include": "#expression-cont"
|
175
|
+
}
|
176
|
+
]
|
177
|
+
}
|
178
|
+
]
|
179
|
+
},
|
180
|
+
"attrset-definition-brace-opened": {
|
181
|
+
"patterns": [
|
182
|
+
{
|
183
|
+
"begin": "(?<=\\})",
|
184
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
185
|
+
"patterns": [
|
186
|
+
{
|
187
|
+
"include": "#expression-cont"
|
188
|
+
}
|
189
|
+
]
|
190
|
+
},
|
191
|
+
{
|
192
|
+
"begin": "(?=.?)",
|
193
|
+
"end": "\\}",
|
194
|
+
"endCaptures": {
|
195
|
+
"0": {
|
196
|
+
"name": "punctuation.definition.attrset.nix"
|
197
|
+
}
|
198
|
+
},
|
199
|
+
"patterns": [
|
200
|
+
{
|
201
|
+
"include": "#attrset-contents"
|
202
|
+
}
|
203
|
+
]
|
204
|
+
}
|
205
|
+
]
|
206
|
+
},
|
207
|
+
"attrset-for-sure": {
|
208
|
+
"patterns": [
|
209
|
+
{
|
210
|
+
"begin": "(?=\\brec\\b)",
|
211
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
212
|
+
"patterns": [
|
213
|
+
{
|
214
|
+
"begin": "\\brec\\b",
|
215
|
+
"beginCaptures": {
|
216
|
+
"0": {
|
217
|
+
"name": "keyword.other.nix"
|
218
|
+
}
|
219
|
+
},
|
220
|
+
"end": "(?=\\{)",
|
221
|
+
"patterns": [
|
222
|
+
{
|
223
|
+
"include": "#others"
|
224
|
+
}
|
225
|
+
]
|
226
|
+
},
|
227
|
+
{
|
228
|
+
"include": "#attrset-definition"
|
229
|
+
},
|
230
|
+
{
|
231
|
+
"include": "#others"
|
232
|
+
}
|
233
|
+
]
|
234
|
+
},
|
235
|
+
{
|
236
|
+
"begin": "(?=\\{\\s*(\\}|[^,?]*(=|;)))",
|
237
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
238
|
+
"patterns": [
|
239
|
+
{
|
240
|
+
"include": "#attrset-definition"
|
241
|
+
},
|
242
|
+
{
|
243
|
+
"include": "#others"
|
244
|
+
}
|
245
|
+
]
|
246
|
+
}
|
247
|
+
]
|
248
|
+
},
|
249
|
+
"attrset-or-function": {
|
250
|
+
"begin": "\\{",
|
251
|
+
"beginCaptures": {
|
252
|
+
"0": {
|
253
|
+
"name": "punctuation.definition.attrset-or-function.nix"
|
254
|
+
}
|
255
|
+
},
|
256
|
+
"end": "(?=([\\])};]|\\b(else|then)\\b))",
|
257
|
+
"patterns": [
|
258
|
+
{
|
259
|
+
"begin": "(?=(\\s*\\}|\\\"|\\binherit\\b|\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*(\\s*\\.|\\s*=[^=])))",
|
260
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
261
|
+
"patterns": [
|
262
|
+
{
|
263
|
+
"include": "#attrset-definition-brace-opened"
|
264
|
+
}
|
265
|
+
]
|
266
|
+
},
|
267
|
+
{
|
268
|
+
"begin": "(?=(\\.\\.\\.|\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*\\s*[,?]))",
|
269
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
270
|
+
"patterns": [
|
271
|
+
{
|
272
|
+
"include": "#function-definition-brace-opened"
|
273
|
+
}
|
274
|
+
]
|
275
|
+
},
|
276
|
+
{
|
277
|
+
"include": "#bad-reserved"
|
278
|
+
},
|
279
|
+
{
|
280
|
+
"begin": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*",
|
281
|
+
"beginCaptures": {
|
282
|
+
"0": {
|
283
|
+
"name": "variable.parameter.function.maybe.nix"
|
284
|
+
}
|
285
|
+
},
|
286
|
+
"end": "(?=([\\])};]|\\b(else|then)\\b))",
|
287
|
+
"patterns": [
|
288
|
+
{
|
289
|
+
"begin": "(?=\\.)",
|
290
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
291
|
+
"patterns": [
|
292
|
+
{
|
293
|
+
"include": "#attrset-definition-brace-opened"
|
294
|
+
}
|
295
|
+
]
|
296
|
+
},
|
297
|
+
{
|
298
|
+
"begin": "\\s*(\\,)",
|
299
|
+
"beginCaptures": {
|
300
|
+
"1": {
|
301
|
+
"name": "keyword.operator.nix"
|
302
|
+
}
|
303
|
+
},
|
304
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
305
|
+
"patterns": [
|
306
|
+
{
|
307
|
+
"include": "#function-definition-brace-opened"
|
308
|
+
}
|
309
|
+
]
|
310
|
+
},
|
311
|
+
{
|
312
|
+
"begin": "(?=\\=)",
|
313
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
314
|
+
"patterns": [
|
315
|
+
{
|
316
|
+
"include": "#attribute-bind-from-equals"
|
317
|
+
},
|
318
|
+
{
|
319
|
+
"include": "#attrset-definition-brace-opened"
|
320
|
+
}
|
321
|
+
]
|
322
|
+
},
|
323
|
+
{
|
324
|
+
"begin": "(?=\\?)",
|
325
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
326
|
+
"patterns": [
|
327
|
+
{
|
328
|
+
"include": "#function-parameter-default"
|
329
|
+
},
|
330
|
+
{
|
331
|
+
"begin": "\\,",
|
332
|
+
"beginCaptures": {
|
333
|
+
"0": {
|
334
|
+
"name": "keyword.operator.nix"
|
335
|
+
}
|
336
|
+
},
|
337
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
338
|
+
"patterns": [
|
339
|
+
{
|
340
|
+
"include": "#function-definition-brace-opened"
|
341
|
+
}
|
342
|
+
]
|
343
|
+
}
|
344
|
+
]
|
345
|
+
},
|
346
|
+
{
|
347
|
+
"include": "#others"
|
348
|
+
}
|
349
|
+
]
|
350
|
+
},
|
351
|
+
{
|
352
|
+
"include": "#others"
|
353
|
+
}
|
354
|
+
]
|
355
|
+
},
|
356
|
+
"bad-reserved": {
|
357
|
+
"match": "\\b(if|then|else|assert|with|let|in|rec|inherit)\\b",
|
358
|
+
"name": "invalid.illegal.reserved.nix"
|
359
|
+
},
|
360
|
+
"comment": {
|
361
|
+
"patterns": [
|
362
|
+
{
|
363
|
+
"begin": "/\\*([^*]|\\*[^\\/])*",
|
364
|
+
"end": "\\*\\/",
|
365
|
+
"name": "comment.block.nix",
|
366
|
+
"patterns": [
|
367
|
+
{
|
368
|
+
"include": "#comment-remark"
|
369
|
+
}
|
370
|
+
]
|
371
|
+
},
|
372
|
+
{
|
373
|
+
"begin": "\\#",
|
374
|
+
"end": "$",
|
375
|
+
"name": "comment.line.number-sign.nix",
|
376
|
+
"patterns": [
|
377
|
+
{
|
378
|
+
"include": "#comment-remark"
|
379
|
+
}
|
380
|
+
]
|
381
|
+
}
|
382
|
+
]
|
383
|
+
},
|
384
|
+
"comment-remark": {
|
385
|
+
"captures": {
|
386
|
+
"1": {
|
387
|
+
"name": "markup.bold.comment.nix"
|
388
|
+
}
|
389
|
+
},
|
390
|
+
"match": "(TODO|FIXME|BUG|\\!\\!\\!):?"
|
391
|
+
},
|
392
|
+
"constants": {
|
393
|
+
"patterns": [
|
394
|
+
{
|
395
|
+
"begin": "\\b(builtins|true|false|null)\\b",
|
396
|
+
"beginCaptures": {
|
397
|
+
"0": {
|
398
|
+
"name": "constant.language.nix"
|
399
|
+
}
|
400
|
+
},
|
401
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
402
|
+
"patterns": [
|
403
|
+
{
|
404
|
+
"include": "#expression-cont"
|
405
|
+
}
|
406
|
+
]
|
407
|
+
},
|
408
|
+
{
|
409
|
+
"begin": "\\b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\\b",
|
410
|
+
"beginCaptures": {
|
411
|
+
"0": {
|
412
|
+
"name": "support.function.nix"
|
413
|
+
}
|
414
|
+
},
|
415
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
416
|
+
"patterns": [
|
417
|
+
{
|
418
|
+
"include": "#expression-cont"
|
419
|
+
}
|
420
|
+
]
|
421
|
+
},
|
422
|
+
{
|
423
|
+
"begin": "\\b[0-9]+\\b",
|
424
|
+
"beginCaptures": {
|
425
|
+
"0": {
|
426
|
+
"name": "constant.numeric.nix"
|
427
|
+
}
|
428
|
+
},
|
429
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
430
|
+
"patterns": [
|
431
|
+
{
|
432
|
+
"include": "#expression-cont"
|
433
|
+
}
|
434
|
+
]
|
435
|
+
}
|
436
|
+
]
|
437
|
+
},
|
438
|
+
"expression": {
|
439
|
+
"patterns": [
|
440
|
+
{
|
441
|
+
"include": "#parens-and-cont"
|
442
|
+
},
|
443
|
+
{
|
444
|
+
"include": "#list-and-cont"
|
445
|
+
},
|
446
|
+
{
|
447
|
+
"include": "#string"
|
448
|
+
},
|
449
|
+
{
|
450
|
+
"include": "#interpolation"
|
451
|
+
},
|
452
|
+
{
|
453
|
+
"include": "#with-assert"
|
454
|
+
},
|
455
|
+
{
|
456
|
+
"include": "#function-for-sure"
|
457
|
+
},
|
458
|
+
{
|
459
|
+
"include": "#attrset-for-sure"
|
460
|
+
},
|
461
|
+
{
|
462
|
+
"include": "#attrset-or-function"
|
463
|
+
},
|
464
|
+
{
|
465
|
+
"include": "#let"
|
466
|
+
},
|
467
|
+
{
|
468
|
+
"include": "#if"
|
469
|
+
},
|
470
|
+
{
|
471
|
+
"include": "#operator-unary"
|
472
|
+
},
|
473
|
+
{
|
474
|
+
"include": "#constants"
|
475
|
+
},
|
476
|
+
{
|
477
|
+
"include": "#bad-reserved"
|
478
|
+
},
|
479
|
+
{
|
480
|
+
"include": "#parameter-name-and-cont"
|
481
|
+
},
|
482
|
+
{
|
483
|
+
"include": "#others"
|
484
|
+
}
|
485
|
+
]
|
486
|
+
},
|
487
|
+
"expression-cont": {
|
488
|
+
"begin": "(?=.?)",
|
489
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
490
|
+
"patterns": [
|
491
|
+
{
|
492
|
+
"include": "#parens"
|
493
|
+
},
|
494
|
+
{
|
495
|
+
"include": "#list"
|
496
|
+
},
|
497
|
+
{
|
498
|
+
"include": "#string"
|
499
|
+
},
|
500
|
+
{
|
501
|
+
"include": "#interpolation"
|
502
|
+
},
|
503
|
+
{
|
504
|
+
"include": "#function-for-sure"
|
505
|
+
},
|
506
|
+
{
|
507
|
+
"include": "#attrset-for-sure"
|
508
|
+
},
|
509
|
+
{
|
510
|
+
"include": "#attrset-or-function"
|
511
|
+
},
|
512
|
+
{
|
513
|
+
"match": "(\\bor\\b|\\.|==|!=|!|\\<\\=|\\<|\\>\\=|\\>|&&|\\|\\||-\\>|//|\\?|\\+\\+|-|\\*|/(?=([^*]|$))|\\+)",
|
514
|
+
"name": "keyword.operator.nix"
|
515
|
+
},
|
516
|
+
{
|
517
|
+
"include": "#constants"
|
518
|
+
},
|
519
|
+
{
|
520
|
+
"include": "#bad-reserved"
|
521
|
+
},
|
522
|
+
{
|
523
|
+
"include": "#parameter-name"
|
524
|
+
},
|
525
|
+
{
|
526
|
+
"include": "#others"
|
527
|
+
}
|
528
|
+
]
|
529
|
+
},
|
530
|
+
"function-body": {
|
531
|
+
"begin": "(@\\s*([a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*)\\s*)?(\\:)",
|
532
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
533
|
+
"patterns": [
|
534
|
+
{
|
535
|
+
"include": "#expression"
|
536
|
+
}
|
537
|
+
]
|
538
|
+
},
|
539
|
+
"function-body-from-colon": {
|
540
|
+
"begin": "(\\:)",
|
541
|
+
"beginCaptures": {
|
542
|
+
"0": {
|
543
|
+
"name": "punctuation.definition.function.nix"
|
544
|
+
}
|
545
|
+
},
|
546
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
547
|
+
"patterns": [
|
548
|
+
{
|
549
|
+
"include": "#expression"
|
550
|
+
}
|
551
|
+
]
|
552
|
+
},
|
553
|
+
"function-contents": {
|
554
|
+
"patterns": [
|
555
|
+
{
|
556
|
+
"include": "#bad-reserved"
|
557
|
+
},
|
558
|
+
{
|
559
|
+
"include": "#function-parameter"
|
560
|
+
},
|
561
|
+
{
|
562
|
+
"include": "#others"
|
563
|
+
}
|
564
|
+
]
|
565
|
+
},
|
566
|
+
"function-definition": {
|
567
|
+
"begin": "(?=.?)",
|
568
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
569
|
+
"patterns": [
|
570
|
+
{
|
571
|
+
"include": "#function-body-from-colon"
|
572
|
+
},
|
573
|
+
{
|
574
|
+
"begin": "(?=.?)",
|
575
|
+
"end": "(?=\\:)",
|
576
|
+
"patterns": [
|
577
|
+
{
|
578
|
+
"begin": "(\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*)",
|
579
|
+
"beginCaptures": {
|
580
|
+
"0": {
|
581
|
+
"name": "variable.parameter.function.4.nix"
|
582
|
+
}
|
583
|
+
},
|
584
|
+
"end": "(?=\\:)",
|
585
|
+
"patterns": [
|
586
|
+
{
|
587
|
+
"begin": "\\@",
|
588
|
+
"end": "(?=\\:)",
|
589
|
+
"patterns": [
|
590
|
+
{
|
591
|
+
"include": "#function-header-until-colon-no-arg"
|
592
|
+
},
|
593
|
+
{
|
594
|
+
"include": "#others"
|
595
|
+
}
|
596
|
+
]
|
597
|
+
},
|
598
|
+
{
|
599
|
+
"include": "#others"
|
600
|
+
}
|
601
|
+
]
|
602
|
+
},
|
603
|
+
{
|
604
|
+
"begin": "(?=\\{)",
|
605
|
+
"end": "(?=\\:)",
|
606
|
+
"patterns": [
|
607
|
+
{
|
608
|
+
"include": "#function-header-until-colon-with-arg"
|
609
|
+
}
|
610
|
+
]
|
611
|
+
}
|
612
|
+
]
|
613
|
+
},
|
614
|
+
{
|
615
|
+
"include": "#others"
|
616
|
+
}
|
617
|
+
]
|
618
|
+
},
|
619
|
+
"function-definition-brace-opened": {
|
620
|
+
"begin": "(?=.?)",
|
621
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
622
|
+
"patterns": [
|
623
|
+
{
|
624
|
+
"include": "#function-body-from-colon"
|
625
|
+
},
|
626
|
+
{
|
627
|
+
"begin": "(?=.?)",
|
628
|
+
"end": "(?=\\:)",
|
629
|
+
"patterns": [
|
630
|
+
{
|
631
|
+
"include": "#function-header-close-brace-with-arg"
|
632
|
+
},
|
633
|
+
{
|
634
|
+
"begin": "(?=.?)",
|
635
|
+
"end": "(?=\\})",
|
636
|
+
"patterns": [
|
637
|
+
{
|
638
|
+
"include": "#function-contents"
|
639
|
+
}
|
640
|
+
]
|
641
|
+
}
|
642
|
+
]
|
643
|
+
},
|
644
|
+
{
|
645
|
+
"include": "#others"
|
646
|
+
}
|
647
|
+
]
|
648
|
+
},
|
649
|
+
"function-for-sure": {
|
650
|
+
"patterns": [
|
651
|
+
{
|
652
|
+
"begin": "(?=(\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*\\s*[:@]|\\{[^}]*\\}\\s*:|\\{[^#}\"'/=]*[,\\?]))",
|
653
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
654
|
+
"patterns": [
|
655
|
+
{
|
656
|
+
"include": "#function-definition"
|
657
|
+
}
|
658
|
+
]
|
659
|
+
}
|
660
|
+
]
|
661
|
+
},
|
662
|
+
"function-header-close-brace-no-arg": {
|
663
|
+
"begin": "\\}",
|
664
|
+
"beginCaptures": {
|
665
|
+
"0": {
|
666
|
+
"name": "punctuation.definition.entity.function.nix"
|
667
|
+
}
|
668
|
+
},
|
669
|
+
"end": "(?=\\:)",
|
670
|
+
"patterns": [
|
671
|
+
{
|
672
|
+
"include": "#others"
|
673
|
+
}
|
674
|
+
]
|
675
|
+
},
|
676
|
+
"function-header-close-brace-with-arg": {
|
677
|
+
"begin": "\\}",
|
678
|
+
"beginCaptures": {
|
679
|
+
"0": {
|
680
|
+
"name": "punctuation.definition.entity.function.nix"
|
681
|
+
}
|
682
|
+
},
|
683
|
+
"end": "(?=\\:)",
|
684
|
+
"patterns": [
|
685
|
+
{
|
686
|
+
"include": "#function-header-terminal-arg"
|
687
|
+
},
|
688
|
+
{
|
689
|
+
"include": "#others"
|
690
|
+
}
|
691
|
+
]
|
692
|
+
},
|
693
|
+
"function-header-open-brace": {
|
694
|
+
"begin": "\\{",
|
695
|
+
"beginCaptures": {
|
696
|
+
"0": {
|
697
|
+
"name": "punctuation.definition.entity.function.2.nix"
|
698
|
+
}
|
699
|
+
},
|
700
|
+
"end": "(?=\\})",
|
701
|
+
"patterns": [
|
702
|
+
{
|
703
|
+
"include": "#function-contents"
|
704
|
+
}
|
705
|
+
]
|
706
|
+
},
|
707
|
+
"function-header-terminal-arg": {
|
708
|
+
"begin": "(?=@)",
|
709
|
+
"end": "(?=\\:)",
|
710
|
+
"patterns": [
|
711
|
+
{
|
712
|
+
"begin": "\\@",
|
713
|
+
"end": "(?=\\:)",
|
714
|
+
"patterns": [
|
715
|
+
{
|
716
|
+
"begin": "(\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*)",
|
717
|
+
"end": "(?=\\:)",
|
718
|
+
"name": "variable.parameter.function.3.nix"
|
719
|
+
},
|
720
|
+
{
|
721
|
+
"include": "#others"
|
722
|
+
}
|
723
|
+
]
|
724
|
+
},
|
725
|
+
{
|
726
|
+
"include": "#others"
|
727
|
+
}
|
728
|
+
]
|
729
|
+
},
|
730
|
+
"function-header-until-colon-no-arg": {
|
731
|
+
"begin": "(?=\\{)",
|
732
|
+
"end": "(?=\\:)",
|
733
|
+
"patterns": [
|
734
|
+
{
|
735
|
+
"include": "#function-header-open-brace"
|
736
|
+
},
|
737
|
+
{
|
738
|
+
"include": "#function-header-close-brace-no-arg"
|
739
|
+
}
|
740
|
+
]
|
741
|
+
},
|
742
|
+
"function-header-until-colon-with-arg": {
|
743
|
+
"begin": "(?=\\{)",
|
744
|
+
"end": "(?=\\:)",
|
745
|
+
"patterns": [
|
746
|
+
{
|
747
|
+
"include": "#function-header-open-brace"
|
748
|
+
},
|
749
|
+
{
|
750
|
+
"include": "#function-header-close-brace-with-arg"
|
751
|
+
}
|
752
|
+
]
|
753
|
+
},
|
754
|
+
"function-parameter": {
|
755
|
+
"patterns": [
|
756
|
+
{
|
757
|
+
"begin": "(\\.\\.\\.)",
|
758
|
+
"end": "(,|(?=\\}))",
|
759
|
+
"name": "keyword.operator.nix",
|
760
|
+
"patterns": [
|
761
|
+
{
|
762
|
+
"include": "#others"
|
763
|
+
}
|
764
|
+
]
|
765
|
+
},
|
766
|
+
{
|
767
|
+
"begin": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*",
|
768
|
+
"beginCaptures": {
|
769
|
+
"0": {
|
770
|
+
"name": "variable.parameter.function.1.nix"
|
771
|
+
}
|
772
|
+
},
|
773
|
+
"end": "(,|(?=\\}))",
|
774
|
+
"endCaptures": {
|
775
|
+
"0": {
|
776
|
+
"name": "keyword.operator.nix"
|
777
|
+
}
|
778
|
+
},
|
779
|
+
"patterns": [
|
780
|
+
{
|
781
|
+
"include": "#whitespace"
|
782
|
+
},
|
783
|
+
{
|
784
|
+
"include": "#comment"
|
785
|
+
},
|
786
|
+
{
|
787
|
+
"include": "#function-parameter-default"
|
788
|
+
},
|
789
|
+
{
|
790
|
+
"include": "#expression"
|
791
|
+
}
|
792
|
+
]
|
793
|
+
},
|
794
|
+
{
|
795
|
+
"include": "#others"
|
796
|
+
}
|
797
|
+
]
|
798
|
+
},
|
799
|
+
"function-parameter-default": {
|
800
|
+
"begin": "\\?",
|
801
|
+
"beginCaptures": {
|
802
|
+
"0": {
|
803
|
+
"name": "keyword.operator.nix"
|
804
|
+
}
|
805
|
+
},
|
806
|
+
"end": "(?=[,}])",
|
807
|
+
"patterns": [
|
808
|
+
{
|
809
|
+
"include": "#expression"
|
810
|
+
}
|
811
|
+
]
|
812
|
+
},
|
813
|
+
"if": {
|
814
|
+
"begin": "(?=\\bif\\b)",
|
815
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
816
|
+
"patterns": [
|
817
|
+
{
|
818
|
+
"begin": "\\bif\\b",
|
819
|
+
"beginCaptures": {
|
820
|
+
"0": {
|
821
|
+
"name": "keyword.other.nix"
|
822
|
+
}
|
823
|
+
},
|
824
|
+
"end": "\\bth(?=en\\b)",
|
825
|
+
"endCaptures": {
|
826
|
+
"0": {
|
827
|
+
"name": "keyword.other.nix"
|
828
|
+
}
|
829
|
+
},
|
830
|
+
"patterns": [
|
831
|
+
{
|
832
|
+
"include": "#expression"
|
833
|
+
}
|
834
|
+
]
|
835
|
+
},
|
836
|
+
{
|
837
|
+
"begin": "(?<=th)en\\b",
|
838
|
+
"beginCaptures": {
|
839
|
+
"0": {
|
840
|
+
"name": "keyword.other.nix"
|
841
|
+
}
|
842
|
+
},
|
843
|
+
"end": "\\bel(?=se\\b)",
|
844
|
+
"endCaptures": {
|
845
|
+
"0": {
|
846
|
+
"name": "keyword.other.nix"
|
847
|
+
}
|
848
|
+
},
|
849
|
+
"patterns": [
|
850
|
+
{
|
851
|
+
"include": "#expression"
|
852
|
+
}
|
853
|
+
]
|
854
|
+
},
|
855
|
+
{
|
856
|
+
"begin": "(?<=el)se\\b",
|
857
|
+
"beginCaptures": {
|
858
|
+
"0": {
|
859
|
+
"name": "keyword.other.nix"
|
860
|
+
}
|
861
|
+
},
|
862
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
863
|
+
"endCaptures": {
|
864
|
+
"0": {
|
865
|
+
"name": "keyword.other.nix"
|
866
|
+
}
|
867
|
+
},
|
868
|
+
"patterns": [
|
869
|
+
{
|
870
|
+
"include": "#expression"
|
871
|
+
}
|
872
|
+
]
|
873
|
+
}
|
874
|
+
]
|
875
|
+
},
|
876
|
+
"illegal": {
|
877
|
+
"match": ".",
|
878
|
+
"name": "invalid.illegal"
|
879
|
+
},
|
880
|
+
"interpolation": {
|
881
|
+
"begin": "\\$\\{",
|
882
|
+
"beginCaptures": {
|
883
|
+
"0": {
|
884
|
+
"name": "punctuation.section.embedded.begin.nix"
|
885
|
+
}
|
886
|
+
},
|
887
|
+
"end": "\\}",
|
888
|
+
"endCaptures": {
|
889
|
+
"0": {
|
890
|
+
"name": "punctuation.section.embedded.end.nix"
|
891
|
+
}
|
892
|
+
},
|
893
|
+
"name": "markup.italic",
|
894
|
+
"patterns": [
|
895
|
+
{
|
896
|
+
"include": "#expression"
|
897
|
+
}
|
898
|
+
]
|
899
|
+
},
|
900
|
+
"let": {
|
901
|
+
"begin": "(?=\\blet\\b)",
|
902
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
903
|
+
"patterns": [
|
904
|
+
{
|
905
|
+
"begin": "\\blet\\b",
|
906
|
+
"beginCaptures": {
|
907
|
+
"0": {
|
908
|
+
"name": "keyword.other.nix"
|
909
|
+
}
|
910
|
+
},
|
911
|
+
"end": "(?=([\\])};,]|\\b(in|else|then)\\b))",
|
912
|
+
"patterns": [
|
913
|
+
{
|
914
|
+
"begin": "(?=\\{)",
|
915
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
916
|
+
"patterns": [
|
917
|
+
{
|
918
|
+
"begin": "\\{",
|
919
|
+
"end": "\\}",
|
920
|
+
"patterns": [
|
921
|
+
{
|
922
|
+
"include": "#attrset-contents"
|
923
|
+
}
|
924
|
+
]
|
925
|
+
},
|
926
|
+
{
|
927
|
+
"begin": "(^|(?<=\\}))",
|
928
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
929
|
+
"patterns": [
|
930
|
+
{
|
931
|
+
"include": "#expression-cont"
|
932
|
+
}
|
933
|
+
]
|
934
|
+
},
|
935
|
+
{
|
936
|
+
"include": "#others"
|
937
|
+
}
|
938
|
+
]
|
939
|
+
},
|
940
|
+
{
|
941
|
+
"include": "#attrset-contents"
|
942
|
+
},
|
943
|
+
{
|
944
|
+
"include": "#others"
|
945
|
+
}
|
946
|
+
]
|
947
|
+
},
|
948
|
+
{
|
949
|
+
"begin": "\\bin\\b",
|
950
|
+
"beginCaptures": {
|
951
|
+
"0": {
|
952
|
+
"name": "keyword.other.nix"
|
953
|
+
}
|
954
|
+
},
|
955
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
956
|
+
"patterns": [
|
957
|
+
{
|
958
|
+
"include": "#expression"
|
959
|
+
}
|
960
|
+
]
|
961
|
+
}
|
962
|
+
]
|
963
|
+
},
|
964
|
+
"list": {
|
965
|
+
"begin": "\\[",
|
966
|
+
"beginCaptures": {
|
967
|
+
"0": {
|
968
|
+
"name": "punctuation.definition.list.nix"
|
969
|
+
}
|
970
|
+
},
|
971
|
+
"end": "\\]",
|
972
|
+
"endCaptures": {
|
973
|
+
"0": {
|
974
|
+
"name": "punctuation.definition.list.nix"
|
975
|
+
}
|
976
|
+
},
|
977
|
+
"patterns": [
|
978
|
+
{
|
979
|
+
"include": "#expression"
|
980
|
+
}
|
981
|
+
]
|
982
|
+
},
|
983
|
+
"list-and-cont": {
|
984
|
+
"begin": "(?=\\[)",
|
985
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
986
|
+
"patterns": [
|
987
|
+
{
|
988
|
+
"include": "#list"
|
989
|
+
},
|
990
|
+
{
|
991
|
+
"include": "#expression-cont"
|
992
|
+
}
|
993
|
+
]
|
994
|
+
},
|
995
|
+
"operator-unary": {
|
996
|
+
"match": "(!|-)",
|
997
|
+
"name": "keyword.operator.unary.nix"
|
998
|
+
},
|
999
|
+
"others": {
|
1000
|
+
"patterns": [
|
1001
|
+
{
|
1002
|
+
"include": "#whitespace"
|
1003
|
+
},
|
1004
|
+
{
|
1005
|
+
"include": "#comment"
|
1006
|
+
},
|
1007
|
+
{
|
1008
|
+
"include": "#illegal"
|
1009
|
+
}
|
1010
|
+
]
|
1011
|
+
},
|
1012
|
+
"parameter-name": {
|
1013
|
+
"captures": {
|
1014
|
+
"0": {
|
1015
|
+
"name": "variable.parameter.name.nix"
|
1016
|
+
}
|
1017
|
+
},
|
1018
|
+
"match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*"
|
1019
|
+
},
|
1020
|
+
"parameter-name-and-cont": {
|
1021
|
+
"begin": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*",
|
1022
|
+
"beginCaptures": {
|
1023
|
+
"0": {
|
1024
|
+
"name": "variable.parameter.name.nix"
|
1025
|
+
}
|
1026
|
+
},
|
1027
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
1028
|
+
"patterns": [
|
1029
|
+
{
|
1030
|
+
"include": "#expression-cont"
|
1031
|
+
}
|
1032
|
+
]
|
1033
|
+
},
|
1034
|
+
"parens": {
|
1035
|
+
"begin": "\\(",
|
1036
|
+
"beginCaptures": {
|
1037
|
+
"0": {
|
1038
|
+
"name": "punctuation.definition.expression.nix"
|
1039
|
+
}
|
1040
|
+
},
|
1041
|
+
"end": "\\)",
|
1042
|
+
"endCaptures": {
|
1043
|
+
"0": {
|
1044
|
+
"name": "punctuation.definition.expression.nix"
|
1045
|
+
}
|
1046
|
+
},
|
1047
|
+
"patterns": [
|
1048
|
+
{
|
1049
|
+
"include": "#expression"
|
1050
|
+
}
|
1051
|
+
]
|
1052
|
+
},
|
1053
|
+
"parens-and-cont": {
|
1054
|
+
"begin": "(?=\\()",
|
1055
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
1056
|
+
"patterns": [
|
1057
|
+
{
|
1058
|
+
"include": "#parens"
|
1059
|
+
},
|
1060
|
+
{
|
1061
|
+
"include": "#expression-cont"
|
1062
|
+
}
|
1063
|
+
]
|
1064
|
+
},
|
1065
|
+
"string": {
|
1066
|
+
"patterns": [
|
1067
|
+
{
|
1068
|
+
"begin": "(?=\\'\\')",
|
1069
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
1070
|
+
"patterns": [
|
1071
|
+
{
|
1072
|
+
"begin": "\\'\\'",
|
1073
|
+
"beginCaptures": {
|
1074
|
+
"0": {
|
1075
|
+
"name": "punctuation.definition.string.other.start.nix"
|
1076
|
+
}
|
1077
|
+
},
|
1078
|
+
"end": "\\'\\'(?!\\$|\\'|\\\\.)",
|
1079
|
+
"endCaptures": {
|
1080
|
+
"0": {
|
1081
|
+
"name": "punctuation.definition.string.other.end.nix"
|
1082
|
+
}
|
1083
|
+
},
|
1084
|
+
"name": "string.quoted.other.nix",
|
1085
|
+
"patterns": [
|
1086
|
+
{
|
1087
|
+
"match": "\\'\\'(\\$|\\'|\\\\.)",
|
1088
|
+
"name": "constant.character.escape.nix"
|
1089
|
+
},
|
1090
|
+
{
|
1091
|
+
"include": "#interpolation"
|
1092
|
+
}
|
1093
|
+
]
|
1094
|
+
},
|
1095
|
+
{
|
1096
|
+
"include": "#expression-cont"
|
1097
|
+
}
|
1098
|
+
]
|
1099
|
+
},
|
1100
|
+
{
|
1101
|
+
"begin": "(?=\\\")",
|
1102
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
1103
|
+
"patterns": [
|
1104
|
+
{
|
1105
|
+
"include": "#string-quoted"
|
1106
|
+
},
|
1107
|
+
{
|
1108
|
+
"include": "#expression-cont"
|
1109
|
+
}
|
1110
|
+
]
|
1111
|
+
},
|
1112
|
+
{
|
1113
|
+
"begin": "([a-zA-Z0-9\\.\\_\\-\\+]*(\\/[a-zA-Z0-9\\.\\_\\-\\+]+)+)",
|
1114
|
+
"beginCaptures": {
|
1115
|
+
"0": {
|
1116
|
+
"name": "string.unquoted.path.nix"
|
1117
|
+
}
|
1118
|
+
},
|
1119
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
1120
|
+
"patterns": [
|
1121
|
+
{
|
1122
|
+
"include": "#expression-cont"
|
1123
|
+
}
|
1124
|
+
]
|
1125
|
+
},
|
1126
|
+
{
|
1127
|
+
"begin": "(\\<[a-zA-Z0-9\\.\\_\\-\\+]+(\\/[a-zA-Z0-9\\.\\_\\-\\+]+)*\\>)",
|
1128
|
+
"beginCaptures": {
|
1129
|
+
"0": {
|
1130
|
+
"name": "string.unquoted.spath.nix"
|
1131
|
+
}
|
1132
|
+
},
|
1133
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
1134
|
+
"patterns": [
|
1135
|
+
{
|
1136
|
+
"include": "#expression-cont"
|
1137
|
+
}
|
1138
|
+
]
|
1139
|
+
},
|
1140
|
+
{
|
1141
|
+
"begin": "([a-zA-Z][a-zA-Z0-9\\+\\-\\.]*\\:[a-zA-Z0-9\\%\\/\\?\\:\\@\\&\\=\\+\\$\\,\\-\\_\\.\\!\\~\\*\\']+)",
|
1142
|
+
"beginCaptures": {
|
1143
|
+
"0": {
|
1144
|
+
"name": "string.unquoted.url.nix"
|
1145
|
+
}
|
1146
|
+
},
|
1147
|
+
"end": "(?=([\\])};,]|\\b(else|then)\\b))",
|
1148
|
+
"patterns": [
|
1149
|
+
{
|
1150
|
+
"include": "#expression-cont"
|
1151
|
+
}
|
1152
|
+
]
|
1153
|
+
}
|
1154
|
+
]
|
1155
|
+
},
|
1156
|
+
"string-quoted": {
|
1157
|
+
"begin": "\\\"",
|
1158
|
+
"beginCaptures": {
|
1159
|
+
"0": {
|
1160
|
+
"name": "punctuation.definition.string.double.start.nix"
|
1161
|
+
}
|
1162
|
+
},
|
1163
|
+
"end": "\\\"",
|
1164
|
+
"endCaptures": {
|
1165
|
+
"0": {
|
1166
|
+
"name": "punctuation.definition.string.double.end.nix"
|
1167
|
+
}
|
1168
|
+
},
|
1169
|
+
"name": "string.quoted.double.nix",
|
1170
|
+
"patterns": [
|
1171
|
+
{
|
1172
|
+
"match": "\\\\.",
|
1173
|
+
"name": "constant.character.escape.nix"
|
1174
|
+
},
|
1175
|
+
{
|
1176
|
+
"include": "#interpolation"
|
1177
|
+
}
|
1178
|
+
]
|
1179
|
+
},
|
1180
|
+
"whitespace": {
|
1181
|
+
"match": "\\s+"
|
1182
|
+
},
|
1183
|
+
"with-assert": {
|
1184
|
+
"begin": "\\b(with|assert)\\b",
|
1185
|
+
"beginCaptures": {
|
1186
|
+
"0": {
|
1187
|
+
"name": "keyword.other.nix"
|
1188
|
+
}
|
1189
|
+
},
|
1190
|
+
"end": "\\;",
|
1191
|
+
"patterns": [
|
1192
|
+
{
|
1193
|
+
"include": "#expression"
|
1194
|
+
}
|
1195
|
+
]
|
1196
|
+
}
|
1197
|
+
},
|
1198
|
+
"scopeName": "source.nix",
|
1199
|
+
"uuid": "0514fd5f-acb6-436d-b42c-7643e6d36c8f"
|
1200
|
+
}
|