github-linguist 5.0.0 → 5.0.2

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/bin/git-linguist +10 -2
  3. data/bin/linguist +26 -9
  4. data/grammars/config.xcompose.json +83 -0
  5. data/grammars/hint.haskell.json +21 -30
  6. data/grammars/hint.message.haskell.json +21 -30
  7. data/grammars/hint.type.haskell.json +21 -30
  8. data/grammars/source.bsl.json +42 -28
  9. data/grammars/source.cs.json +656 -131
  10. data/grammars/source.csound-document.json +142 -25
  11. data/grammars/source.csound-score.json +13 -10
  12. data/grammars/source.csound.json +136 -81
  13. data/grammars/source.css.json +1501 -331
  14. data/grammars/source.css.less.json +3 -3
  15. data/grammars/source.d.json +60 -44
  16. data/grammars/source.gn.json +240 -138
  17. data/grammars/source.graphql.json +781 -155
  18. data/grammars/source.haskell.json +21 -30
  19. data/grammars/source.js.json +46 -46
  20. data/grammars/source.mask.json +1 -1
  21. data/grammars/source.perl6fe.json +1151 -763
  22. data/grammars/source.python.json +45 -23
  23. data/grammars/source.quoting.perl6fe.json +2170 -0
  24. data/grammars/source.reason.json +296 -0
  25. data/grammars/source.regexp.perl6fe.json +27 -0
  26. data/grammars/source.rust.json +522 -125
  27. data/grammars/source.sdbl.json +2 -2
  28. data/grammars/source.shell.json +125 -161
  29. data/grammars/source.solidity.json +137 -0
  30. data/grammars/source.ts.json +385 -137
  31. data/grammars/source.tsx.json +394 -167
  32. data/grammars/source.yaml.json +176 -171
  33. data/grammars/text.html.php.blade.json +2 -2
  34. data/grammars/text.tex.latex.haskell.json +1 -10
  35. data/lib/linguist/generated.rb +50 -4
  36. data/lib/linguist/heuristics.rb +1 -1
  37. data/lib/linguist/language.rb +12 -8
  38. data/lib/linguist/languages.json +1 -1
  39. data/lib/linguist/languages.yml +38 -1
  40. data/lib/linguist/samples.json +4605 -581
  41. data/lib/linguist/vendor.yml +6 -0
  42. data/lib/linguist/version.rb +1 -1
  43. metadata +10 -7
  44. data/grammars/source.hy.json +0 -270
@@ -46,7 +46,7 @@
46
46
  },
47
47
  {
48
48
  "name": "keyword.operator.logical.sdbl",
49
- "match": "(?i)(?<!КАК\\s|AS\\s)(?<=[^\\wа-яё\\.]|^)(НЕ|NOT|И|AND|ИЛИ|OR|В\\s+ИЕРАРХИИ|IN\\s+HIERARCHY|В|In|Между|Between|Есть\\sNULL|Is\\s+NULL|Ссылка|Refs|Подобно|Like)(?=[^\\wа-яё\\.]|$)"
49
+ "match": "(?i)(?<!КАК\\s|AS\\s)(?<=[^\\wа-яё\\.]|^)(НЕ|NOT|И|AND|ИЛИ|OR|В\\s+ИЕРАРХИИ|IN\\s+HIERARCHY|В|In|Между|Between|Есть(\\s+НЕ)?\\s+NULL|Is(\\s+NOT)?\\s+NULL|Ссылка|Refs|Подобно|Like)(?=[^\\wа-яё\\.]|$)"
50
50
  },
51
51
  {
52
52
  "name": "keyword.operator.comparison.sdbl",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  {
64
64
  "name": "keyword.control.sdbl",
65
- "match": "(?i)(?<=[^\\wа-яё\\.]|^)(Выбрать|Select|Разрешенные|Allowed|Различные|Distinct|Первые|Top|Как|As|ПустаяТаблица|EpmtyTable|Поместить|Into|Уничтожить|Drop|Из|From|((Левое|Left|Правое|Right|Полное|Full)\\s+(Внешнее\\s+|Outer\\s+)?Соединение|Join)|((Внутреннее\\s+|Inner\\s+)?Соединение|Join)|Где|Where|(Сгруппировать\\s+По)|(Group\\s+By)|Имеющие|Having|Объединить(\\s+Все)?|Union(\\s+All)?|(Упорядочить\\s+По)|(Order\\s+By)|Автоупорядочивание|Autoorder|Итоги|Totals|По(\\s+Общие)?|By(\\s+Overall)?|(Только\\s+)?Иерархия|(Only\\s+)?Hierarchy|Периодами|Periods|Индексировать|Index|Выразить|Cast|Возр|Asc|Убыв|Desc|Для\\s+Изменения|(For\\s+Update(\\s+Of)?)|Спецсимвол|Escape)(?=[^\\wа-яё\\.]|$)"
65
+ "match": "(?i)(?<=[^\\wа-яё\\.]|^)(Выбрать|Select|Разрешенные|Allowed|Различные|Distinct|Первые|Top|Как|As|ПустаяТаблица|EpmtyTable|Поместить|Into|Уничтожить|Drop|Из|From|((Левое|Left|Правое|Right|Полное|Full)\\s+(Внешнее\\s+|Outer\\s+)?Соединение|Join)|((Внутреннее|Inner)\\s+Соединение|Join)|Где|Where|(Сгруппировать\\s+По)|(Group\\s+By)|Имеющие|Having|Объединить(\\s+Все)?|Union(\\s+All)?|(Упорядочить\\s+По)|(Order\\s+By)|Автоупорядочивание|Autoorder|Итоги|Totals|По(\\s+Общие)?|By(\\s+Overall)?|(Только\\s+)?Иерархия|(Only\\s+)?Hierarchy|Периодами|Periods|Индексировать|Index|Выразить|Cast|Возр|Asc|Убыв|Desc|Для\\s+Изменения|(For\\s+Update(\\s+Of)?)|Спецсимвол|Escape)(?=[^\\wа-яё\\.]|$)"
66
66
  },
67
67
  {
68
68
  "comment": "Функции языка запросов",
@@ -88,13 +88,18 @@
88
88
  "name": "meta.scope.case-clause.shell",
89
89
  "patterns": [
90
90
  {
91
- "begin": "(\\(|(?=\\S))",
92
- "captures": {
91
+ "begin": "\\(|(?=\\S)",
92
+ "beginCaptures": {
93
93
  "0": {
94
94
  "name": "punctuation.definition.case-pattern.shell"
95
95
  }
96
96
  },
97
97
  "end": "\\)",
98
+ "endCaptures": {
99
+ "0": {
100
+ "name": "punctuation.definition.case-pattern.shell"
101
+ }
102
+ },
98
103
  "name": "meta.scope.case-pattern.shell",
99
104
  "patterns": [
100
105
  {
@@ -163,13 +168,18 @@
163
168
  "compound-command": {
164
169
  "patterns": [
165
170
  {
166
- "begin": "(\\[{1,2})",
167
- "captures": {
168
- "1": {
171
+ "begin": "\\[{1,2}",
172
+ "beginCaptures": {
173
+ "0": {
174
+ "name": "punctuation.definition.logical-expression.shell"
175
+ }
176
+ },
177
+ "end": "\\]{1,2}",
178
+ "endCaptures": {
179
+ "0": {
169
180
  "name": "punctuation.definition.logical-expression.shell"
170
181
  }
171
182
  },
172
- "end": "(\\]{1,2})",
173
183
  "name": "meta.scope.logical-expression.shell",
174
184
  "patterns": [
175
185
  {
@@ -181,13 +191,13 @@
181
191
  ]
182
192
  },
183
193
  {
184
- "begin": "(\\({2})",
194
+ "begin": "\\({2}",
185
195
  "beginCaptures": {
186
196
  "0": {
187
197
  "name": "punctuation.definition.string.begin.shell"
188
198
  }
189
199
  },
190
- "end": "(\\){2})",
200
+ "end": "\\){2}",
191
201
  "endCaptures": {
192
202
  "0": {
193
203
  "name": "punctuation.definition.string.end.shell"
@@ -201,13 +211,18 @@
201
211
  ]
202
212
  },
203
213
  {
204
- "begin": "(\\()",
205
- "captures": {
206
- "1": {
214
+ "begin": "\\(",
215
+ "beginCaptures": {
216
+ "0": {
217
+ "name": "punctuation.definition.subshell.shell"
218
+ }
219
+ },
220
+ "end": "\\)",
221
+ "endCaptures": {
222
+ "0": {
207
223
  "name": "punctuation.definition.subshell.shell"
208
224
  }
209
225
  },
210
- "end": "(\\))",
211
226
  "name": "meta.scope.subshell.shell",
212
227
  "patterns": [
213
228
  {
@@ -216,13 +231,18 @@
216
231
  ]
217
232
  },
218
233
  {
219
- "begin": "(?<=\\s|^)(\\{)(?=\\s|$)",
220
- "captures": {
234
+ "begin": "(?<=\\s|^){(?=\\s|$)",
235
+ "beginCaptures": {
236
+ "0": {
237
+ "name": "punctuation.definition.group.shell"
238
+ }
239
+ },
240
+ "end": "(?<=^|;)\\s*(})",
241
+ "endCaptures": {
221
242
  "1": {
222
243
  "name": "punctuation.definition.group.shell"
223
244
  }
224
245
  },
225
- "end": "(?<=^|;)\\s*(\\})",
226
246
  "name": "meta.scope.group.shell",
227
247
  "patterns": [
228
248
  {
@@ -235,7 +255,7 @@
235
255
  "function-definition": {
236
256
  "patterns": [
237
257
  {
238
- "begin": "\\b(function)\\s+([^\\s\\\\]+)(?:\\s*(\\(\\)))?",
258
+ "begin": "(?<=^|;|&|\\s)(function)\\s+([^\\s\\\\]+)(?:\\s*(\\(\\)))?",
239
259
  "beginCaptures": {
240
260
  "1": {
241
261
  "name": "storage.type.function.shell"
@@ -261,7 +281,7 @@
261
281
  ]
262
282
  },
263
283
  {
264
- "begin": "\\b([^\\s\\\\=]+)\\s*(\\(\\))",
284
+ "begin": "(?<=^|;|&|\\s)([^\\s\\\\=]+)\\s*(\\(\\))",
265
285
  "beginCaptures": {
266
286
  "1": {
267
287
  "name": "entity.name.function.shell"
@@ -297,19 +317,14 @@
297
317
  "name": "keyword.control.heredoc-token.shell"
298
318
  }
299
319
  },
300
- "captures": {
301
- "0": {
302
- "name": "punctuation.definition.string.shell"
303
- }
304
- },
305
- "contentName": "source.ruby.embedded.shell",
306
- "end": "^\\t*(RUBY)\\b",
320
+ "end": "^\\t*(RUBY)(?=\\s|;|&|$)",
307
321
  "endCaptures": {
308
322
  "1": {
309
323
  "name": "keyword.control.heredoc-token.shell"
310
324
  }
311
325
  },
312
326
  "name": "string.unquoted.heredoc.no-indent.ruby.shell",
327
+ "contentName": "source.ruby.embedded.shell",
313
328
  "patterns": [
314
329
  {
315
330
  "include": "source.ruby"
@@ -326,19 +341,14 @@
326
341
  "name": "keyword.control.heredoc-token.shell"
327
342
  }
328
343
  },
329
- "captures": {
330
- "0": {
331
- "name": "punctuation.definition.string.shell"
332
- }
333
- },
334
- "contentName": "source.ruby.embedded.shell",
335
- "end": "^(RUBY)\\b",
344
+ "end": "^(RUBY)(?=\\s|;|&|$)",
336
345
  "endCaptures": {
337
346
  "1": {
338
347
  "name": "keyword.control.heredoc-token.shell"
339
348
  }
340
349
  },
341
350
  "name": "string.unquoted.heredoc.ruby.shell",
351
+ "contentName": "source.ruby.embedded.shell",
342
352
  "patterns": [
343
353
  {
344
354
  "include": "source.ruby"
@@ -355,19 +365,14 @@
355
365
  "name": "keyword.control.heredoc-token.shell"
356
366
  }
357
367
  },
358
- "captures": {
359
- "0": {
360
- "name": "punctuation.definition.string.shell"
361
- }
362
- },
363
- "contentName": "source.python.embedded.shell",
364
- "end": "^\\t*(PYTHON)\\b",
368
+ "end": "^\\t*(PYTHON)(?=\\s|;|&|$)",
365
369
  "endCaptures": {
366
370
  "1": {
367
371
  "name": "keyword.control.heredoc-token.shell"
368
372
  }
369
373
  },
370
374
  "name": "string.unquoted.heredoc.no-indent.python.shell",
375
+ "contentName": "source.python.embedded.shell",
371
376
  "patterns": [
372
377
  {
373
378
  "include": "source.python"
@@ -384,19 +389,14 @@
384
389
  "name": "keyword.control.heredoc-token.shell"
385
390
  }
386
391
  },
387
- "captures": {
388
- "0": {
389
- "name": "punctuation.definition.string.shell"
390
- }
391
- },
392
- "contentName": "source.python.embedded.shell",
393
- "end": "^(PYTHON)\\b",
392
+ "end": "^(PYTHON)(?=\\s|;|&|$)",
394
393
  "endCaptures": {
395
394
  "1": {
396
395
  "name": "keyword.control.heredoc-token.shell"
397
396
  }
398
397
  },
399
398
  "name": "string.unquoted.heredoc.python.shell",
399
+ "contentName": "source.python.embedded.shell",
400
400
  "patterns": [
401
401
  {
402
402
  "include": "source.python"
@@ -413,19 +413,14 @@
413
413
  "name": "keyword.control.heredoc-token.shell"
414
414
  }
415
415
  },
416
- "captures": {
417
- "0": {
418
- "name": "punctuation.definition.string.shell"
419
- }
420
- },
421
- "contentName": "source.applescript.embedded.shell",
422
- "end": "^\\t*(APPLESCRIPT)\\b",
416
+ "end": "^\\t*(APPLESCRIPT)(?=\\s|;|&|$)",
423
417
  "endCaptures": {
424
418
  "1": {
425
419
  "name": "keyword.control.heredoc-token.shell"
426
420
  }
427
421
  },
428
422
  "name": "string.unquoted.heredoc.no-indent.applescript.shell",
423
+ "contentName": "source.applescript.embedded.shell",
429
424
  "patterns": [
430
425
  {
431
426
  "include": "source.applescript"
@@ -442,19 +437,14 @@
442
437
  "name": "keyword.control.heredoc-token.shell"
443
438
  }
444
439
  },
445
- "captures": {
446
- "0": {
447
- "name": "punctuation.definition.string.shell"
448
- }
449
- },
450
- "contentName": "source.applescript.embedded.shell",
451
- "end": "^(APPLESCRIPT)\\b",
440
+ "end": "^(APPLESCRIPT)(?=\\s|;|&|$)",
452
441
  "endCaptures": {
453
442
  "1": {
454
443
  "name": "keyword.control.heredoc-token.shell"
455
444
  }
456
445
  },
457
446
  "name": "string.unquoted.heredoc.applescript.shell",
447
+ "contentName": "source.applescript.embedded.shell",
458
448
  "patterns": [
459
449
  {
460
450
  "include": "source.applescript"
@@ -471,19 +461,14 @@
471
461
  "name": "keyword.control.heredoc-token.shell"
472
462
  }
473
463
  },
474
- "captures": {
475
- "0": {
476
- "name": "punctuation.definition.string.shell"
477
- }
478
- },
479
- "contentName": "text.html.embedded.shell",
480
- "end": "^\\t*(HTML)\\b",
464
+ "end": "^\\t*(HTML)(?=\\s|;|&|$)",
481
465
  "endCaptures": {
482
466
  "1": {
483
467
  "name": "keyword.control.heredoc-token.shell"
484
468
  }
485
469
  },
486
470
  "name": "string.unquoted.heredoc.no-indent.html.shell",
471
+ "contentName": "text.html.embedded.shell",
487
472
  "patterns": [
488
473
  {
489
474
  "include": "text.html.basic"
@@ -500,19 +485,14 @@
500
485
  "name": "keyword.control.heredoc-token.shell"
501
486
  }
502
487
  },
503
- "captures": {
504
- "0": {
505
- "name": "punctuation.definition.string.shell"
506
- }
507
- },
508
- "contentName": "text.html.embedded.shell",
509
- "end": "^(HTML)\\b",
488
+ "end": "^(HTML)(?=\\s|;|&|$)",
510
489
  "endCaptures": {
511
490
  "1": {
512
491
  "name": "keyword.control.heredoc-token.shell"
513
492
  }
514
493
  },
515
494
  "name": "string.unquoted.heredoc.html.shell",
495
+ "contentName": "text.html.embedded.shell",
516
496
  "patterns": [
517
497
  {
518
498
  "include": "text.html.basic"
@@ -529,19 +509,14 @@
529
509
  "name": "keyword.control.heredoc-token.shell"
530
510
  }
531
511
  },
532
- "captures": {
533
- "0": {
534
- "name": "punctuation.definition.string.shell"
535
- }
536
- },
537
- "contentName": "text.html.markdown.embedded.shell",
538
- "end": "^\\t*(MARKDOWN)\\b",
512
+ "end": "^\\t*(MARKDOWN)(?=\\s|;|&|$)",
539
513
  "endCaptures": {
540
514
  "1": {
541
515
  "name": "keyword.control.heredoc-token.shell"
542
516
  }
543
517
  },
544
518
  "name": "string.unquoted.heredoc.no-indent.markdown.shell",
519
+ "contentName": "text.html.markdown.embedded.shell",
545
520
  "patterns": [
546
521
  {
547
522
  "include": "text.html.markdown"
@@ -558,19 +533,14 @@
558
533
  "name": "keyword.control.heredoc-token.shell"
559
534
  }
560
535
  },
561
- "captures": {
562
- "0": {
563
- "name": "punctuation.definition.string.shell"
564
- }
565
- },
566
- "contentName": "text.html.markdown.embedded.shell",
567
- "end": "^(MARKDOWN)\\b",
536
+ "end": "^(MARKDOWN)(?=\\s|;|&|$)",
568
537
  "endCaptures": {
569
538
  "1": {
570
539
  "name": "keyword.control.heredoc-token.shell"
571
540
  }
572
541
  },
573
542
  "name": "string.unquoted.heredoc.markdown.shell",
543
+ "contentName": "text.html.markdown.embedded.shell",
574
544
  "patterns": [
575
545
  {
576
546
  "include": "text.html.markdown"
@@ -587,19 +557,14 @@
587
557
  "name": "keyword.control.heredoc-token.shell"
588
558
  }
589
559
  },
590
- "captures": {
591
- "0": {
592
- "name": "punctuation.definition.string.shell"
593
- }
594
- },
595
- "contentName": "text.html.textile.embedded.shell",
596
- "end": "^\\t*(TEXTILE)\\b",
560
+ "end": "^\\t*(TEXTILE)(?=\\s|;|&|$)",
597
561
  "endCaptures": {
598
562
  "1": {
599
563
  "name": "keyword.control.heredoc-token.shell"
600
564
  }
601
565
  },
602
566
  "name": "string.unquoted.heredoc.no-indent.textile.shell",
567
+ "contentName": "text.html.textile.embedded.shell",
603
568
  "patterns": [
604
569
  {
605
570
  "include": "text.html.textile"
@@ -616,19 +581,14 @@
616
581
  "name": "keyword.control.heredoc-token.shell"
617
582
  }
618
583
  },
619
- "captures": {
620
- "0": {
621
- "name": "punctuation.definition.string.shell"
622
- }
623
- },
624
- "contentName": "text.html.textile.embedded.shell",
625
- "end": "^(TEXTILE)\\b",
584
+ "end": "^(TEXTILE)(?=\\s|;|&|$)",
626
585
  "endCaptures": {
627
586
  "1": {
628
587
  "name": "keyword.control.heredoc-token.shell"
629
588
  }
630
589
  },
631
590
  "name": "string.unquoted.heredoc.textile.shell",
591
+ "contentName": "text.html.textile.embedded.shell",
632
592
  "patterns": [
633
593
  {
634
594
  "include": "text.html.textile"
@@ -645,18 +605,13 @@
645
605
  "name": "keyword.control.heredoc-token.shell"
646
606
  }
647
607
  },
648
- "captures": {
649
- "0": {
650
- "name": "punctuation.definition.string.shell"
651
- }
652
- },
653
- "contentName": "source.shell.embedded.shell",
654
- "end": "^\\t*(\\3)\\b",
608
+ "end": "^\\t*(\\3)(?=\\s|;|&|$)",
655
609
  "endCaptures": {
656
610
  "1": {
657
611
  "name": "keyword.control.heredoc-token.shell"
658
612
  }
659
613
  },
614
+ "contentName": "source.shell.embedded.shell",
660
615
  "name": "string.unquoted.heredoc.no-indent.shell.shell",
661
616
  "patterns": [
662
617
  {
@@ -674,19 +629,14 @@
674
629
  "name": "keyword.control.heredoc-token.shell"
675
630
  }
676
631
  },
677
- "captures": {
678
- "0": {
679
- "name": "punctuation.definition.string.shell"
680
- }
681
- },
682
- "contentName": "source.shell.embedded.shell",
683
- "end": "^(\\3)\\b",
632
+ "end": "^(\\3)(?=\\s|;|&|$)",
684
633
  "endCaptures": {
685
634
  "1": {
686
635
  "name": "keyword.control.heredoc-token.shell"
687
636
  }
688
637
  },
689
638
  "name": "string.unquoted.heredoc.shell.shell",
639
+ "contentName": "source.shell.embedded.shell",
690
640
  "patterns": [
691
641
  {
692
642
  "include": "source.shell"
@@ -703,12 +653,7 @@
703
653
  "name": "keyword.control.heredoc-token.shell"
704
654
  }
705
655
  },
706
- "captures": {
707
- "0": {
708
- "name": "punctuation.definition.string.shell"
709
- }
710
- },
711
- "end": "^\\t*(\\3)\\b",
656
+ "end": "^\\t*(\\3)(?=\\s|;|&|$)",
712
657
  "endCaptures": {
713
658
  "1": {
714
659
  "name": "keyword.control.heredoc-token.shell"
@@ -726,12 +671,7 @@
726
671
  "name": "keyword.control.heredoc-token.shell"
727
672
  }
728
673
  },
729
- "captures": {
730
- "0": {
731
- "name": "punctuation.definition.string.shell"
732
- }
733
- },
734
- "end": "^(\\3)\\b",
674
+ "end": "^(\\3)(?=\\s|;|&|$)",
735
675
  "endCaptures": {
736
676
  "1": {
737
677
  "name": "keyword.control.heredoc-token.shell"
@@ -744,7 +684,7 @@
744
684
  "herestring": {
745
685
  "patterns": [
746
686
  {
747
- "begin": "(<<<)s*(('))",
687
+ "begin": "(<<<)\\s*(('))",
748
688
  "beginCaptures": {
749
689
  "1": {
750
690
  "name": "keyword.operator.herestring.shell"
@@ -769,7 +709,7 @@
769
709
  "contentName": "string.quoted.single.shell"
770
710
  },
771
711
  {
772
- "begin": "(<<<)s*((\"))",
712
+ "begin": "(<<<)\\s*((\"))",
773
713
  "beginCaptures": {
774
714
  "1": {
775
715
  "name": "keyword.operator.herestring.shell"
@@ -899,11 +839,11 @@
899
839
  "keyword": {
900
840
  "patterns": [
901
841
  {
902
- "match": "(?<!-)\\b(then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)\\b(?!-)",
842
+ "match": "(?<=^|;|&|\\s)(then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)(?=\\s|;|&|$)",
903
843
  "name": "keyword.control.shell"
904
844
  },
905
845
  {
906
- "match": "(?<![-/])\\b(?:export|declare|typeset|local|readonly)\\b",
846
+ "match": "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)",
907
847
  "name": "storage.modifier.shell"
908
848
  }
909
849
  ]
@@ -932,13 +872,18 @@
932
872
  "loop": {
933
873
  "patterns": [
934
874
  {
935
- "begin": "\\b(for)\\s+(?=\\({2})",
936
- "captures": {
875
+ "begin": "(?<=^|;|&|\\s)(for)\\s+(?=\\({2})",
876
+ "beginCaptures": {
937
877
  "1": {
938
878
  "name": "keyword.control.shell"
939
879
  }
940
880
  },
941
- "end": "\\b(done)\\b",
881
+ "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$)",
882
+ "endCaptures": {
883
+ "0": {
884
+ "name": "keyword.control.shell"
885
+ }
886
+ },
942
887
  "name": "meta.scope.for-loop.shell",
943
888
  "patterns": [
944
889
  {
@@ -947,7 +892,7 @@
947
892
  ]
948
893
  },
949
894
  {
950
- "begin": "\\b(for)\\b\\s+(.+)\\s+\\b(in)\\b",
895
+ "begin": "(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)",
951
896
  "beginCaptures": {
952
897
  "1": {
953
898
  "name": "keyword.control.shell"
@@ -964,7 +909,7 @@
964
909
  "name": "keyword.control.shell"
965
910
  }
966
911
  },
967
- "end": "(?<![-/])\\bdone\\b(?![-/])",
912
+ "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$)",
968
913
  "endCaptures": {
969
914
  "0": {
970
915
  "name": "keyword.control.shell"
@@ -978,13 +923,18 @@
978
923
  ]
979
924
  },
980
925
  {
981
- "begin": "\\b(while|until)\\b",
982
- "captures": {
926
+ "begin": "(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)",
927
+ "beginCaptures": {
983
928
  "1": {
984
929
  "name": "keyword.control.shell"
985
930
  }
986
931
  },
987
- "end": "\\b(done)\\b",
932
+ "end": "(?<=^|;|&|\\s)done(?=\\s|;|&|$)",
933
+ "endCaptures": {
934
+ "0": {
935
+ "name": "keyword.control.shell"
936
+ }
937
+ },
988
938
  "name": "meta.scope.while-loop.shell",
989
939
  "patterns": [
990
940
  {
@@ -993,7 +943,7 @@
993
943
  ]
994
944
  },
995
945
  {
996
- "begin": "\\b(select)\\s+((?:[^\\s\\\\]|\\\\.)+)\\b",
946
+ "begin": "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)",
997
947
  "beginCaptures": {
998
948
  "1": {
999
949
  "name": "keyword.control.shell"
@@ -1002,7 +952,7 @@
1002
952
  "name": "variable.other.loop.shell"
1003
953
  }
1004
954
  },
1005
- "end": "\\b(done)\\b",
955
+ "end": "(?<=^|;|&|\\s)(done)(?=\\s|;|&|$)",
1006
956
  "endCaptures": {
1007
957
  "1": {
1008
958
  "name": "keyword.control.shell"
@@ -1016,23 +966,28 @@
1016
966
  ]
1017
967
  },
1018
968
  {
1019
- "begin": "(?<!-)\\b(case)\\b(?!-)",
1020
- "captures": {
1021
- "1": {
969
+ "begin": "(?<=^|;|&|\\s)case(?=\\s|;|&|$)",
970
+ "beginCaptures": {
971
+ "0": {
972
+ "name": "keyword.control.shell"
973
+ }
974
+ },
975
+ "end": "(?<=^|;|&|\\s)esac(?=\\s|;|&|$)",
976
+ "endCaptures": {
977
+ "0": {
1022
978
  "name": "keyword.control.shell"
1023
979
  }
1024
980
  },
1025
- "end": "\\b(esac)\\b",
1026
981
  "name": "meta.scope.case-block.shell",
1027
982
  "patterns": [
1028
983
  {
1029
- "begin": "\\b(?:in)\\b",
984
+ "begin": "(?<=^|;|&|\\s)in(?=\\s|;|&|$)",
1030
985
  "beginCaptures": {
1031
- "1": {
986
+ "0": {
1032
987
  "name": "keyword.control.shell"
1033
988
  }
1034
989
  },
1035
- "end": "(?=\\b(?:esac)\\b)",
990
+ "end": "(?<=^|;|&|\\s)(?=esac(\\s|;|&|$))",
1036
991
  "name": "meta.scope.case-body.shell",
1037
992
  "patterns": [
1038
993
  {
@@ -1052,13 +1007,18 @@
1052
1007
  ]
1053
1008
  },
1054
1009
  {
1055
- "begin": "(?<!-)\\b(if)\\b(?!-|\\s*=)",
1056
- "captures": {
1057
- "1": {
1010
+ "begin": "(?<=^|;|&|\\s)if(?=\\s|;|&|$)",
1011
+ "beginCaptures": {
1012
+ "0": {
1013
+ "name": "keyword.control.shell"
1014
+ }
1015
+ },
1016
+ "end": "(?<=^|;|&|\\s)fi(?=\\s|;|&|$)",
1017
+ "endCaptures": {
1018
+ "0": {
1058
1019
  "name": "keyword.control.shell"
1059
1020
  }
1060
1021
  },
1061
- "end": "\\b(fi)\\b",
1062
1022
  "name": "meta.scope.if-block.shell",
1063
1023
  "patterns": [
1064
1024
  {
@@ -1115,9 +1075,9 @@
1115
1075
  "name": "punctuation.definition.extglob.shell"
1116
1076
  }
1117
1077
  },
1118
- "end": "(\\))",
1078
+ "end": "\\)",
1119
1079
  "endCaptures": {
1120
- "1": {
1080
+ "0": {
1121
1081
  "name": "punctuation.definition.extglob.shell"
1122
1082
  }
1123
1083
  },
@@ -1133,7 +1093,7 @@
1133
1093
  "pipeline": {
1134
1094
  "patterns": [
1135
1095
  {
1136
- "match": "\\b(time)\\b",
1096
+ "match": "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)",
1137
1097
  "name": "keyword.other.shell"
1138
1098
  },
1139
1099
  {
@@ -1165,7 +1125,6 @@
1165
1125
  ]
1166
1126
  },
1167
1127
  {
1168
- "comment": "valid: &>word >&word >word [n]>&[n] [n]<word [n]>word [n]>>word [n]<&word (last one is duplicate)",
1169
1128
  "match": "&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>",
1170
1129
  "name": "keyword.operator.redirect.shell"
1171
1130
  }
@@ -1257,11 +1216,11 @@
1257
1216
  "support": {
1258
1217
  "patterns": [
1259
1218
  {
1260
- "match": "(?<=^|\\s)(?::|\\.)(?=\\s|;|&|$)",
1219
+ "match": "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)",
1261
1220
  "name": "support.function.builtin.shell"
1262
1221
  },
1263
1222
  {
1264
- "match": "(?<![-/])\\b(?:alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|times|trap|true|type|ulimit|umask|unalias|unset|wait)\\b(?![-/])",
1223
+ "match": "(?<=^|;|&|\\s)(?:alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|times|trap|true|type|ulimit|umask|unalias|unset|wait)(?=\\s|;|&|$)",
1265
1224
  "name": "support.function.builtin.shell"
1266
1225
  }
1267
1226
  ]
@@ -1296,13 +1255,18 @@
1296
1255
  "name": "variable.other.positional.shell"
1297
1256
  },
1298
1257
  {
1299
- "begin": "\\$\\{",
1300
- "captures": {
1258
+ "begin": "\\${",
1259
+ "beginCaptures": {
1260
+ "0": {
1261
+ "name": "punctuation.definition.variable.shell"
1262
+ }
1263
+ },
1264
+ "end": "}",
1265
+ "endCaptures": {
1301
1266
  "0": {
1302
1267
  "name": "punctuation.definition.variable.shell"
1303
1268
  }
1304
1269
  },
1305
- "end": "\\}",
1306
1270
  "name": "variable.other.bracket.shell",
1307
1271
  "patterns": [
1308
1272
  {