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
@@ -6,6 +6,14 @@
6
6
  }
7
7
  ],
8
8
  "repository": {
9
+ "arrow": {
10
+ "patterns": [
11
+ {
12
+ "name": "keyword.other.arrow.haskell",
13
+ "match": "(?:(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:-\u003e|→)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))"
14
+ }
15
+ ]
16
+ },
9
17
  "assignment_op": {
10
18
  "patterns": [
11
19
  {
@@ -26,6 +34,14 @@
26
34
  }
27
35
  ]
28
36
  },
37
+ "big_arrow": {
38
+ "patterns": [
39
+ {
40
+ "name": "keyword.other.big-arrow.haskell",
41
+ "match": "(?:(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:=\u003e|⇒)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))"
42
+ }
43
+ ]
44
+ },
29
45
  "block_comment": {
30
46
  "patterns": [
31
47
  {
@@ -262,24 +278,10 @@
262
278
  "include": "#assignment_op"
263
279
  },
264
280
  {
265
- "match": "(?:(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s*)(?:((?:(?!deriving)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?!deriving)(?:[\\w()'→⇒\\[\\],]|-\u003e|=\u003e)+\\s*)+))(?:(?:\\s+)(?:(?!deriving)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?!deriving)(?:[\\w()'→⇒\\[\\],]|-\u003e|=\u003e)+\\s*)+)))*)?))",
266
- "captures": {
267
- "1": {
268
- "patterns": [
269
- {
270
- "include": "#type_ctor"
271
- }
272
- ]
273
- },
274
- "2": {
275
- "name": "meta.type-signature.haskell",
276
- "patterns": [
277
- {
278
- "include": "#type_signature"
279
- }
280
- ]
281
- }
282
- }
281
+ "include": "#type_ctor_forall"
282
+ },
283
+ {
284
+ "include": "#type_ctor_alt"
283
285
  },
284
286
  {
285
287
  "match": "\\|",
@@ -1408,6 +1410,97 @@
1408
1410
  }
1409
1411
  ]
1410
1412
  },
1413
+ "type_ctor_alt": {
1414
+ "patterns": [
1415
+ {
1416
+ "contentName": "meta.type-signature.haskell",
1417
+ "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s*",
1418
+ "end": "^(?!^[ \\t]|[ \\t]*$)|(?=\\{|\\}|\\||(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))deriving(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])))",
1419
+ "patterns": [
1420
+ {
1421
+ "include": "#comments"
1422
+ },
1423
+ {
1424
+ "include": "#type_signature"
1425
+ }
1426
+ ],
1427
+ "beginCaptures": {
1428
+ "1": {
1429
+ "patterns": [
1430
+ {
1431
+ "include": "#type_ctor"
1432
+ }
1433
+ ]
1434
+ }
1435
+ }
1436
+ }
1437
+ ]
1438
+ },
1439
+ "type_ctor_forall": {
1440
+ "patterns": [
1441
+ {
1442
+ "contentName": "meta.type-signature.haskell",
1443
+ "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))forall(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))",
1444
+ "end": "^(?!^[ \\t]|[ \\t]*$)|(?=\\{|\\}|\\||(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))deriving(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])))",
1445
+ "patterns": [
1446
+ {
1447
+ "include": "#comments"
1448
+ },
1449
+ {
1450
+ "match": "\\G.*?(?:(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:=\u003e|⇒)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))",
1451
+ "captures": {
1452
+ "0": {
1453
+ "patterns": [
1454
+ {
1455
+ "include": "#type_signature"
1456
+ }
1457
+ ]
1458
+ }
1459
+ }
1460
+ },
1461
+ {
1462
+ "match": "\\G.*?\\.",
1463
+ "captures": {
1464
+ "0": {
1465
+ "patterns": [
1466
+ {
1467
+ "include": "#type_signature"
1468
+ }
1469
+ ]
1470
+ }
1471
+ }
1472
+ },
1473
+ {
1474
+ "include": "#big_arrow"
1475
+ },
1476
+ {
1477
+ "include": "#type_variable"
1478
+ },
1479
+ {
1480
+ "begin": "\\(",
1481
+ "end": "\\)",
1482
+ "patterns": [
1483
+ {
1484
+ "include": "#type_signature"
1485
+ }
1486
+ ]
1487
+ },
1488
+ {
1489
+ "include": "#type_ctor_alt"
1490
+ }
1491
+ ],
1492
+ "beginCaptures": {
1493
+ "0": {
1494
+ "patterns": [
1495
+ {
1496
+ "include": "#type_signature"
1497
+ }
1498
+ ]
1499
+ }
1500
+ }
1501
+ }
1502
+ ]
1503
+ },
1411
1504
  "type_name": {
1412
1505
  "patterns": [
1413
1506
  {
@@ -1481,12 +1574,10 @@
1481
1574
  "include": "#string"
1482
1575
  },
1483
1576
  {
1484
- "name": "keyword.other.arrow.haskell",
1485
- "match": "(?:(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:-\u003e|→)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))"
1577
+ "include": "#arrow"
1486
1578
  },
1487
1579
  {
1488
- "name": "keyword.other.big-arrow.haskell",
1489
- "match": "(?:(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:=\u003e|⇒)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))"
1580
+ "include": "#big_arrow"
1490
1581
  },
1491
1582
  {
1492
1583
  "name": "keyword.operator.promoted.haskell",
@@ -1505,8 +1596,7 @@
1505
1596
  "include": "#operator"
1506
1597
  },
1507
1598
  {
1508
- "name": "variable.other.generic-type.haskell",
1509
- "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))"
1599
+ "include": "#type_variable"
1510
1600
  },
1511
1601
  {
1512
1602
  "name": "entity.name.type.promoted.haskell",
@@ -1529,6 +1619,14 @@
1529
1619
  }
1530
1620
  ]
1531
1621
  },
1622
+ "type_variable": {
1623
+ "patterns": [
1624
+ {
1625
+ "name": "variable.other.generic-type.haskell",
1626
+ "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))"
1627
+ }
1628
+ ]
1629
+ },
1532
1630
  "unit": {
1533
1631
  "patterns": [
1534
1632
  {
@@ -2,20 +2,58 @@
2
2
  "scopeName": "injections.etc",
3
3
  "patterns": [
4
4
  {
5
- "name": "meta.embedded.source.diff",
6
- "begin": "(?\u003c=__END__)(?=\\s|$)",
7
- "end": "(?=^(?!diff ))",
5
+ "name": "storage.type.class.${1:/downcase}",
6
+ "match": "(?\u003c!\\w)@?(PINHACK)\\b"
7
+ }
8
+ ],
9
+ "repository": {
10
+ "scopeHack": {
11
+ "begin": "\\A(?:\\xC2\\xAD|\\xAD){50}",
12
+ "end": "(?=A)B",
8
13
  "patterns": [
9
14
  {
10
- "begin": "^(?=diff )",
11
- "end": "(?=A)B",
12
- "patterns": [
13
- {
14
- "include": "source.diff"
15
+ "name": "markup.bold",
16
+ "match": "^ {5}(PRIMER PREVIEW - How grammar scopes look on GitHub):",
17
+ "captures": {
18
+ "1": {
19
+ "name": "constant.other.reference.link"
15
20
  }
16
- ]
21
+ }
22
+ },
23
+ {
24
+ "name": "comment.line",
25
+ "match": "^\\s*Last updated:\\s*(\\d{4}-\\d{2}-\\d{2})$"
26
+ },
27
+ {
28
+ "name": "constant.other.reference.link",
29
+ "match": "^│ +(TEXTMATE.*) +│$",
30
+ "captures": {
31
+ "1": {
32
+ "name": "markup.heading"
33
+ }
34
+ }
35
+ },
36
+ {
37
+ "match": "^│ +│$",
38
+ "captures": {
39
+ "0": {
40
+ "name": "constant.other.reference.link"
41
+ }
42
+ }
43
+ },
44
+ {
45
+ "match": "^│\\s+(([a-z][-a-z.]+)\\t\\S+\\s+░▒▓█+)\\s+│$",
46
+ "captures": {
47
+ "1": {
48
+ "name": "$2"
49
+ }
50
+ }
51
+ },
52
+ {
53
+ "name": "comment.line",
54
+ "match": "^#.*$"
17
55
  }
18
56
  ]
19
57
  }
20
- ]
58
+ }
21
59
  }
@@ -1,445 +1,272 @@
1
1
  {
2
- "name": "ABNF",
2
+ "name": "Augmented Backus-Naur Form",
3
3
  "scopeName": "source.abnf",
4
4
  "patterns": [
5
5
  {
6
- "include": "#comment"
7
- },
8
- {
9
- "include": "#rule"
6
+ "include": "#main"
10
7
  }
11
8
  ],
12
9
  "repository": {
13
- "comment": {
14
- "begin": "(?:(?\u003cwhitespace\u003e^[ \\t]*)|[ \\t]*)(?=;[[:print:]]*$)",
15
- "end": "(?!\\G)",
10
+ "assignment": {
16
11
  "patterns": [
17
12
  {
18
- "include": "#comment-line"
19
- }
20
- ],
21
- "beginCaptures": {
22
- "whitespace": {
23
- "name": "punctuation.whitespace.comment.leading.abnf"
13
+ "name": "keyword.operator.assignment.increment.abnf",
14
+ "match": "=/"
15
+ },
16
+ {
17
+ "name": "keyword.operator.assignment.abnf",
18
+ "match": "="
24
19
  }
25
- }
20
+ ]
26
21
  },
27
- "comment-line": {
22
+ "comment": {
28
23
  "name": "comment.line.semicolon.abnf",
29
24
  "begin": ";",
30
- "end": "\\n",
25
+ "end": "$",
31
26
  "beginCaptures": {
32
27
  "0": {
33
28
  "name": "punctuation.definition.comment.abnf"
34
29
  }
35
30
  }
36
31
  },
37
- "constant": {
38
- "patterns": [
39
- {
40
- "include": "#constant-decimal"
41
- },
42
- {
43
- "include": "#constant-hex"
44
- },
45
- {
46
- "include": "#constant-binary"
47
- }
48
- ]
49
- },
50
- "constant-binary": {
51
- "name": "constant.numeric.binary.abnf",
52
- "match": "(?x)%b\n # First number\n (?\u003cnumber\u003e[^\\s.-]+) \n # Optional \n # - dash followed by last number of range, or\n # - sequence of additional numbers separated by dot\n (?:(?:(?=-)(?\u003cdash\u003e-)(?\u003clast\u003e\\w+)) |\n (?\u003cnumbers\u003e[\\w.]+))?",
53
- "captures": {
54
- "dash": {
55
- "name": "keyword.operator.range.abnf"
56
- },
57
- "last": {
58
- "patterns": [
59
- {
60
- "include": "#digit-binary"
61
- }
62
- ]
63
- },
64
- "number": {
65
- "patterns": [
66
- {
67
- "include": "#digit-binary"
68
- }
69
- ]
70
- },
71
- "numbers": {
72
- "patterns": [
73
- {
74
- "include": "#digits-binary-concatenation"
75
- }
76
- ]
77
- }
78
- }
79
- },
80
- "constant-decimal": {
81
- "name": "constant.numeric.decimal.abnf",
82
- "match": "(?x)%d\n (?\u003cnumber\u003e[^\\s.-]+)\n (?:(?:(?=-)(?\u003cdash\u003e-)(?\u003clast\u003e\\w+)) |\n (?\u003cnumbers\u003e[\\w.]+))?",
83
- "captures": {
84
- "dash": {
85
- "name": "keyword.operator.range.abnf"
86
- },
87
- "last": {
88
- "patterns": [
89
- {
90
- "include": "#digit-decimal"
91
- }
92
- ]
93
- },
94
- "number": {
95
- "patterns": [
96
- {
97
- "include": "#digit-decimal"
98
- }
99
- ]
100
- },
101
- "numbers": {
102
- "patterns": [
103
- {
104
- "include": "#digits-decimal-concatenation"
105
- }
106
- ]
107
- }
108
- }
109
- },
110
- "constant-hex": {
111
- "name": "constant.numeric.hex.abnf",
112
- "match": "(?x)%x\n (?\u003cnumber\u003e[^\\s.-]+)\n (?:(?:(?=-)(?\u003cdash\u003e-)(?\u003clast\u003e\\w+)) |\n (?\u003cnumbers\u003e[\\w.]+))?",
113
- "captures": {
114
- "dash": {
115
- "name": "keyword.operator.range.abnf"
116
- },
117
- "last": {
118
- "patterns": [
119
- {
120
- "include": "#digit-hex"
121
- }
122
- ]
123
- },
124
- "number": {
125
- "patterns": [
126
- {
127
- "include": "#digit-hex"
128
- }
129
- ]
130
- },
131
- "numbers": {
132
- "patterns": [
133
- {
134
- "include": "#digits-hex-concatenation"
135
- }
136
- ]
137
- }
138
- }
139
- },
140
- "digit-binary": {
141
- "patterns": [
142
- {
143
- "include": "#digit-binary-valid"
144
- },
145
- {
146
- "include": "#digit-binary-invalid"
147
- }
148
- ]
149
- },
150
- "digit-binary-invalid": {
151
- "name": "invalid.illegal.digit.binary.abnf",
152
- "match": "\\S"
153
- },
154
- "digit-binary-valid": {
155
- "match": "[01]"
156
- },
157
- "digit-decimal": {
158
- "patterns": [
159
- {
160
- "include": "#digit-decimal-valid"
161
- },
162
- {
163
- "include": "#digit-decimal-invalid"
164
- }
165
- ]
166
- },
167
- "digit-decimal-invalid": {
168
- "name": "invalid.illegal.digit.decimal.abnf",
169
- "match": "\\S"
170
- },
171
- "digit-decimal-valid": {
172
- "match": "\\d"
173
- },
174
- "digit-hex": {
175
- "patterns": [
176
- {
177
- "include": "#digit-hex-valid"
178
- },
179
- {
180
- "include": "#digit-hex-invalid"
181
- }
182
- ]
183
- },
184
- "digit-hex-invalid": {
185
- "name": "invalid.illegal.digit.hex.abnf",
186
- "match": "\\S"
187
- },
188
- "digit-hex-valid": {
189
- "match": "[0-9A-Fa-f]"
190
- },
191
- "digits-binary-concatenation": {
192
- "match": "(?\u003cdot\u003e\\.)(?\u003cnumber\u003e[^\\s.]+)",
193
- "captures": {
194
- "dot": {
195
- "name": "keyword.operator.concatenation.abnf"
196
- },
197
- "number": {
198
- "patterns": [
199
- {
200
- "include": "#digit-binary"
201
- }
202
- ]
203
- }
204
- }
205
- },
206
- "digits-decimal-concatenation": {
207
- "match": "(?\u003cdot\u003e\\.)(?\u003cnumber\u003e[^\\s.]+)",
208
- "captures": {
209
- "dot": {
210
- "name": "keyword.operator.concatenation.abnf"
211
- },
212
- "number": {
213
- "patterns": [
214
- {
215
- "include": "#digit-decimal"
216
- }
217
- ]
218
- }
219
- }
220
- },
221
- "digits-hex-concatenation": {
222
- "match": "(?\u003cdot\u003e\\.)(?\u003cnumber\u003e[^\\s.]+)",
223
- "captures": {
224
- "dot": {
225
- "name": "keyword.operator.concatenation.abnf"
226
- },
227
- "number": {
228
- "patterns": [
229
- {
230
- "include": "#digit-hex"
231
- }
232
- ]
233
- }
234
- }
235
- },
236
- "operator-alternative": {
237
- "name": "keyword.operator.alternative.abnf",
238
- "match": "/"
32
+ "core-rules": {
33
+ "name": "support.constant.reference.core-rule.abnf",
34
+ "match": "(?x)\n\\b\n(ALPHA|BIT|CHAR|CRLF|CR|CTL|DIGIT|DQUOTE\n|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)\n\\b"
239
35
  },
240
- "operator-definition": {
241
- "patterns": [
242
- {
243
- "include": "#operator-equal-alternative"
244
- },
245
- {
246
- "include": "#operator-equal"
247
- }
248
- ]
249
- },
250
- "operator-equal": {
251
- "name": "keyword.operator.equal.abnf",
252
- "match": "="
253
- },
254
- "operator-equal-alternative": {
255
- "name": "keyword.operator.equal-alternative.abnf",
256
- "match": "=/"
257
- },
258
- "rule": {
259
- "name": "meta.rule.abnf",
260
- "begin": "(?x)^(\\s*)\n # We match the name of the rule and all following whitespace \n # characters. We use the additional whitespace to catch a \n # missing closing angle bracket.\n (?\u003cname\u003e\\S+\\s+)\n # The definition operator follows after the rule name.\n (?\u003coperator\u003e\\S+)\n ",
261
- "while": "^(?=\\1\\s)",
262
- "patterns": [
263
- {
264
- "include": "#rule-right-side"
265
- }
266
- ],
267
- "captures": {
268
- "name": {
269
- "name": "entity.name.function.abnf",
270
- "patterns": [
271
- {
272
- "include": "#rule-name"
273
- }
274
- ]
275
- },
276
- "operator": {
277
- "patterns": [
278
- {
279
- "include": "#operator-definition"
280
- },
281
- {
282
- "name": "invalid.illegal.operator.abnf",
283
- "match": "\\S+"
284
- }
285
- ]
286
- }
287
- }
288
- },
289
- "rule-group": {
290
- "name": "meta.rule.group.abnf",
36
+ "group": {
37
+ "name": "meta.group.abnf",
291
38
  "begin": "\\(",
292
39
  "end": "\\)",
293
40
  "patterns": [
294
41
  {
295
- "include": "#rule-right-side"
42
+ "include": "#rhs"
296
43
  }
297
44
  ],
298
- "captures": {
45
+ "beginCaptures": {
299
46
  "0": {
300
- "name": "keyword.other.group.abnf"
47
+ "name": "punctuation.definition.round.bracket.begin.abnf"
48
+ }
49
+ },
50
+ "endCaptures": {
51
+ "0": {
52
+ "name": "punctuation.definition.round.bracket.end.abnf"
301
53
  }
302
54
  }
303
55
  },
304
- "rule-name": {
56
+ "main": {
305
57
  "patterns": [
306
58
  {
307
- "include": "#rule-name-angle-brackets"
59
+ "include": "#comment"
308
60
  },
309
61
  {
310
- "include": "#rule-name-plain"
62
+ "include": "#rule"
311
63
  }
312
64
  ]
313
65
  },
314
- "rule-name-angle-brackets": {
315
- "name": "variable.other.rule",
316
- "begin": "\u003c",
317
- "end": "\u003e|(\\s)",
66
+ "optional": {
67
+ "name": "meta.optional.abnf",
68
+ "begin": "\\[",
69
+ "end": "\\]",
318
70
  "patterns": [
319
71
  {
320
- "include": "#rule-name"
72
+ "include": "#rhs"
321
73
  }
322
74
  ],
323
- "captures": {
75
+ "beginCaptures": {
324
76
  "0": {
325
- "name": "keyword.other.angle-bracket.abnf"
77
+ "name": "punctuation.definition.square.bracket.begin.abnf"
326
78
  }
327
79
  },
328
80
  "endCaptures": {
329
81
  "0": {
330
- "name": "keyword.other.angle-bracket.abnf"
331
- },
332
- "1": {
333
- "name": "invalid.illegal.missing.angle-bracket.abnf"
82
+ "name": "punctuation.definition.square.bracket.end.abnf"
334
83
  }
335
84
  }
336
85
  },
337
- "rule-name-core": {
338
- "match": "(?x)\\b(?\u003crule\u003e\n ALPHA |\n BIT |\n CHAR |\n CR(?:LF)? | \n CTL |\n DIGIT |\n DQUOTE |\n HEXDIG |\n HTAB |\n LF |\n LWSP |\n OCTECT |\n SP |\n VCHAR |\n WSP \n )\\b",
86
+ "quantifier": {
87
+ "name": "meta.quantifier.abnf",
88
+ "match": "([0-9]*)(\\*)",
339
89
  "captures": {
340
- "rule": {
341
- "name": "support.constant.core-rule.$1.abnf"
90
+ "1": {
91
+ "name": "constant.numeric.decimal.integer.int.abnf"
92
+ },
93
+ "2": {
94
+ "name": "keyword.operator.logical.repetition.asterisk.star.abnf"
342
95
  }
343
96
  }
344
97
  },
345
- "rule-name-plain": {
346
- "name": "variable.other.rule.abnf",
347
- "match": "[a-zA-Z][a-zA-Z0-9\\-]*|(?\u003cinvalid\u003e\\S)",
348
- "captures": {
349
- "invalid": {
350
- "name": "invalid.illegal.character.abnf"
351
- }
352
- }
98
+ "reference": {
99
+ "name": "variable.parameter.argument.identifier.reference.abnf",
100
+ "match": "[A-Za-z][-A-Za-z0-9]*"
353
101
  },
354
- "rule-optional": {
355
- "name": "meta.rule.optional.abnf",
356
- "begin": "\\[",
357
- "end": "\\]",
102
+ "rhs": {
358
103
  "patterns": [
359
104
  {
360
- "include": "#rule-right-side"
361
- }
362
- ],
363
- "captures": {
364
- "0": {
365
- "name": "keyword.other.optional.abnf"
366
- }
367
- }
368
- },
369
- "rule-right-side": {
370
- "patterns": [
105
+ "include": "#assignment"
106
+ },
371
107
  {
372
- "include": "#rule-group"
108
+ "include": "#string"
373
109
  },
374
110
  {
375
- "include": "#rule-optional"
111
+ "include": "#terminal"
376
112
  },
377
113
  {
378
- "include": "#variable-repetition"
114
+ "include": "#comment"
379
115
  },
380
116
  {
381
- "include": "#operator-alternative"
117
+ "include": "#quantifier"
382
118
  },
383
119
  {
384
- "include": "#comment"
120
+ "include": "#group"
385
121
  },
386
122
  {
387
- "include": "#constant"
123
+ "include": "#optional"
388
124
  },
389
125
  {
390
- "include": "#string-double-quoted"
126
+ "include": "#core-rules"
391
127
  },
392
128
  {
393
- "include": "#rule-name-core"
129
+ "include": "#reference"
394
130
  },
395
131
  {
396
- "include": "#rule-name"
132
+ "name": "keyword.operator.logical.or.alternation.pipe.abnf",
133
+ "match": "/"
397
134
  }
398
135
  ]
399
136
  },
400
- "string-double-quoted": {
137
+ "rule": {
138
+ "name": "meta.ruleset.$2.abnf",
139
+ "contentName": "meta.rhs.abnf",
140
+ "begin": "(?:^|\\G)(\\s*)([A-Za-z][-A-Za-z0-9]*)",
141
+ "end": "^(?!\\1\\s+\\S)|^(?=\\S)",
401
142
  "patterns": [
402
143
  {
403
- "include": "#string-double-quoted-case-insensitive"
404
- },
405
- {
406
- "include": "#string-double-quoted-case-sensitive"
144
+ "include": "#rhs"
407
145
  }
408
- ]
409
- },
410
- "string-double-quoted-case-insensitive": {
411
- "name": "string.quoted.double.case-insensitive.abnf",
412
- "begin": "(?\u003coperator\u003e%i)?\"",
413
- "end": "\"",
414
- "captures": {
415
- "operator": {
416
- "name": "keyword.operator.case-insensitive.abnf"
146
+ ],
147
+ "beginCaptures": {
148
+ "0": {
149
+ "name": "meta.lhs.abnf"
150
+ },
151
+ "1": {
152
+ "name": "punctuation.whitespace.leading.abnf"
153
+ },
154
+ "2": {
155
+ "name": "entity.name.rule.identifier.abnf"
417
156
  }
418
157
  }
419
158
  },
420
- "string-double-quoted-case-sensitive": {
421
- "name": "string.quoted.double.case-sensitive.abnf",
422
- "begin": "(?\u003coperator\u003e%s)\"",
159
+ "string": {
160
+ "name": "string.quoted.double.abnf",
161
+ "begin": "\"",
423
162
  "end": "\"",
424
- "captures": {
425
- "operator": {
426
- "name": "keyword.operator.case-insensitive.abnf"
163
+ "beginCaptures": {
164
+ "0": {
165
+ "name": "punctuation.definition.string.begin.abnf"
166
+ }
167
+ },
168
+ "endCaptures": {
169
+ "0": {
170
+ "name": "punctuation.definition.string.end.abnf"
427
171
  }
428
172
  }
429
173
  },
430
- "variable-repetition": {
431
- "match": "(?x)\n # Repetition\n (?:(?\u003cmin\u003e\\d*)(?\u003crepetition\u003e\\*)(?\u003cmax\u003e\\d*) |\n (?\u003cmax\u003e\\d+))\n # Followed by ABNF element\n (?=[a-zA-Z(\"])",
432
- "captures": {
433
- "max": {
434
- "name": "constant.numeric.decimal.$max.abnf"
174
+ "terminal": {
175
+ "patterns": [
176
+ {
177
+ "name": "meta.terminal.numeric.decimal.abnf",
178
+ "begin": "(%)(d|D)",
179
+ "end": "(?=$|[;()\\[\\]{}\\s])",
180
+ "patterns": [
181
+ {
182
+ "name": "invalid.illegal.syntax.abnf",
183
+ "match": "[0-9A-Fa-f]*[^-\\s0-9.;()\\[\\]{}][^-.;()\\[\\]{}]*"
184
+ },
185
+ {
186
+ "name": "constant.numeric.integer.int.decimal.abnf",
187
+ "match": "[0-9]+"
188
+ },
189
+ {
190
+ "name": "punctuation.separator.range.dash.hyphen.abnf",
191
+ "match": "-"
192
+ },
193
+ {
194
+ "name": "keyword.operator.concatenation.abnf",
195
+ "match": "\\."
196
+ }
197
+ ],
198
+ "beginCaptures": {
199
+ "1": {
200
+ "name": "punctuation.definition.terminal.percentage-sign.abnf"
201
+ },
202
+ "2": {
203
+ "name": "storage.type.modifier.radix.abnf"
204
+ }
205
+ }
435
206
  },
436
- "min": {
437
- "name": "constant.numeric.decimal.$min.abnf"
207
+ {
208
+ "name": "meta.terminal.numeric.hexadecimal.hex.abnf",
209
+ "begin": "(%)(x|X)",
210
+ "end": "(?=$|[;()\\[\\]{}\\s])",
211
+ "patterns": [
212
+ {
213
+ "name": "invalid.illegal.syntax.abnf",
214
+ "match": "[0-9A-Fa-f]*[^-\\s0-9A-Fa-f.;()\\[\\]{}][^-.;()\\[\\]{}]*"
215
+ },
216
+ {
217
+ "name": "constant.numeric.integer.int.hexadecimal.hex.abnf",
218
+ "match": "[0-9A-Fa-f]+"
219
+ },
220
+ {
221
+ "name": "punctuation.separator.range.dash.hyphen.abnf",
222
+ "match": "-"
223
+ },
224
+ {
225
+ "name": "keyword.operator.concatenation.abnf",
226
+ "match": "\\."
227
+ }
228
+ ],
229
+ "beginCaptures": {
230
+ "1": {
231
+ "name": "punctuation.definition.terminal.percentage-sign.abnf"
232
+ },
233
+ "2": {
234
+ "name": "storage.type.modifier.radix.abnf"
235
+ }
236
+ }
438
237
  },
439
- "repetition": {
440
- "name": "keyword.operator.repetition.abnf"
238
+ {
239
+ "name": "meta.terminal.numeric.binary.bin.abnf",
240
+ "begin": "(%)(b|B)",
241
+ "end": "(?=$|[;()\\[\\]{}\\s])",
242
+ "patterns": [
243
+ {
244
+ "name": "invalid.illegal.syntax.abnf",
245
+ "match": "[0-1]*[^-\\s0-1.;()\\[\\]{}][^-.;()\\[\\]{}]*"
246
+ },
247
+ {
248
+ "name": "constant.numeric.integer.int.binary.bin.abnf",
249
+ "match": "[0-1]+"
250
+ },
251
+ {
252
+ "name": "punctuation.separator.range.dash.hyphen.abnf",
253
+ "match": "-"
254
+ },
255
+ {
256
+ "name": "keyword.operator.concatenation.abnf",
257
+ "match": "\\."
258
+ }
259
+ ],
260
+ "beginCaptures": {
261
+ "1": {
262
+ "name": "punctuation.definition.terminal.percentage-sign.abnf"
263
+ },
264
+ "2": {
265
+ "name": "storage.type.modifier.radix.abnf"
266
+ }
267
+ }
441
268
  }
442
- }
269
+ ]
443
270
  }
444
271
  }
445
272
  }