github-linguist 7.5.1 → 7.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/annotation.liquidhaskell.haskell.json +122 -24
  3. data/grammars/etc.json +7 -0
  4. data/grammars/hint.haskell.json +122 -24
  5. data/grammars/hint.message.haskell.json +122 -24
  6. data/grammars/hint.type.haskell.json +122 -24
  7. data/grammars/injections.etc.json +48 -10
  8. data/grammars/source.abnf.json +180 -353
  9. data/grammars/source.ballerina.json +205 -50
  10. data/grammars/source.bnf.json +191 -0
  11. data/grammars/source.cabal.json +1 -1
  12. data/grammars/source.ditroff.desc.json +1 -1
  13. data/grammars/source.ebnf.json +157 -147
  14. data/grammars/source.editorconfig.json +30 -5
  15. data/grammars/source.emacs.lisp.json +4 -4
  16. data/grammars/source.gremlin.json +200 -0
  17. data/grammars/source.haproxy-config.json +65 -13
  18. data/grammars/source.haskell.json +122 -24
  19. data/grammars/source.hql.json +1 -1
  20. data/grammars/source.hsig.json +122 -24
  21. data/grammars/source.hx.json +5 -5
  22. data/grammars/source.hxml.json +4 -4
  23. data/grammars/source.ideal.json +4 -4
  24. data/grammars/source.igor.json +325 -0
  25. data/grammars/source.jlex.json +322 -0
  26. data/grammars/source.julia.json +132 -1
  27. data/grammars/source.lean.json +103 -54
  28. data/grammars/source.lex.json +232 -0
  29. data/grammars/source.lex.regexp.json +269 -0
  30. data/grammars/source.logos.json +1 -1
  31. data/grammars/source.meson.json +1 -1
  32. data/grammars/source.mlir.json +389 -0
  33. data/grammars/source.nanorc.json +3 -0
  34. data/grammars/source.pic.json +19 -19
  35. data/grammars/source.plist.json +336 -0
  36. data/grammars/source.powershell.json +2 -2
  37. data/grammars/source.purescript.json +2 -2
  38. data/grammars/source.rascal.json +1 -0
  39. data/grammars/source.regexp.extended.json +544 -6
  40. data/grammars/source.regexp.json +408 -31
  41. data/grammars/source.renpy.json +3 -1
  42. data/grammars/source.scala.json +199 -97
  43. data/grammars/source.smpl.json +314 -0
  44. data/grammars/source.solidity.json +1 -1
  45. data/grammars/source.sourcepawn.json +654 -0
  46. data/grammars/source.sqf.json +5 -1
  47. data/grammars/source.swift.json +56 -11
  48. data/grammars/source.sy.json +800 -0
  49. data/grammars/source.ts.json +64 -47
  50. data/grammars/source.tsx.json +65 -48
  51. data/grammars/source.v.json +1184 -0
  52. data/grammars/source.viml.json +31 -31
  53. data/grammars/source.wollok.json +1 -1
  54. data/grammars/source.xojo.json +2 -2
  55. data/grammars/source.yacc.json +626 -0
  56. data/grammars/source.yara.json +1 -1
  57. data/grammars/source.yasnippet.json +15 -25
  58. data/grammars/source.zeek.json +4 -4
  59. data/grammars/source.zig.json +594 -195
  60. data/grammars/text.eml.basic.json +19 -6
  61. data/grammars/text.html.php.blade.json +3 -3
  62. data/grammars/text.plain.json +18 -0
  63. data/grammars/text.roff.json +926 -437
  64. data/grammars/text.runoff.json +3 -3
  65. data/grammars/text.tex.latex.haskell.json +122 -24
  66. data/grammars/text.texinfo.json +1525 -0
  67. data/grammars/text.xml.plist.json +664 -0
  68. data/grammars/text.xml.svg.json +556 -0
  69. data/grammars/version +1 -1
  70. data/lib/linguist.rb +3 -1
  71. data/lib/linguist/VERSION +1 -1
  72. data/lib/linguist/generated.rb +62 -17
  73. data/lib/linguist/heuristics.yml +13 -0
  74. data/lib/linguist/language.rb +1 -11
  75. data/lib/linguist/languages.json +1 -1
  76. data/lib/linguist/languages.yml +179 -19
  77. data/lib/linguist/samples.json +2778 -732
  78. data/lib/linguist/strategy/manpage.rb +42 -0
  79. metadata +22 -5
  80. data/grammars/source.bison.json +0 -55
  81. data/grammars/source.sp.json +0 -113
@@ -0,0 +1,1184 @@
1
+ {
2
+ "name": "v",
3
+ "scopeName": "source.v",
4
+ "patterns": [
5
+ {
6
+ "name": "meta.definition.module.v",
7
+ "begin": "^\\s*(module)\\s+",
8
+ "end": "([0-9a-zA-Z_]*)",
9
+ "beginCaptures": {
10
+ "1": {
11
+ "name": "keyword.module.v"
12
+ }
13
+ },
14
+ "endCaptures": {
15
+ "1": {
16
+ "name": "entity.name.module.v"
17
+ }
18
+ }
19
+ },
20
+ {
21
+ "name": "meta.definition.import.v",
22
+ "begin": "^\\s*(import)\\s+",
23
+ "end": "([0-9a-zA-Z_.]*)",
24
+ "beginCaptures": {
25
+ "1": {
26
+ "name": "keyword.import.v"
27
+ }
28
+ },
29
+ "endCaptures": {
30
+ "1": {
31
+ "name": "entity.name.import.v"
32
+ }
33
+ }
34
+ },
35
+ {
36
+ "name": "meta.definition.include.v",
37
+ "begin": "^\\s*(#include)",
38
+ "end": "\\s+([\\\u003c\"])\\s*(.*)([\\\u003e\"])",
39
+ "beginCaptures": {
40
+ "1": {
41
+ "name": "keyword.include.v"
42
+ }
43
+ },
44
+ "endCaptures": {
45
+ "1": {
46
+ "name": "string.quoted.double.v"
47
+ },
48
+ "2": {
49
+ "name": "string.quoted.double.v"
50
+ },
51
+ "3": {
52
+ "name": "string.quoted.double.v"
53
+ }
54
+ }
55
+ },
56
+ {
57
+ "name": "meta.definition.flag.v",
58
+ "begin": "^\\s*(#flag)",
59
+ "end": "\\s+(.*?)$",
60
+ "beginCaptures": {
61
+ "1": {
62
+ "name": "keyword.flag.v"
63
+ }
64
+ },
65
+ "endCaptures": {
66
+ "1": {
67
+ "name": "string.quoted.single.v"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "name": "meta.definition.reference.v",
73
+ "match": "(\u0026)\\s*(?=[0-9a-zA-Z_])",
74
+ "captures": {
75
+ "1": {
76
+ "name": "keyword.operator.address.v"
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "name": "meta.definition.escaped.keyword.v",
82
+ "match": "((?:@)(?:mut|pub|fn|module|import|const|map|assert|sizeof|type|struct|interface|enum|in|or|switch|case|match|if|else|for|go|goto|defer|return|int|uint|i?(?:8|16|32|64|128)|u?(?:8|16|32|64|128)|f?(?:32|64)|bool|byte|byteptr|voidptr|string|ustring|rune))",
83
+ "captures": {
84
+ "0": {
85
+ "name": "keyword.other.escaped.v"
86
+ }
87
+ }
88
+ },
89
+ {
90
+ "include": "#comments"
91
+ },
92
+ {
93
+ "include": "#brackets"
94
+ },
95
+ {
96
+ "include": "#builtin-fix"
97
+ },
98
+ {
99
+ "include": "#generics"
100
+ },
101
+ {
102
+ "include": "#operators"
103
+ },
104
+ {
105
+ "include": "#function-new-limited-overload"
106
+ },
107
+ {
108
+ "include": "#function-new-extend"
109
+ },
110
+ {
111
+ "include": "#function-new"
112
+ },
113
+ {
114
+ "include": "#function-exist"
115
+ },
116
+ {
117
+ "include": "#type"
118
+ },
119
+ {
120
+ "include": "#enum"
121
+ },
122
+ {
123
+ "include": "#struct"
124
+ },
125
+ {
126
+ "include": "#interface"
127
+ },
128
+ {
129
+ "include": "#constants"
130
+ },
131
+ {
132
+ "include": "#variable-assignment"
133
+ },
134
+ {
135
+ "include": "#variable-increment-decrement"
136
+ },
137
+ {
138
+ "include": "#goto"
139
+ },
140
+ {
141
+ "include": "#keywords"
142
+ },
143
+ {
144
+ "include": "#storage"
145
+ },
146
+ {
147
+ "include": "#std-types"
148
+ },
149
+ {
150
+ "include": "#std-cbased-types"
151
+ },
152
+ {
153
+ "include": "#numbers"
154
+ },
155
+ {
156
+ "include": "#strings"
157
+ }
158
+ ],
159
+ "repository": {
160
+ "attributes": {
161
+ "patterns": [
162
+ {
163
+ "name": "meta.function.attribute.v",
164
+ "match": "^\\s*(?=\\[(live|inline)\\])",
165
+ "captures": {
166
+ "1": {
167
+ "name": "entity.function.attribute.v"
168
+ }
169
+ }
170
+ },
171
+ {
172
+ "name": "meta.struct.attribute.v",
173
+ "match": "(?\u003c=[0-9a-zA-Z_\\s])(?=\\[(skip)\\])",
174
+ "captures": {
175
+ "1": {
176
+ "name": "entity.struct.attribute.v"
177
+ }
178
+ }
179
+ }
180
+ ]
181
+ },
182
+ "brackets": {
183
+ "patterns": [
184
+ {
185
+ "begin": "{",
186
+ "end": "}",
187
+ "patterns": [
188
+ {
189
+ "include": "$self"
190
+ }
191
+ ],
192
+ "beginCaptures": {
193
+ "0": {
194
+ "name": "punctuation.definition.bracket.curly.begin.v"
195
+ }
196
+ },
197
+ "endCaptures": {
198
+ "0": {
199
+ "name": "punctuation.definition.bracket.curly.end.v"
200
+ }
201
+ }
202
+ },
203
+ {
204
+ "begin": "\\(",
205
+ "end": "\\)",
206
+ "patterns": [
207
+ {
208
+ "include": "$self"
209
+ }
210
+ ],
211
+ "beginCaptures": {
212
+ "0": {
213
+ "name": "punctuation.definition.bracket.round.begin.v"
214
+ }
215
+ },
216
+ "endCaptures": {
217
+ "0": {
218
+ "name": "punctuation.definition.bracket.round.end.v"
219
+ }
220
+ }
221
+ },
222
+ {
223
+ "name": "punctuation.definition.bracket.square.v",
224
+ "match": "\\[|\\]"
225
+ }
226
+ ]
227
+ },
228
+ "builtin-fix": {
229
+ "patterns": [
230
+ {
231
+ "patterns": [
232
+ {
233
+ "match": "^\\s*(const)(?=\\s*\\()",
234
+ "captures": {
235
+ "1": {
236
+ "name": "storage.modifier.v"
237
+ }
238
+ }
239
+ },
240
+ {
241
+ "match": "(assert)(?=\\s*\\()",
242
+ "captures": {
243
+ "1": {
244
+ "name": "keyword.assert.v"
245
+ }
246
+ }
247
+ },
248
+ {
249
+ "match": "(sizeof)(?=\\s*\\()",
250
+ "captures": {
251
+ "1": {
252
+ "name": "keyword.sizeof.v"
253
+ }
254
+ }
255
+ }
256
+ ]
257
+ },
258
+ {
259
+ "patterns": [
260
+ {
261
+ "match": "(in|or|switch|case|match|if|else|for|go|goto|defer|return)(?=\\s*\\()",
262
+ "captures": {
263
+ "1": {
264
+ "name": "keyword.control.v"
265
+ }
266
+ }
267
+ }
268
+ ]
269
+ },
270
+ {
271
+ "patterns": [
272
+ {
273
+ "name": "meta.expr.numeric.cast.v",
274
+ "match": "(int|uint|i?(?:8|16|32|64|128)|u?(?:8|16|32|64|128)|f?(?:32|64))(?=\\s*\\()",
275
+ "captures": {
276
+ "1": {
277
+ "name": "storage.type.numeric.v"
278
+ }
279
+ }
280
+ },
281
+ {
282
+ "name": "meta.expr.bool.cast.v",
283
+ "match": "(bool)(?=\\s*\\()",
284
+ "captures": {
285
+ "1": {
286
+ "name": "storage.type.boolean.v"
287
+ }
288
+ }
289
+ },
290
+ {
291
+ "name": "meta.expr.byte.cast.v",
292
+ "match": "(byte)(?=\\s*\\()",
293
+ "captures": {
294
+ "1": {
295
+ "name": "storage.type.byte.v"
296
+ }
297
+ }
298
+ },
299
+ {
300
+ "name": "meta.expr.byteptr.cast.v",
301
+ "match": "(byteptr)(?=\\s*\\()",
302
+ "captures": {
303
+ "1": {
304
+ "name": "storage.type.byteptr.v"
305
+ }
306
+ }
307
+ },
308
+ {
309
+ "name": "meta.expr.voidptr.cast.v",
310
+ "match": "(voidptr)(?=\\s*\\()",
311
+ "captures": {
312
+ "1": {
313
+ "name": "storage.type.voidptr.v"
314
+ }
315
+ }
316
+ },
317
+ {
318
+ "name": "meta.expr.string.cast.v",
319
+ "match": "(string)(?=\\s*\\()",
320
+ "captures": {
321
+ "1": {
322
+ "name": "storage.type.string.v"
323
+ }
324
+ }
325
+ },
326
+ {
327
+ "name": "meta.expr.ustring.cast.v",
328
+ "match": "(ustring)(?=\\s*\\()",
329
+ "captures": {
330
+ "1": {
331
+ "name": "storage.type.ustring.v"
332
+ }
333
+ }
334
+ },
335
+ {
336
+ "name": "meta.expr.rune.cast.v",
337
+ "match": "(rune)(?=\\s*\\()",
338
+ "captures": {
339
+ "1": {
340
+ "name": "storage.type.rune.v"
341
+ }
342
+ }
343
+ }
344
+ ]
345
+ }
346
+ ]
347
+ },
348
+ "comments": {
349
+ "patterns": [
350
+ {
351
+ "name": "comment.block.v",
352
+ "begin": "/\\*",
353
+ "end": "\\*/",
354
+ "captures": {
355
+ "0": {
356
+ "name": "comment.block.documentation.v"
357
+ }
358
+ }
359
+ },
360
+ {
361
+ "name": "comment.line.double-slash.v",
362
+ "begin": "//",
363
+ "end": "$",
364
+ "beginCaptures": {
365
+ "0": {
366
+ "name": "comment.block.documentation.v"
367
+ }
368
+ }
369
+ }
370
+ ]
371
+ },
372
+ "constants": {
373
+ "patterns": [
374
+ {
375
+ "name": "constant.language.v",
376
+ "match": "\\b(true|false)\\b"
377
+ },
378
+ {
379
+ "name": "constant.other.v",
380
+ "match": "([0-9A-Z]+)(?=\\s*\\=)"
381
+ }
382
+ ]
383
+ },
384
+ "enum": {
385
+ "patterns": [
386
+ {
387
+ "name": "meta.definition.enum.v",
388
+ "match": "^\\s*(\\benum\\b)\\s+(?:[0-9a-zA-Z_]+\\.)?([0-9a-zA-Z_]*)",
389
+ "captures": {
390
+ "1": {
391
+ "name": "keyword.enum.v"
392
+ },
393
+ "2": {
394
+ "patterns": [
395
+ {
396
+ "name": "invalid.illegal.v",
397
+ "match": "\\d\\w+"
398
+ },
399
+ {
400
+ "name": "entity.name.enum.v",
401
+ "match": "\\w+"
402
+ }
403
+ ]
404
+ }
405
+ }
406
+ }
407
+ ]
408
+ },
409
+ "flags": {
410
+ "patterns": [
411
+ {
412
+ "name": "meta.flag.include.v",
413
+ "match": "(-L|I)\\s*(?=.+?)",
414
+ "captures": {
415
+ "1": {
416
+ "name": "keyword.flag.include.v"
417
+ }
418
+ }
419
+ },
420
+ {
421
+ "name": "meta.flag.linking.v",
422
+ "match": "(-l[0-9a-zA-Z._\\-]+)",
423
+ "captures": {
424
+ "1": {
425
+ "name": "entity.name.library.v"
426
+ }
427
+ }
428
+ },
429
+ {
430
+ "name": "meta.flag.os-specific.linking.v",
431
+ "match": "(windows|darwin|linux|bsd)\\s+(?=-(?=l|L))",
432
+ "captures": {
433
+ "1": {
434
+ "name": "keyword.flag.os.v"
435
+ }
436
+ }
437
+ }
438
+ ]
439
+ },
440
+ "function-exist": {
441
+ "patterns": [
442
+ {
443
+ "name": "meta.function.v",
444
+ "match": "([0-9a-zA-Z_]+)(\\\u003c[0-9a-zA-Z_]*\\\u003e)?(?=\\s*\\()",
445
+ "captures": {
446
+ "0": {
447
+ "name": "meta.function.call.v"
448
+ },
449
+ "1": {
450
+ "patterns": [
451
+ {
452
+ "name": "invalid.illegal.v",
453
+ "match": "\\d\\w+"
454
+ },
455
+ {
456
+ "name": "support.function.v",
457
+ "match": "\\w+"
458
+ }
459
+ ]
460
+ },
461
+ "2": {
462
+ "patterns": [
463
+ {
464
+ "include": "#function-generic"
465
+ }
466
+ ]
467
+ }
468
+ }
469
+ }
470
+ ]
471
+ },
472
+ "function-generic": {
473
+ "patterns": [
474
+ {
475
+ "name": "meta.definition.generic.v",
476
+ "match": "(\\\u003c)([0-9a-zA-Z_]+)(\\\u003e)",
477
+ "captures": {
478
+ "1": {
479
+ "name": "punctuation.definition.bracket.angle.begin.v"
480
+ },
481
+ "2": {
482
+ "patterns": [
483
+ {
484
+ "name": "invalid.illegal.v",
485
+ "match": "\\d\\w+"
486
+ },
487
+ {
488
+ "name": "entity.name.generic.v",
489
+ "match": "\\w+"
490
+ }
491
+ ]
492
+ },
493
+ "3": {
494
+ "name": "punctuation.definition.bracket.angle.end.v"
495
+ }
496
+ }
497
+ }
498
+ ]
499
+ },
500
+ "function-new": {
501
+ "patterns": [
502
+ {
503
+ "name": "meta.function.v",
504
+ "begin": "^\\s*(pub)?\\s*(fn)\\s+",
505
+ "end": "(?:(?:C\\.)?)([0-9a-zA-Z_]+)(\\\u003c[0-9a-zA-Z_]*\\\u003e)?",
506
+ "beginCaptures": {
507
+ "1": {
508
+ "name": "storage.modifier.v"
509
+ },
510
+ "2": {
511
+ "name": "keyword.function.v"
512
+ }
513
+ },
514
+ "endCaptures": {
515
+ "0": {
516
+ "name": "meta.definition.function.v"
517
+ },
518
+ "1": {
519
+ "patterns": [
520
+ {
521
+ "name": "invalid.illegal.v",
522
+ "match": "\\d\\w+"
523
+ },
524
+ {
525
+ "name": "entity.name.function.v",
526
+ "match": "\\w+"
527
+ }
528
+ ]
529
+ },
530
+ "2": {
531
+ "patterns": [
532
+ {
533
+ "include": "#function-generic"
534
+ }
535
+ ]
536
+ }
537
+ }
538
+ }
539
+ ]
540
+ },
541
+ "function-new-extend": {
542
+ "patterns": [
543
+ {
544
+ "name": "meta.function.v",
545
+ "match": "^\\s*(pub)?\\s*(fn)\\s+(\\()([^\\)]*)(\\))\\s*(?:(?:C\\.)?)([0-9a-zA-Z_]+)(\\\u003c[0-9a-zA-Z_]*\\\u003e)?",
546
+ "captures": {
547
+ "0": {
548
+ "name": "meta.definition.function.v"
549
+ },
550
+ "1": {
551
+ "name": "storage.modifier.v"
552
+ },
553
+ "2": {
554
+ "name": "keyword.function.v"
555
+ },
556
+ "3": {
557
+ "name": "punctuation.definition.bracket.round.begin.v"
558
+ },
559
+ "4": {
560
+ "patterns": [
561
+ {
562
+ "include": "#brackets"
563
+ },
564
+ {
565
+ "include": "#storage"
566
+ },
567
+ {
568
+ "include": "#generics"
569
+ },
570
+ {
571
+ "include": "#std-types"
572
+ },
573
+ {
574
+ "include": "#std-cbased-types"
575
+ },
576
+ {
577
+ "include": "#punctuation"
578
+ }
579
+ ]
580
+ },
581
+ "5": {
582
+ "name": "punctuation.definition.bracket.round.end.v"
583
+ },
584
+ "6": {
585
+ "patterns": [
586
+ {
587
+ "name": "invalid.illegal.v",
588
+ "match": "\\d\\w+"
589
+ },
590
+ {
591
+ "name": "entity.name.function.v",
592
+ "match": "\\w+"
593
+ }
594
+ ]
595
+ },
596
+ "7": {
597
+ "patterns": [
598
+ {
599
+ "include": "#function-generic"
600
+ }
601
+ ]
602
+ }
603
+ }
604
+ }
605
+ ]
606
+ },
607
+ "function-new-limited-overload": {
608
+ "patterns": [
609
+ {
610
+ "name": "meta.function.v",
611
+ "match": "^\\s*(pub)?\\s*(fn)\\s+(\\()([^\\)]*)(\\))\\s*([\\+\\-\\*\\/])?\\s*(\\()([^\\)]*)(\\))\\s*(?:(?:C\\.)?)([0-9a-zA-Z_]+)",
612
+ "captures": {
613
+ "0": {
614
+ "name": "meta.definition.function.v"
615
+ },
616
+ "1": {
617
+ "name": "storage.modifier.v"
618
+ },
619
+ "10": {
620
+ "patterns": [
621
+ {
622
+ "name": "invalid.illegal.v",
623
+ "match": "\\d\\w+"
624
+ },
625
+ {
626
+ "name": "entity.name.function.v",
627
+ "match": "\\w+"
628
+ }
629
+ ]
630
+ },
631
+ "2": {
632
+ "name": "keyword.function.v"
633
+ },
634
+ "3": {
635
+ "name": "punctuation.definition.bracket.round.begin.v"
636
+ },
637
+ "4": {
638
+ "patterns": [
639
+ {
640
+ "include": "#brackets"
641
+ },
642
+ {
643
+ "include": "#storage"
644
+ },
645
+ {
646
+ "include": "#generics"
647
+ },
648
+ {
649
+ "include": "#std-types"
650
+ },
651
+ {
652
+ "include": "#std-cbased-types"
653
+ },
654
+ {
655
+ "include": "#punctuation"
656
+ }
657
+ ]
658
+ },
659
+ "5": {
660
+ "name": "punctuation.definition.bracket.round.end.v"
661
+ },
662
+ "6": {
663
+ "patterns": [
664
+ {
665
+ "include": "#operators"
666
+ }
667
+ ]
668
+ },
669
+ "7": {
670
+ "name": "punctuation.definition.bracket.round.begin.v"
671
+ },
672
+ "8": {
673
+ "patterns": [
674
+ {
675
+ "include": "#brackets"
676
+ },
677
+ {
678
+ "include": "#storage"
679
+ },
680
+ {
681
+ "include": "#generics"
682
+ },
683
+ {
684
+ "include": "#std-types"
685
+ },
686
+ {
687
+ "include": "#std-cbased-types"
688
+ },
689
+ {
690
+ "include": "#punctuation"
691
+ }
692
+ ]
693
+ },
694
+ "9": {
695
+ "name": "punctuation.definition.bracket.round.end.v"
696
+ }
697
+ }
698
+ }
699
+ ]
700
+ },
701
+ "generics": {
702
+ "patterns": [
703
+ {
704
+ "name": "meta.definition.generic.v",
705
+ "match": "(?\u003c=[\\w\\s])(\\\u003c)([0-9a-zA-Z_]+)(\\\u003e)",
706
+ "captures": {
707
+ "1": {
708
+ "name": "punctuation.definition.bracket.angle.begin.v"
709
+ },
710
+ "2": {
711
+ "patterns": [
712
+ {
713
+ "name": "invalid.illegal.v",
714
+ "match": "\\d\\w+"
715
+ },
716
+ {
717
+ "name": "entity.name.generic.v",
718
+ "match": "\\w+"
719
+ }
720
+ ]
721
+ },
722
+ "3": {
723
+ "name": "punctuation.definition.bracket.angle.end.v"
724
+ }
725
+ }
726
+ }
727
+ ]
728
+ },
729
+ "interface": {
730
+ "patterns": [
731
+ {
732
+ "name": "meta.definition.interface.v",
733
+ "match": "^\\s*(\\binterface\\b)\\s+([0-9a-zA-Z_]*)",
734
+ "captures": {
735
+ "1": {
736
+ "name": "keyword.interface.v"
737
+ },
738
+ "2": {
739
+ "patterns": [
740
+ {
741
+ "name": "invalid.illegal.v",
742
+ "match": "\\d\\w+"
743
+ },
744
+ {
745
+ "name": "entity.name.interface.v",
746
+ "match": "\\w+"
747
+ }
748
+ ]
749
+ }
750
+ }
751
+ }
752
+ ]
753
+ },
754
+ "keywords": {
755
+ "patterns": [
756
+ {
757
+ "name": "keyword.control.v",
758
+ "match": "\\b(in|or|break|continue|switch|case|default|match|if|else|for|go|goto|defer|return)\\b"
759
+ },
760
+ {
761
+ "name": "keyword.control.v",
762
+ "match": "(\\$if)"
763
+ },
764
+ {
765
+ "name": "keyword.control.v",
766
+ "match": "(\\$else)"
767
+ },
768
+ {
769
+ "name": "keyword.type.v",
770
+ "match": "\\btype\\b"
771
+ },
772
+ {
773
+ "name": "keyword.enum.v",
774
+ "match": "\\benum\\b"
775
+ },
776
+ {
777
+ "name": "keyword.struct.v",
778
+ "match": "\\bstruct\\b"
779
+ },
780
+ {
781
+ "name": "keyword.interface.v",
782
+ "match": "\\binterface\\b"
783
+ },
784
+ {
785
+ "name": "keyword.map.v",
786
+ "match": "\\bmap\\b"
787
+ },
788
+ {
789
+ "name": "keyword.assert.v",
790
+ "match": "\\bassert\\b"
791
+ },
792
+ {
793
+ "name": "keyword.sizeof.v",
794
+ "match": "\\bsizeof\\b"
795
+ }
796
+ ]
797
+ },
798
+ "numbers": {
799
+ "patterns": [
800
+ {
801
+ "match": "([-]?)([0-9e]*)([.]){1}([0-9]+)",
802
+ "captures": {
803
+ "1": {
804
+ "name": "constant.numeric.float.v"
805
+ },
806
+ "2": {
807
+ "name": "constant.numeric.float.v"
808
+ },
809
+ "3": {
810
+ "name": "constant.numeric.float.v"
811
+ },
812
+ "4": {
813
+ "name": "constant.numeric.float.v"
814
+ }
815
+ }
816
+ },
817
+ {
818
+ "match": "(0[xX])([0-9a-fA-F]+)",
819
+ "captures": {
820
+ "1": {
821
+ "name": "constant.numeric.hex.v"
822
+ },
823
+ "2": {
824
+ "name": "constant.numeric.hex.v"
825
+ }
826
+ }
827
+ },
828
+ {
829
+ "match": "\\b([-]?)([0-9]+)",
830
+ "captures": {
831
+ "1": {
832
+ "name": "constant.numeric.integer.v"
833
+ },
834
+ "2": {
835
+ "name": "constant.numeric.integer.v"
836
+ }
837
+ }
838
+ }
839
+ ]
840
+ },
841
+ "operators": {
842
+ "patterns": [
843
+ {
844
+ "name": "keyword.operator.arithmethic.v",
845
+ "match": "(\\+|\\-|\\*|\\/|\\%|\\+\\+|\\-\\-)"
846
+ },
847
+ {
848
+ "name": "keyword.operator.relation.v",
849
+ "match": "(\\=\\=|\\!\\=|\\\u003e|\\\u003c|\\\u003e\\=|\\\u003c\\=)"
850
+ },
851
+ {
852
+ "name": "keyword.operator.logical.v",
853
+ "match": "(\\\u0026\\\u0026|\\|\\||\\!)"
854
+ },
855
+ {
856
+ "name": "keyword.operator.bitwise.v",
857
+ "match": "(\\\u0026|\\||\\^|\u003c(?!\u003c)|\u003e(?!\u003e))"
858
+ },
859
+ {
860
+ "name": "keyword.operator.assignment.v",
861
+ "match": "(\\:\\=|\\=|\\+\\=|\\-\\=|\\*\\=|\\/\\=|\\%\\=|\\\u0026\\=|\\|\\=|\\^\\=|\\\u0026\\\u0026\\=|\\|\\|\\=|\\\u003e\\\u003e\\=|\\\u003c\\\u003c\\=)"
862
+ }
863
+ ]
864
+ },
865
+ "punctuation": {
866
+ "patterns": [
867
+ {
868
+ "name": "punctuation.other.dot.v",
869
+ "match": "\\."
870
+ },
871
+ {
872
+ "name": "punctuation.other.comma.v",
873
+ "match": "\\,"
874
+ },
875
+ {
876
+ "name": "punctuation.other.colon.v",
877
+ "match": "\\:"
878
+ },
879
+ {
880
+ "name": "punctuation.other.semicolon.v",
881
+ "match": "\\;"
882
+ },
883
+ {
884
+ "name": "punctuation.other.questionmark.v",
885
+ "match": "\\?"
886
+ }
887
+ ]
888
+ },
889
+ "std-cbased-types": {
890
+ "patterns": [
891
+ {
892
+ "name": "storage.type.numeric.cbased.v",
893
+ "match": "\\b(size_t|ptrdiff_t)\\b"
894
+ }
895
+ ]
896
+ },
897
+ "std-types": {
898
+ "patterns": [
899
+ {
900
+ "name": "storage.type.boolean.v",
901
+ "match": "\\bbool\\b"
902
+ },
903
+ {
904
+ "name": "storage.type.byte.v",
905
+ "match": "\\bbyte\\b"
906
+ },
907
+ {
908
+ "name": "storage.type.byteptr.v",
909
+ "match": "\\bbyteptr\\b"
910
+ },
911
+ {
912
+ "name": "storage.type.voidptr.v",
913
+ "match": "\\bvoidptr\\b"
914
+ },
915
+ {
916
+ "name": "storage.type.string.v",
917
+ "match": "\\bstring\\b"
918
+ },
919
+ {
920
+ "name": "storage.type.ustring.v",
921
+ "match": "\\bustring\\b"
922
+ },
923
+ {
924
+ "name": "storage.type.rune.v",
925
+ "match": "\\brune\\b"
926
+ },
927
+ {
928
+ "name": "storage.type.option.v",
929
+ "match": "\\boption\\b"
930
+ },
931
+ {
932
+ "name": "storage.type.numeric.v",
933
+ "match": "\\b(int|uint|i(8|16|32|64|128)|u(8|16|32|64|u128)|f(32|64))\\b"
934
+ }
935
+ ]
936
+ },
937
+ "storage": {
938
+ "patterns": [
939
+ {
940
+ "name": "storage.modifier.v",
941
+ "match": "\\b(const|mut|pub)\\b"
942
+ }
943
+ ]
944
+ },
945
+ "string-escaped-char": {
946
+ "patterns": [
947
+ {
948
+ "name": "constant.character.escape.v",
949
+ "match": "\\\\([0-7]{3}|[\\$abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})"
950
+ },
951
+ {
952
+ "name": "invalid.illegal.unknown-escape.v",
953
+ "match": "\\\\[^0-7\\$xuUabfnrtv\\'\"]"
954
+ }
955
+ ]
956
+ },
957
+ "string-interpolation": {
958
+ "patterns": [
959
+ {
960
+ "name": "meta.string.interpolation.v",
961
+ "match": "(\\$[0-9a-zA-Z_.]+)",
962
+ "captures": {
963
+ "1": {
964
+ "patterns": [
965
+ {
966
+ "name": "invalid.illegal.v",
967
+ "match": "\\$\\d[\\.\\w]+"
968
+ },
969
+ {
970
+ "name": "variable.other.interpolated.v",
971
+ "match": "\\$[\\.\\w]+"
972
+ }
973
+ ]
974
+ }
975
+ }
976
+ }
977
+ ]
978
+ },
979
+ "string-placeholder": {
980
+ "patterns": [
981
+ {
982
+ "name": "constant.other.placeholder.v",
983
+ "match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGsp]"
984
+ }
985
+ ]
986
+ },
987
+ "strings": {
988
+ "patterns": [
989
+ {
990
+ "name": "string.quoted.raw.v",
991
+ "begin": "\\`",
992
+ "end": "\\`",
993
+ "patterns": [
994
+ {
995
+ "include": "#string-interpolation"
996
+ },
997
+ {
998
+ "include": "#string-escaped-char"
999
+ },
1000
+ {
1001
+ "include": "#string-placeholder"
1002
+ }
1003
+ ],
1004
+ "beginCaptures": {
1005
+ "0": {
1006
+ "name": "punctuation.definition.string.raw.begin.v"
1007
+ }
1008
+ },
1009
+ "endCaptures": {
1010
+ "0": {
1011
+ "name": "punctuation.definition.string.raw.end.v"
1012
+ }
1013
+ }
1014
+ },
1015
+ {
1016
+ "name": "string.quoted.single.v",
1017
+ "begin": "\\'",
1018
+ "end": "\\'",
1019
+ "patterns": [
1020
+ {
1021
+ "include": "#string-interpolation"
1022
+ },
1023
+ {
1024
+ "include": "#string-escaped-char"
1025
+ },
1026
+ {
1027
+ "include": "#string-placeholder"
1028
+ }
1029
+ ],
1030
+ "beginCaptures": {
1031
+ "0": {
1032
+ "name": "punctuation.definition.string.single.begin.v"
1033
+ }
1034
+ },
1035
+ "endCaptures": {
1036
+ "0": {
1037
+ "name": "punctuation.definition.string.single.end.v"
1038
+ }
1039
+ }
1040
+ },
1041
+ {
1042
+ "name": "string.quoted.double.v",
1043
+ "begin": "\"",
1044
+ "end": "\"",
1045
+ "patterns": [
1046
+ {
1047
+ "include": "#string-interpolation"
1048
+ },
1049
+ {
1050
+ "include": "#string-escaped-char"
1051
+ },
1052
+ {
1053
+ "include": "#string-placeholder"
1054
+ }
1055
+ ],
1056
+ "beginCaptures": {
1057
+ "0": {
1058
+ "name": "punctuation.definition.string.double.begin.v"
1059
+ }
1060
+ },
1061
+ "endCaptures": {
1062
+ "0": {
1063
+ "name": "punctuation.definition.string.double.end.v"
1064
+ }
1065
+ }
1066
+ }
1067
+ ]
1068
+ },
1069
+ "struct": {
1070
+ "patterns": [
1071
+ {
1072
+ "name": "meta.definition.struct.v",
1073
+ "match": "^\\s*(\\bstruct\\b)\\s+(?:[0-9a-zA-Z_]+\\.)?([0-9a-zA-Z_]*)",
1074
+ "captures": {
1075
+ "1": {
1076
+ "name": "keyword.struct.v"
1077
+ },
1078
+ "2": {
1079
+ "patterns": [
1080
+ {
1081
+ "name": "invalid.illegal.v",
1082
+ "match": "\\d\\w+"
1083
+ },
1084
+ {
1085
+ "name": "entity.name.struct.v",
1086
+ "match": "\\w+"
1087
+ }
1088
+ ]
1089
+ }
1090
+ }
1091
+ }
1092
+ ]
1093
+ },
1094
+ "type": {
1095
+ "patterns": [
1096
+ {
1097
+ "name": "meta.definition.type.v",
1098
+ "match": "^\\s*(\\btype\\b)\\s+([0-9a-zA-Z_]*)\\s+(?:[0-9a-zA-Z]+\\.+)?([0-9a-zA-Z_]*)",
1099
+ "captures": {
1100
+ "1": {
1101
+ "name": "keyword.type.v"
1102
+ },
1103
+ "2": {
1104
+ "patterns": [
1105
+ {
1106
+ "name": "invalid.illegal.v",
1107
+ "match": "\\d\\w+"
1108
+ },
1109
+ {
1110
+ "name": "entity.name.type.v",
1111
+ "match": "\\w+"
1112
+ }
1113
+ ]
1114
+ },
1115
+ "3": {
1116
+ "patterns": [
1117
+ {
1118
+ "name": "invalid.illegal.v",
1119
+ "match": "\\d\\w+"
1120
+ },
1121
+ {
1122
+ "name": "entity.name.type.v",
1123
+ "match": "\\w+"
1124
+ }
1125
+ ]
1126
+ }
1127
+ }
1128
+ }
1129
+ ]
1130
+ },
1131
+ "variable-assignment": {
1132
+ "patterns": [
1133
+ {
1134
+ "match": "(match|if|else)(?=\\s*\\=\\\u003e)",
1135
+ "captures": {
1136
+ "1": {
1137
+ "name": "keyword.control.v"
1138
+ }
1139
+ }
1140
+ },
1141
+ {
1142
+ "name": "meta.definition.var.v",
1143
+ "match": "([0-9a-zA-Z_.]+)\\s*((?:\\:|\\+|\\-|\\*|\\/|\\%|\\\u0026|\\||\\^)?=)\\s*(?=.+)",
1144
+ "captures": {
1145
+ "1": {
1146
+ "name": "variable.other.v"
1147
+ },
1148
+ "2": {
1149
+ "name": "keyword.operator.assignment.v"
1150
+ }
1151
+ }
1152
+ }
1153
+ ]
1154
+ },
1155
+ "variable-increment-decrement": {
1156
+ "patterns": [
1157
+ {
1158
+ "name": "meta.var.increment.expr.v",
1159
+ "match": "([0-9a-zA-Z_.]+)(\\+\\+)",
1160
+ "captures": {
1161
+ "1": {
1162
+ "name": "variable.other.increment.v"
1163
+ },
1164
+ "2": {
1165
+ "name": "keyword.operator.increment.v"
1166
+ }
1167
+ }
1168
+ },
1169
+ {
1170
+ "name": "meta.var.decrement.expr.v",
1171
+ "match": "([0-9a-zA-Z_.]+)(\\-\\-)",
1172
+ "captures": {
1173
+ "1": {
1174
+ "name": "variable.other.decrement.v"
1175
+ },
1176
+ "2": {
1177
+ "name": "keyword.operator.decrement.v"
1178
+ }
1179
+ }
1180
+ }
1181
+ ]
1182
+ }
1183
+ }
1184
+ }