github-linguist 4.8.18 → 5.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/hint.haskell.json +11 -8
  3. data/grammars/hint.message.haskell.json +11 -8
  4. data/grammars/hint.type.haskell.json +11 -8
  5. data/grammars/source.abnf.json +20 -9
  6. data/grammars/source.ahk.json +1 -1
  7. data/grammars/source.bsl.json +1 -1
  8. data/grammars/source.c.json +0 -4
  9. data/grammars/source.c.platform.json +93 -14
  10. data/grammars/source.coffee.json +2 -2
  11. data/grammars/source.cs.json +29 -5
  12. data/grammars/source.csound-score.json +57 -30
  13. data/grammars/source.csound.json +44 -4
  14. data/grammars/source.dm.json +1 -1
  15. data/grammars/source.haskell.json +11 -8
  16. data/grammars/source.js.json +116 -62
  17. data/grammars/source.lean.json +1 -1
  18. data/grammars/source.llvm.json +2 -2
  19. data/grammars/source.mask.json +27 -1
  20. data/grammars/source.objc.platform.json +57 -14
  21. data/grammars/source.perl.json +1 -1
  22. data/grammars/source.perl6fe.json +165 -54
  23. data/grammars/source.pony.json +1 -1
  24. data/grammars/source.python.json +2061 -289
  25. data/grammars/source.rascal.json +3 -4
  26. data/grammars/source.regexp.python.json +34 -4
  27. data/grammars/source.sdbl.json +6 -2
  28. data/grammars/source.swift.json +182 -58
  29. data/grammars/source.viml.json +1 -1
  30. data/grammars/source.yaml.json +2 -0
  31. data/grammars/text.html.handlebars.json +3 -3
  32. data/grammars/text.html.php.json +2 -2
  33. data/grammars/text.html.vue.json +42 -1
  34. data/grammars/text.tex.latex.haskell.json +11 -8
  35. data/lib/linguist.rb +2 -1
  36. data/lib/linguist/language.rb +20 -69
  37. data/lib/linguist/languages.json +1 -1
  38. data/lib/linguist/languages.yml +95 -119
  39. data/lib/linguist/popular.yml +1 -1
  40. data/lib/linguist/samples.json +2330 -2330
  41. data/lib/linguist/strategy/extension.rb +10 -0
  42. data/lib/linguist/strategy/filename.rb +3 -2
  43. data/lib/linguist/version.rb +1 -1
  44. metadata +3 -3
  45. data/grammars/source.js.embedded.html.json +0 -10
@@ -27,7 +27,7 @@
27
27
  "name": "punctuation.annotation-argument.end.rascal"
28
28
  }
29
29
  },
30
- "name": "meta.annotation.block.rascal"
30
+ "name": "comment.block.annotation.rascal"
31
31
  },
32
32
  {
33
33
  "captures": {
@@ -276,12 +276,11 @@
276
276
  "name": "markup.underline.link.rascal"
277
277
  }
278
278
  },
279
- "match": "\\|([0-9a-z_A-Z.-_~:/?#\\[\\]@!$&'()*+,;=`])+\\|",
279
+ "match": "\\|([0-9a-z_A-Z.\\-_~:/?#\\[\\]@!$&'()*+,;=`])+\\|",
280
280
  "name": "string.other.url.rascal"
281
281
  }
282
282
  ]
283
283
  }
284
284
  },
285
- "scopeName": "source.rascal",
286
- "uuid": "6d5574d4-85af-4e00-9f3c-9b5fa60f53b8"
285
+ "scopeName": "source.rascal"
287
286
  }
@@ -12,6 +12,32 @@
12
12
  ],
13
13
  "repository": {
14
14
  "regexp-base-expression": {
15
+ "patterns": [
16
+ {
17
+ "include": "#regexp-quantifier"
18
+ },
19
+ {
20
+ "include": "#regexp-base-common"
21
+ }
22
+ ]
23
+ },
24
+ "fregexp-base-expression": {
25
+ "patterns": [
26
+ {
27
+ "include": "#fregexp-quantifier"
28
+ },
29
+ {
30
+ "include": "#fstring-formatting-braces"
31
+ },
32
+ {
33
+ "match": "\\{.*?\\}"
34
+ },
35
+ {
36
+ "include": "#regexp-base-common"
37
+ }
38
+ ]
39
+ },
40
+ "regexp-base-common": {
15
41
  "patterns": [
16
42
  {
17
43
  "name": "support.other.match.any.regexp",
@@ -33,15 +59,19 @@
33
59
  "name": "keyword.operator.disjunction.regexp",
34
60
  "match": "\\|"
35
61
  },
36
- {
37
- "name": "keyword.operator.quantifier.regexp",
38
- "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
39
- },
40
62
  {
41
63
  "include": "#regexp-escape-sequence"
42
64
  }
43
65
  ]
44
66
  },
67
+ "regexp-quantifier": {
68
+ "name": "keyword.operator.quantifier.regexp",
69
+ "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
70
+ },
71
+ "fregexp-quantifier": {
72
+ "name": "keyword.operator.quantifier.regexp",
73
+ "match": "(?x)\n \\{\\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\\}\n"
74
+ },
45
75
  "regexp-backreference-number": {
46
76
  "name": "meta.backreference.regexp",
47
77
  "match": "(\\\\[1-9]\\d?)",
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "1C (Query)",
3
3
  "scopeName": "source.sdbl",
4
- "firstLineMatch": "(?i)Выбрать|Select(\\s+Разрешенные|Allowed)?(\\s+Различные|Distinct)?(\\s+Первые|Top)?.*",
4
+ "fileTypes": [
5
+ "sdbl",
6
+ "query"
7
+ ],
8
+ "firstLineMatch": "(?i)Выбрать|Select(\\s+Разрешенные|\\s+Allowed)?(\\s+Различные|\\s+Distinct)?(\\s+Первые|\\s+Top)?.*",
5
9
  "uuid": "d94265d3-2270-4ff2-ba36-649fbb4160df",
6
10
  "patterns": [
7
11
  {
@@ -58,7 +62,7 @@
58
62
  },
59
63
  {
60
64
  "name": "keyword.control.sdbl",
61
- "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\\sUpdate(\\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)|((Внутреннее\\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а-яё\\.]|$)"
62
66
  },
63
67
  {
64
68
  "comment": "Функции языка запросов",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "comment": "See swift.tmbundle/grammar-test.swift for test cases.",
2
3
  "fileTypes": [
3
4
  "swift"
4
5
  ],
@@ -1132,7 +1133,7 @@
1132
1133
  "name": "keyword.other.generic-constraint-introducer.swift"
1133
1134
  }
1134
1135
  },
1135
- "end": "(?!\\G)\\n|(?=[>{};\\n])",
1136
+ "end": "(?!\\G)$|(?=[>{};\\n]|//|/\\*)",
1136
1137
  "name": "meta.generic-where-clause.swift",
1137
1138
  "patterns": [
1138
1139
  {
@@ -1145,7 +1146,7 @@
1145
1146
  "repository": {
1146
1147
  "requirement-list": {
1147
1148
  "begin": "\\G|,\\s*",
1148
- "end": "(?=[,>{};\\n])",
1149
+ "end": "(?=[,>{};\\n]|//|/\\*)",
1149
1150
  "patterns": [
1150
1151
  {
1151
1152
  "include": "#comments"
@@ -1163,7 +1164,7 @@
1163
1164
  "name": "keyword.operator.generic-constraint.same-type.swift"
1164
1165
  }
1165
1166
  },
1166
- "end": "(?=\\s*[,>{};\\n])",
1167
+ "end": "(?=\\s*[,>{};\\n]|//|/\\*)",
1167
1168
  "name": "meta.generic-where-clause.same-type-requirement.swift",
1168
1169
  "patterns": [
1169
1170
  {
@@ -1178,13 +1179,13 @@
1178
1179
  "name": "keyword.operator.generic-constraint.conforms-to.swift"
1179
1180
  }
1180
1181
  },
1181
- "end": "(?=\\s*[,>{};\\n])",
1182
+ "end": "(?=\\s*[,>{};\\n]|//|/\\*)",
1182
1183
  "name": "meta.generic-where-clause.conformance-requirement.swift",
1183
1184
  "patterns": [
1184
1185
  {
1185
1186
  "begin": "\\G\\s*",
1186
1187
  "contentName": "entity.other.inherited-class.swift",
1187
- "end": "(?=\\s*[,>{};\\n])",
1188
+ "end": "(?=\\s*[,>{};\\n]|//|/\\*)",
1188
1189
  "patterns": [
1189
1190
  {
1190
1191
  "include": "#available-types"
@@ -1256,8 +1257,8 @@
1256
1257
  "name": "punctuation.separator.import.swift"
1257
1258
  },
1258
1259
  {
1259
- "begin": "(?!;|$|//|/\\*)",
1260
- "end": "(?=;|$|//|/\\*)",
1260
+ "begin": "(?!\\s*(;|$|//|/\\*))",
1261
+ "end": "(?=\\s*(;|$|//|/\\*))",
1261
1262
  "name": "invalid.illegal.character-not-allowed-here.swift"
1262
1263
  }
1263
1264
  ]
@@ -1274,20 +1275,70 @@
1274
1275
  "name": "punctuation.separator.inheritance-clause.swift"
1275
1276
  }
1276
1277
  },
1277
- "end": "(?!\\G)\\n|(?=[={}]|(?!\\G)\\bwhere\\b)",
1278
+ "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)",
1278
1279
  "name": "meta.inheritance-clause.swift",
1279
1280
  "patterns": [
1281
+ {
1282
+ "begin": "\\bclass\\b",
1283
+ "beginCaptures": {
1284
+ "0": {
1285
+ "name": "storage.type.class.swift"
1286
+ }
1287
+ },
1288
+ "end": "(?=[={}]|(?!\\G)\\bwhere\\b)",
1289
+ "patterns": [
1290
+ {
1291
+ "include": "#comments"
1292
+ },
1293
+ {
1294
+ "include": "#more-types"
1295
+ }
1296
+ ]
1297
+ },
1280
1298
  {
1281
1299
  "begin": "\\G",
1282
- "end": "(?!\\G)\\n|(?=[={}]|(?!\\G)\\bwhere\\b)",
1300
+ "end": "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)",
1301
+ "patterns": [
1302
+ {
1303
+ "include": "#comments"
1304
+ },
1305
+ {
1306
+ "include": "#inherited-type"
1307
+ },
1308
+ {
1309
+ "include": "#more-types"
1310
+ }
1311
+ ]
1312
+ }
1313
+ ],
1314
+ "repository": {
1315
+ "inherited-type": {
1316
+ "begin": "(?=[`\\p{L}_])",
1317
+ "end": "(?!\\G)",
1283
1318
  "name": "entity.other.inherited-class.swift",
1284
1319
  "patterns": [
1285
1320
  {
1286
- "include": "#available-types"
1321
+ "include": "#type-identifier"
1322
+ }
1323
+ ]
1324
+ },
1325
+ "more-types": {
1326
+ "begin": ",\\s*",
1327
+ "end": "(?!\\G)(?!//|/\\*)|(?=[,={}]|(?!\\G)\\bwhere\\b)",
1328
+ "name": "meta.inheritance-list.more-types",
1329
+ "patterns": [
1330
+ {
1331
+ "include": "#comments"
1332
+ },
1333
+ {
1334
+ "include": "#inherited-type"
1335
+ },
1336
+ {
1337
+ "include": "#more-types"
1287
1338
  }
1288
1339
  ]
1289
1340
  }
1290
- ]
1341
+ }
1291
1342
  },
1292
1343
  "operator": {
1293
1344
  "begin": "(?x)\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\\b(prefix|infix|postfix)\n\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t\\b\n\t\t\t\t\t\t(operator)\n\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t\t\t\t\t\t\t | \\.\t\t\t\t\t\t\t\t\t# Invalid dot\n\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)*+\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )++ )\t\t\t# Dot operators\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t",
@@ -1449,10 +1500,10 @@
1449
1500
  {
1450
1501
  "captures": {
1451
1502
  "1": {
1452
- "name": "entity.name.function.swift"
1503
+ "name": "variable.parameter.function.swift"
1453
1504
  },
1454
1505
  "2": {
1455
- "name": "variable.parameter.function.swift"
1506
+ "name": "entity.name.function.swift"
1456
1507
  },
1457
1508
  "3": {
1458
1509
  "name": "punctuation.definition.identifier.swift"
@@ -1603,6 +1654,10 @@
1603
1654
  {
1604
1655
  "include": "#inheritance-clause"
1605
1656
  },
1657
+ {
1658
+ "comment": "SE-0142: Permit where clauses to constrain associated types",
1659
+ "include": "#generic-where-clause"
1660
+ },
1606
1661
  {
1607
1662
  "begin": "\\{",
1608
1663
  "beginCaptures": {
@@ -1621,6 +1676,9 @@
1621
1676
  {
1622
1677
  "include": "#protocol-method"
1623
1678
  },
1679
+ {
1680
+ "include": "#protocol-initializer"
1681
+ },
1624
1682
  {
1625
1683
  "include": "#associated-type"
1626
1684
  },
@@ -1647,7 +1705,7 @@
1647
1705
  "name": "punctuation.definition.identifier.swift"
1648
1706
  }
1649
1707
  },
1650
- "end": "(?!\\G)\\n|(?=[;}]|$)",
1708
+ "end": "(?!\\G)$|(?=[;}]|$)",
1651
1709
  "name": "meta.definition.associatedtype.swift",
1652
1710
  "patterns": [
1653
1711
  {
@@ -1662,6 +1720,61 @@
1662
1720
  }
1663
1721
  ]
1664
1722
  },
1723
+ "protocol-initializer": {
1724
+ "begin": "(?<!\\.)\\b(init[?!]*(?# only one is valid, but we want the in⇥ snippet to produce something that looks good))\\s*(?=\\(|<)",
1725
+ "beginCaptures": {
1726
+ "1": {
1727
+ "name": "storage.type.function.swift",
1728
+ "patterns": [
1729
+ {
1730
+ "match": "(?<=[?!])[?!]+",
1731
+ "name": "invalid.illegal.character-not-allowed-here.swift"
1732
+ }
1733
+ ]
1734
+ }
1735
+ },
1736
+ "end": "$|(?=;|//|/\\*|\\})",
1737
+ "name": "meta.definition.function.initializer.swift",
1738
+ "patterns": [
1739
+ {
1740
+ "include": "#comments"
1741
+ },
1742
+ {
1743
+ "include": "#generic-parameter-clause"
1744
+ },
1745
+ {
1746
+ "include": "#parameter-clause"
1747
+ },
1748
+ {
1749
+ "match": "\\b(?:throws|rethrows)\\b",
1750
+ "name": "keyword.control.exception.swift"
1751
+ },
1752
+ {
1753
+ "comment": "Swift 3: generic constraints after the parameters and return type",
1754
+ "include": "#generic-where-clause"
1755
+ },
1756
+ {
1757
+ "begin": "\\{",
1758
+ "beginCaptures": {
1759
+ "0": {
1760
+ "name": "punctuation.section.function.begin.swift"
1761
+ }
1762
+ },
1763
+ "end": "\\}",
1764
+ "endCaptures": {
1765
+ "0": {
1766
+ "name": "punctuation.section.function.end.swift"
1767
+ }
1768
+ },
1769
+ "name": "invalid.illegal.function-body-not-allowed-in-protocol.swift",
1770
+ "patterns": [
1771
+ {
1772
+ "include": "$self"
1773
+ }
1774
+ ]
1775
+ }
1776
+ ]
1777
+ },
1665
1778
  "protocol-method": {
1666
1779
  "begin": "(?x)\n\t\t\t\t\t\t\t\t\\b\n\t\t\t\t\t\t\t\t(func)\n\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n\t\t \t\t\t\t\t\t | (?:\n\t\t \t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t \t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t \t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t \t\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t \t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t \t\t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t)*\n\t\t \t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ )\t\t\t# Dot operators\n\t\t \t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t(?=\\(|<)\n\t\t\t\t\t\t\t",
1667
1780
  "beginCaptures": {
@@ -1990,28 +2103,27 @@
1990
2103
  }
1991
2104
  },
1992
2105
  "type-identifier": {
1993
- "patterns": [
1994
- {
1995
- "captures": {
1996
- "0": {
1997
- "patterns": [
1998
- {
1999
- "include": "#builtin-types"
2000
- }
2001
- ]
2002
- },
2003
- "1": {
2004
- "name": "punctuation.definition.identifier.swift"
2005
- },
2006
- "2": {
2007
- "name": "punctuation.definition.identifier.swift"
2106
+ "begin": "((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
2107
+ "beginCaptures": {
2108
+ "1": {
2109
+ "name": "meta.type-name.swift",
2110
+ "patterns": [
2111
+ {
2112
+ "include": "#builtin-types"
2008
2113
  }
2009
- },
2010
- "match": "(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)",
2011
- "name": "meta.type-name.swift"
2114
+ ]
2012
2115
  },
2116
+ "2": {
2117
+ "name": "punctuation.definition.identifier.swift"
2118
+ },
2119
+ "3": {
2120
+ "name": "punctuation.definition.identifier.swift"
2121
+ }
2122
+ },
2123
+ "end": "(?!<)",
2124
+ "patterns": [
2013
2125
  {
2014
- "begin": "(?!\\G)(?=<)",
2126
+ "begin": "(?=<)",
2015
2127
  "end": "(?!\\G)",
2016
2128
  "patterns": [
2017
2129
  {
@@ -2037,11 +2149,17 @@
2037
2149
  "name": "punctuation.definition.identifier.swift"
2038
2150
  }
2039
2151
  },
2040
- "end": "(?!\\G)\\n|(?=;|$)",
2152
+ "end": "(?!\\G)$|(?=;|//|/\\*|$)",
2041
2153
  "name": "meta.definition.typealias.swift",
2042
2154
  "patterns": [
2043
2155
  {
2044
- "include": "#generic-parameter-clause"
2156
+ "begin": "\\G(?=<)",
2157
+ "end": "(?!\\G)",
2158
+ "patterns": [
2159
+ {
2160
+ "include": "#generic-parameter-clause"
2161
+ }
2162
+ ]
2045
2163
  },
2046
2164
  {
2047
2165
  "include": "#typealias-assignment"
@@ -2055,7 +2173,7 @@
2055
2173
  "name": "keyword.operator.assignment.swift"
2056
2174
  }
2057
2175
  },
2058
- "end": "(?!\\G)",
2176
+ "end": "(?!\\G)$|(?=;|//|/\\*|$)",
2059
2177
  "patterns": [
2060
2178
  {
2061
2179
  "include": "#available-types"
@@ -2179,7 +2297,7 @@
2179
2297
  },
2180
2298
  "closure-parameter": {
2181
2299
  "match": "\\$[0-9]+",
2182
- "name": "variable.other.closure-parameter.swift"
2300
+ "name": "variable.language.closure-parameter.swift"
2183
2301
  },
2184
2302
  "compound-name": {
2185
2303
  "captures": {
@@ -2530,17 +2648,17 @@
2530
2648
  },
2531
2649
  {
2532
2650
  "comment": "-0x1.ap2_3, 0x31p-4",
2533
- "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x\\h[\\h_]*)(?:\\.\\h[\\h_]*)?[pP][-+]?[0-9][0-9_]*\\b(?!\\.[0-9])",
2651
+ "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)(?:\\.[0-9a-fA-F][0-9a-fA-F_]*)?[pP][-+]?[0-9][0-9_]*\\b(?!\\.[0-9])",
2534
2652
  "name": "constant.numeric.float.hexadecimal.swift"
2535
2653
  },
2536
2654
  {
2537
2655
  "comment": "0x1p, 0x1p_2, 0x1.5pa, 0x1.1p+1f, 0x1pz",
2538
- "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x\\h[\\h_]*)(?:\\.\\h[\\h_]*)?(?:[pP][-+]?\\w*)\\b(?!\\.[0-9])",
2656
+ "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)(?:\\.[0-9a-fA-F][0-9a-fA-F_]*)?(?:[pP][-+]?\\w*)\\b(?!\\.[0-9])",
2539
2657
  "name": "invalid.illegal.numeric.float.invalid-exponent.swift"
2540
2658
  },
2541
2659
  {
2542
2660
  "comment": "0x1.5w (note that 0x1.f may be a valid expression)",
2543
- "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x\\h[\\h_]*)\\.[0-9][\\w.]*",
2661
+ "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)\\.[0-9][\\w.]*",
2544
2662
  "name": "invalid.illegal.numeric.float.missing-exponent.swift"
2545
2663
  },
2546
2664
  {
@@ -2550,7 +2668,7 @@
2550
2668
  },
2551
2669
  {
2552
2670
  "comment": "0b_0_1, 0x_1p+3q",
2553
- "match": "(\\B\\-|\\b)0[box]_[\\h_]*(?:[pPeE][+-]?\\w+)?[\\w.]+",
2671
+ "match": "(\\B\\-|\\b)0[box]_[0-9a-fA-F_]*(?:[pPeE][+-]?\\w+)?[\\w.]+",
2554
2672
  "name": "invalid.illegal.numeric.leading-underscore.swift"
2555
2673
  },
2556
2674
  {
@@ -2574,7 +2692,7 @@
2574
2692
  },
2575
2693
  {
2576
2694
  "comment": "0x4, 0xF_7",
2577
- "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0x\\h[\\h_]*\\b(?!\\.[0-9])",
2695
+ "match": "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0x[0-9a-fA-F][0-9a-fA-F_]*\\b(?!\\.[0-9])",
2578
2696
  "name": "constant.numeric.integer.hexadecimal.swift"
2579
2697
  },
2580
2698
  {
@@ -2609,31 +2727,37 @@
2609
2727
  "name": "constant.character.escape.swift"
2610
2728
  },
2611
2729
  {
2612
- "match": "\\\\u\\{\\h{1,8}\\}",
2730
+ "match": "\\\\u\\{[0-9a-fA-F]{1,8}\\}",
2613
2731
  "name": "constant.character.escape.unicode.swift"
2614
2732
  },
2615
2733
  {
2616
- "captures": {
2617
- "1": {
2734
+ "begin": "\\\\\\(",
2735
+ "beginCaptures": {
2736
+ "0": {
2618
2737
  "name": "punctuation.section.embedded.begin.swift"
2619
- },
2620
- "2": {
2621
- "name": "source.swift",
2622
- "patterns": [
2623
- {
2624
- "include": "#root"
2625
- }
2626
- ]
2627
- },
2628
- "5": {
2738
+ }
2739
+ },
2740
+ "contentName": "source.swift",
2741
+ "end": "(\\))",
2742
+ "endCaptures": {
2743
+ "0": {
2629
2744
  "name": "punctuation.section.embedded.end.swift"
2630
2745
  },
2631
- "6": {
2746
+ "1": {
2632
2747
  "name": "source.swift"
2633
2748
  }
2634
2749
  },
2635
- "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t(\\\\\\()\t\t\t\t\t\t\t# Opening\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t(?<parens>\n\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\t[^()\"]\t\t\t\t# Anything except parens\n\t\t\t\t\t\t\t\t\t\t\t\t | \\(\t\t\t\t\t# Matched pairs of parens\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\g<parens>\t\t\t# …that can be nested\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\)\n\t\t\t\t\t\t\t\t\t\t\t\t | \"\t\t\t\t\t# Strings\n\t\t\t\t\t\t\t\t\t\t\t\t\t([^\\\\]|\\\\.)*\t\t# Contents allowing for escapes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t\t\t)*\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t((\\)))\t\t\t\t\t\t\t# Closing\n\t\t\t\t\t\t\t\t\t",
2636
- "name": "meta.embedded.line.swift"
2750
+ "name": "meta.embedded.line.swift",
2751
+ "patterns": [
2752
+ {
2753
+ "include": "$self"
2754
+ },
2755
+ {
2756
+ "begin": "\\(",
2757
+ "comment": "Nested parens",
2758
+ "end": "\\)"
2759
+ }
2760
+ ]
2637
2761
  },
2638
2762
  {
2639
2763
  "match": "\\\\.",