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
@@ -30,7 +30,7 @@
30
30
  },
31
31
  {
32
32
  "name": "keyword.yara",
33
- "match": "\\b(true|false|private|global|rule|strings|meta|condition|and|or|not|filesize|in|at|of|for|all|any|nocase|fullword|wide|ascii|xor|entrypoint|them|int8|int16|int32|uint8|uint16|uint32|include|import|matches|contains)\\b"
33
+ "match": "\\b(true|false|private|global|rule|strings|meta|condition|and|or|not|filesize|in|at|of|for|all|any|nocase|fullword|wide|ascii|xor|entrypoint|them|int8|int16|int32|int8be|int16be|int32be|uint8|uint16|uint32|uint8be|uint16be|uint32be|include|import|matches|contains)\\b"
34
34
  },
35
35
  {
36
36
  "name": "constant.numeric.yara",
@@ -3,13 +3,23 @@
3
3
  "scopeName": "source.yasnippet",
4
4
  "patterns": [
5
5
  {
6
- "include": "#main"
6
+ "name": "meta.prologue.yasnippet",
7
+ "begin": "\\A(?=\\s*(?:$|#))",
8
+ "end": "(?:^|\\G)(?=\\s*(?:[^\\s#]|#+\\s*--\\s*$))",
9
+ "patterns": [
10
+ {
11
+ "include": "#prologue-lines"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "include": "#body"
7
17
  }
8
18
  ],
9
19
  "repository": {
10
20
  "body": {
11
21
  "name": "meta.snippet-body.yasnippet",
12
- "begin": "^\\s*(#+)\\s*(--)\\s*$\\n?",
22
+ "begin": "^\\s*((#+)\\s*(--)\\s*$\\n?|(?=[^\\s#]))",
13
23
  "end": "(?=A)B",
14
24
  "patterns": [
15
25
  {
@@ -29,13 +39,13 @@
29
39
  }
30
40
  ],
31
41
  "beginCaptures": {
32
- "0": {
42
+ "1": {
33
43
  "name": "comment.line.number-sign.yasnippet"
34
44
  },
35
- "1": {
45
+ "2": {
36
46
  "name": "punctuation.definition.comment.number-sign.yasnippet"
37
47
  },
38
- "2": {
48
+ "3": {
39
49
  "name": "punctuation.terminator.double-dash.yasnippet"
40
50
  }
41
51
  }
@@ -240,16 +250,6 @@
240
250
  }
241
251
  }
242
252
  },
243
- "main": {
244
- "patterns": [
245
- {
246
- "include": "#prologue"
247
- },
248
- {
249
- "include": "#body"
250
- }
251
- ]
252
- },
253
253
  "numbered-placeholder": {
254
254
  "name": "meta.placeholder-field.numbered.$2-nth.yasnippet",
255
255
  "contentName": "string.unquoted.default-text.yasnippet",
@@ -316,16 +316,6 @@
316
316
  }
317
317
  ]
318
318
  },
319
- "prologue": {
320
- "name": "meta.prologue.yasnippet",
321
- "begin": "\\A",
322
- "end": "^(?=\\s*#+\\s*--\\s*$)",
323
- "patterns": [
324
- {
325
- "include": "#prologue-lines"
326
- }
327
- ]
328
- },
329
319
  "prologue-lines": {
330
320
  "begin": "^\\s*(#+)(?!\\s*--\\s*$)",
331
321
  "end": "$",
@@ -306,7 +306,7 @@
306
306
  }
307
307
  },
308
308
  {
309
- "match": "\\b(event)\\s+((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=s*\\()",
309
+ "match": "\\b(event)\\s+((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=\\s*\\()",
310
310
  "captures": {
311
311
  "1": {
312
312
  "name": "storage.type.zeek"
@@ -317,7 +317,7 @@
317
317
  }
318
318
  },
319
319
  {
320
- "match": "\\b(hook)\\s+((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=s*\\()",
320
+ "match": "\\b(hook)\\s+((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=\\s*\\()",
321
321
  "captures": {
322
322
  "1": {
323
323
  "name": "storage.type.zeek"
@@ -328,7 +328,7 @@
328
328
  }
329
329
  },
330
330
  {
331
- "match": "\\b(function)\\s+((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=s*\\()",
331
+ "match": "\\b(function)\\s+((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=\\s*\\()",
332
332
  "captures": {
333
333
  "1": {
334
334
  "name": "storage.type.zeek"
@@ -382,7 +382,7 @@
382
382
  },
383
383
  {
384
384
  "name": "entity.name.function.call.zeek",
385
- "match": "\\b((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=s*\\()"
385
+ "match": "\\b((?:[A-Za-z_][A-Za-z_0-9]*)(?:::(?:[A-Za-z_][A-Za-z_0-9]*))*)(?=\\s*\\()"
386
386
  },
387
387
  {
388
388
  "name": "punctuation.section.block.begin.zeek",
@@ -3,275 +3,674 @@
3
3
  "scopeName": "source.zig",
4
4
  "patterns": [
5
5
  {
6
- "include": "#storage"
7
- },
8
- {
9
- "include": "#support"
10
- },
11
- {
12
- "include": "#structure"
13
- },
14
- {
15
- "include": "#statement"
16
- },
17
- {
18
- "include": "#async-control"
19
- },
20
- {
21
- "include": "#conditional"
22
- },
23
- {
24
- "include": "#repeat"
25
- },
26
- {
27
- "include": "#constant"
28
- },
29
- {
30
- "include": "#keyword"
31
- },
32
- {
33
- "include": "#type"
34
- },
35
- {
36
- "include": "#type-int"
37
- },
38
- {
39
- "include": "#type-c"
40
- },
41
- {
42
- "include": "#boolean"
43
- },
44
- {
45
- "include": "#operator"
46
- },
47
- {
48
- "include": "#dec-float-number"
49
- },
50
- {
51
- "include": "#hex-float-number"
52
- },
53
- {
54
- "include": "#dec-number"
55
- },
56
- {
57
- "include": "#hex-number"
58
- },
59
- {
60
- "include": "#oct-number"
61
- },
62
- {
63
- "include": "#bin-number"
64
- },
65
- {
66
- "include": "#character"
67
- },
68
- {
69
- "include": "#operators"
70
- },
71
- {
72
- "include": "#comment-line"
73
- },
74
- {
75
- "include": "#comment-line-doc"
76
- },
77
- {
78
- "include": "#strings"
79
- },
80
- {
81
- "include": "#multiline-strings"
82
- },
83
- {
84
- "include": "#escaped_char"
6
+ "include": "#main"
85
7
  }
86
8
  ],
87
9
  "repository": {
88
- "async-control": {
89
- "name": "keyword.control.async.zig",
90
- "match": "\\b(async|await|suspend|resume|cancel)\\b"
91
- },
92
- "bin-number": {
93
- "name": "constant.numeric.bin.zig",
94
- "match": "0b[01]+"
10
+ "block": {
11
+ "contentName": "meta.block.zig",
12
+ "begin": "([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")?\\s*(\\{)",
13
+ "end": "(\\})",
14
+ "patterns": [
15
+ {
16
+ "include": "#main"
17
+ }
18
+ ],
19
+ "beginCaptures": {
20
+ "1": {
21
+ "name": "storage.type.zig"
22
+ },
23
+ "2": {
24
+ "name": "punctuation.section.braces.begin.zig"
25
+ }
26
+ },
27
+ "endCaptures": {
28
+ "1": {
29
+ "name": "punctuation.section.braces.end.zig"
30
+ }
31
+ }
95
32
  },
96
- "boolean": {
97
- "name": "constant.language.zig",
98
- "match": "\\b(true|false)\\b"
33
+ "character_escapes": {
34
+ "patterns": [
35
+ {
36
+ "name": "constant.character.escape.newline.zig",
37
+ "match": "\\\\n"
38
+ },
39
+ {
40
+ "name": "constant.character.escape.carrigereturn.zig",
41
+ "match": "\\\\r"
42
+ },
43
+ {
44
+ "name": "constant.character.escape.tabulator.zig",
45
+ "match": "\\\\t"
46
+ },
47
+ {
48
+ "name": "constant.character.escape.backslash.zig",
49
+ "match": "\\\\\\\\"
50
+ },
51
+ {
52
+ "name": "constant.character.escape.single-quote.zig",
53
+ "match": "\\\\'"
54
+ },
55
+ {
56
+ "name": "constant.character.escape.double-quote.zig",
57
+ "match": "\\\\\\\""
58
+ },
59
+ {
60
+ "name": "constant.character.escape.hexidecimal.zig",
61
+ "match": "\\\\x[a-fA-F0-9]{2}"
62
+ },
63
+ {
64
+ "name": "constant.character.escape.hexidecimal.zig",
65
+ "match": "\\\\u\\{[a-fA-F0-9]{1,6}\\}"
66
+ }
67
+ ]
99
68
  },
100
- "character": {
101
- "name": "string.quoted.double.zig",
102
- "begin": "(\\')",
103
- "end": "\\'",
69
+ "comments": {
104
70
  "patterns": [
105
71
  {
106
- "include": "#escaped_char"
72
+ "name": "comment.line.todo.zig",
73
+ "match": "TODO"
107
74
  },
108
75
  {
109
- "name": "invalid.illegal.character.zig",
110
- "match": "(\\\\[^\\'][^\\']*?)"
76
+ "name": "comment.line.zig",
77
+ "begin": "//[^/]",
78
+ "end": "$\\n?",
79
+ "patterns": [
80
+ {
81
+ "include": "#todo"
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "name": "comment.line.documentation.zig",
87
+ "begin": "///",
88
+ "end": "$\\n?"
111
89
  }
112
90
  ]
113
91
  },
114
- "comment-line": {
115
- "name": "comment.line.zig",
116
- "begin": "//[^/]",
117
- "end": "$\\n?",
92
+ "constants": {
118
93
  "patterns": [
119
94
  {
120
- "include": "#todo"
95
+ "name": "constant.language.zig",
96
+ "match": "\\b(null|undefined|true|false)\\b"
97
+ },
98
+ {
99
+ "name": "constant.numeric.integer.zig",
100
+ "match": "\\b(?\u003c!\\.)(-?[0-9]+)(?!\\.)\\b"
101
+ },
102
+ {
103
+ "name": "constant.numeric.integer.hexadecimal.zig",
104
+ "match": "\\b(?\u003c!\\.)(0x[a-fA-F0-9]+)(?!\\.)\\b"
105
+ },
106
+ {
107
+ "name": "constant.numeric.integer.octal.zig",
108
+ "match": "\\b(?\u003c!\\.)(0o[0-7]+)(?!\\.)\\b"
109
+ },
110
+ {
111
+ "name": "constant.numeric.integer.binary.zig",
112
+ "match": "\\b(?\u003c!\\.)(0b[01]+)(?!\\.)\\b"
113
+ },
114
+ {
115
+ "name": "constant.numeric.float.zig",
116
+ "match": "(?\u003c!\\.)(-?\\b[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)(?!\\.)\\b"
117
+ },
118
+ {
119
+ "name": "constant.numeric.float.hexadecimal.zig",
120
+ "match": "(?\u003c!\\.)(-?\\b0x[a-fA-F0-9]+(?:\\.[a-fA-F0-9]+)?[pP]?(?:[+-]?[0-9]+)?)(?!\\.)\\b"
121
121
  }
122
122
  ]
123
123
  },
124
- "comment-line-doc": {
125
- "name": "comment.line.documentation.zig",
126
- "begin": "///",
127
- "end": "$\\n?"
124
+ "container_decl": {
125
+ "patterns": [
126
+ {
127
+ "contentName": "meta.union",
128
+ "begin": "(?:([a-zA-Z_]\\w*|@\\\".+\\\")\\s*=\\s*)?\\b(packed|extern)?\\b\\s*(union\\b)(?:(\\()([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")(\\)))?\\s*({)",
129
+ "end": "(})",
130
+ "patterns": [
131
+ {
132
+ "include": "#main"
133
+ }
134
+ ],
135
+ "beginCaptures": {
136
+ "1": {
137
+ "name": "entity.name.union.zig"
138
+ },
139
+ "2": {
140
+ "name": "storage.modifier.zig"
141
+ },
142
+ "3": {
143
+ "name": "storage.type.union.zig"
144
+ },
145
+ "4": {
146
+ "name": "punctuation.section.parens.begin.zig"
147
+ },
148
+ "5": {
149
+ "name": "storage.type.zig"
150
+ },
151
+ "6": {
152
+ "name": "punctuation.section.parens.end.zig"
153
+ },
154
+ "7": {
155
+ "name": "punctuation.section.braces.begin.zig"
156
+ }
157
+ },
158
+ "endCaptures": {
159
+ "1": {
160
+ "name": "punctuation.section.braces.end.zig"
161
+ }
162
+ }
163
+ },
164
+ {
165
+ "contentName": "meta.struct.zig",
166
+ "begin": "(?:([a-zA-Z_]\\w*|@\\\".+\\\")\\s*=\\s*)?\\b(packed|extern)?\\b\\s*(struct)\\s*({)",
167
+ "end": "(})",
168
+ "patterns": [
169
+ {
170
+ "include": "#main"
171
+ }
172
+ ],
173
+ "beginCaptures": {
174
+ "1": {
175
+ "name": "entity.name.struct.zig"
176
+ },
177
+ "2": {
178
+ "name": "storage.modifier.zig"
179
+ },
180
+ "3": {
181
+ "name": "storage.type.struct.zig"
182
+ },
183
+ "4": {
184
+ "name": "punctuation.section.braces.begin.zig"
185
+ }
186
+ },
187
+ "endCaptures": {
188
+ "1": {
189
+ "name": "punctuation.section.braces.end.zig"
190
+ }
191
+ }
192
+ },
193
+ {
194
+ "contentName": "meta.enum.zig",
195
+ "begin": "(?:([a-zA-Z_]\\w*|@\\\".+\\\")\\s*=\\s*)?\\b(extern)?\\b\\s*(enum\\b)(?:(\\()([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")(\\)))?\\s*({)",
196
+ "end": "(})",
197
+ "patterns": [
198
+ {
199
+ "include": "#main"
200
+ }
201
+ ],
202
+ "beginCaptures": {
203
+ "1": {
204
+ "name": "entity.name.enum.zig"
205
+ },
206
+ "2": {
207
+ "name": "storage.modifier.zig"
208
+ },
209
+ "3": {
210
+ "name": "storage.type.enum.zig"
211
+ },
212
+ "4": {
213
+ "name": "punctuation.section.parens.begin.zig"
214
+ },
215
+ "5": {
216
+ "name": "storage.type.zig"
217
+ },
218
+ "6": {
219
+ "name": "punctuation.section.parens.end.zig"
220
+ },
221
+ "7": {
222
+ "name": "punctuation.section.braces.begin.zig"
223
+ }
224
+ },
225
+ "endCaptures": {
226
+ "1": {
227
+ "name": "punctuation.section.braces.end.zig"
228
+ }
229
+ }
230
+ },
231
+ {
232
+ "contentName": "meta.error.zig",
233
+ "begin": "(?:([a-zA-Z_]\\w*|@\\\".+\\\")\\s*=\\s*)?\\b(error)\\b\\s*({)",
234
+ "end": "(})",
235
+ "patterns": [
236
+ {
237
+ "include": "#main"
238
+ }
239
+ ],
240
+ "beginCaptures": {
241
+ "1": {
242
+ "name": "entity.name.error.zig"
243
+ },
244
+ "2": {
245
+ "name": "storage.type.error.zig"
246
+ },
247
+ "3": {
248
+ "name": "punctuation.section.braces.begin.zig"
249
+ }
250
+ },
251
+ "endCaptures": {
252
+ "1": {
253
+ "name": "punctuation.section.braces.end.zig"
254
+ }
255
+ }
256
+ },
257
+ {
258
+ "match": "\\b(error)(\\.)([a-zA-Z_]\\w*|@\\\".+\\\")",
259
+ "captures": {
260
+ "1": {
261
+ "name": "storage.type.error.zig"
262
+ },
263
+ "2": {
264
+ "name": "punctuation.accessor.zig"
265
+ },
266
+ "3": {
267
+ "name": "entity.name.error.zig"
268
+ }
269
+ }
270
+ }
271
+ ]
128
272
  },
129
- "conditional": {
130
- "name": "keyword.control.conditional.zig",
131
- "match": "\\b(if|else|switch|and|or|try|catch|orelse)\\b"
273
+ "field_decl": {
274
+ "contentName": "storage.type.zig",
275
+ "begin": "([a-zA-Z_]\\w*|@\\\".+\\\")\\s*(:)\\s*",
276
+ "end": "(?:(,)|(?:\\n|\\r))",
277
+ "patterns": [
278
+ {
279
+ "include": "#main"
280
+ }
281
+ ],
282
+ "beginCaptures": {
283
+ "1": {
284
+ "name": "variable.other.member.zig"
285
+ },
286
+ "2": {
287
+ "name": "punctuation.terminator.zig"
288
+ }
289
+ },
290
+ "endCaptures": {
291
+ "1": {
292
+ "name": "punctuation.separator.zig"
293
+ }
294
+ }
132
295
  },
133
- "constant": {
134
- "name": "constant.language.zig",
135
- "match": "\\b(null|undefined)\\b"
296
+ "func_call": {
297
+ "contentName": "meta.function-call.zig",
298
+ "begin": "([a-zA-Z_]\\w*|@\\\".+\\\")(\\()",
299
+ "end": "(\\))",
300
+ "patterns": [
301
+ {
302
+ "include": "#main"
303
+ },
304
+ {
305
+ "match": "(?:(,)|(?:\\)))",
306
+ "captures": {
307
+ "1": {
308
+ "name": "punctuation.separator.zig"
309
+ },
310
+ "2": {
311
+ "name": "punctuation.section.parens.end.zig"
312
+ }
313
+ }
314
+ }
315
+ ],
316
+ "beginCaptures": {
317
+ "1": {
318
+ "name": "variable.function.zig"
319
+ },
320
+ "2": {
321
+ "name": "punctuation.section.parens.begin.zig"
322
+ }
323
+ },
324
+ "endCaptures": {
325
+ "1": {
326
+ "name": "punctuation.section.parens.end.zig"
327
+ }
328
+ }
136
329
  },
137
- "dec-float-number": {
138
- "name": "constant.numeric.float.zig",
139
- "match": "\\b-?[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?\\b"
330
+ "keywords": {
331
+ "patterns": [
332
+ {
333
+ "name": "keyword.control.zig",
334
+ "match": "\\b(while|for|break|return|continue|asm|defer|errdefer|unreachable)\\b"
335
+ },
336
+ {
337
+ "name": "keyword.control.async.zig",
338
+ "match": "\\b(async|await|suspend|resume|cancel)\\b"
339
+ },
340
+ {
341
+ "name": "keyword.control.conditional.zig",
342
+ "match": "\\b(if|else|switch|try|catch|orelse)\\b"
343
+ },
344
+ {
345
+ "name": "keyword.control.import.zig",
346
+ "match": "(?\u003c!\\w)(@import|@cImport|@cInclude)\\b"
347
+ },
348
+ {
349
+ "name": "keyword.other.usingnamespace.zig",
350
+ "match": "\\busingnamespace\\b"
351
+ },
352
+ {
353
+ "name": "keyword.other.test.zig",
354
+ "match": "\\btest\\b"
355
+ }
356
+ ]
140
357
  },
141
- "dec-number": {
142
- "name": "constant.numeric.integer.zig",
143
- "match": "\\b-?[0-9]+\\b"
358
+ "label": {
359
+ "patterns": [
360
+ {
361
+ "name": "entity.name.label.zig",
362
+ "match": "(?\u003c!\\w):([a-zA-Z_]\\w*|@\\\".+\\\")"
363
+ },
364
+ {
365
+ "begin": "([a-zA-Z_]\\w*|@\\\".+\\\"):\\s*(?:({)|(while|for))",
366
+ "end": "(})",
367
+ "patterns": [
368
+ {
369
+ "include": "#main"
370
+ }
371
+ ],
372
+ "beginCaptures": {
373
+ "1": {
374
+ "name": "entity.name.label.zig"
375
+ },
376
+ "2": {
377
+ "name": "punctuation.section.braces.begin.zig"
378
+ },
379
+ "3": {
380
+ "name": "keyword.control.zig"
381
+ }
382
+ },
383
+ "endCaptures": {
384
+ "1": {
385
+ "name": "punctuation.section.braces.end.zig"
386
+ }
387
+ }
388
+ }
389
+ ]
144
390
  },
145
- "escaped_char": {
391
+ "main": {
146
392
  "patterns": [
147
393
  {
148
- "name": "string.quoted.escape.newline.zig",
149
- "match": "\\\\n"
394
+ "contentName": "meta.parameters.zig",
395
+ "begin": "\\b(fn)(\\()",
396
+ "end": "(\\))\\s*([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")?",
397
+ "patterns": [
398
+ {
399
+ "match": "([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")(,)?",
400
+ "captures": {
401
+ "1": {
402
+ "name": "storage.type.zig"
403
+ },
404
+ "2": {
405
+ "name": "punctuation.separator.zig"
406
+ }
407
+ }
408
+ }
409
+ ],
410
+ "beginCaptures": {
411
+ "1": {
412
+ "name": "storage.type.function.zig"
413
+ },
414
+ "2": {
415
+ "name": "punctuation.section.parens.begin.zig"
416
+ }
417
+ },
418
+ "endCaptures": {
419
+ "1": {
420
+ "name": "punctuation.section.parens.end.zig"
421
+ },
422
+ "2": {
423
+ "name": "storage.type.zig"
424
+ }
425
+ }
150
426
  },
151
427
  {
152
- "name": "string.quoted.escape.carrigereturn.zig",
153
- "match": "\\\\r"
428
+ "contentName": "meta.function.parameters.zig",
429
+ "begin": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")(\\()",
430
+ "end": "(?\u003c=\\))\\s*([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")?",
431
+ "patterns": [
432
+ {
433
+ "include": "#param_list"
434
+ }
435
+ ],
436
+ "beginCaptures": {
437
+ "1": {
438
+ "name": "storage.type.function.zig"
439
+ },
440
+ "2": {
441
+ "name": "entity.name.function.zig"
442
+ },
443
+ "3": {
444
+ "name": "punctuation.section.parens.begin.zig"
445
+ }
446
+ },
447
+ "endCaptures": {
448
+ "1": {
449
+ "name": "storage.type.zig"
450
+ }
451
+ }
154
452
  },
155
453
  {
156
- "name": "string.quoted.escape.tabulator.zig",
157
- "match": "\\\\t"
454
+ "match": "\\b(const|var)\\s+([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")\\s*(:)\\s*([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")\\s*(=)",
455
+ "captures": {
456
+ "1": {
457
+ "name": "storage.modifier.zig"
458
+ },
459
+ "2": {
460
+ "name": "variable.other.zig"
461
+ },
462
+ "3": {
463
+ "name": "punctuation.terminator.zig"
464
+ },
465
+ "4": {
466
+ "name": "storage.type.zig"
467
+ },
468
+ "5": {
469
+ "name": "keyword.operator.assignment.zig"
470
+ }
471
+ }
158
472
  },
159
473
  {
160
- "name": "string.quoted.escape.backslash.zig",
161
- "match": "\\\\\\\\"
474
+ "include": "#func_call"
162
475
  },
163
476
  {
164
- "name": "string.quoted.escape.single-quote.zig",
165
- "match": "\\\\'"
477
+ "include": "#label"
166
478
  },
167
479
  {
168
- "name": "string.quoted.escape.double-quote.zig",
169
- "match": "\\\\\\\""
480
+ "include": "#punctuation"
170
481
  },
171
482
  {
172
- "name": "string.quoted.escape.hexidecimal.zig",
173
- "match": "\\\\x[a-fA-F0-9]{2}"
483
+ "include": "#storage_modifier"
484
+ },
485
+ {
486
+ "include": "#container_decl"
487
+ },
488
+ {
489
+ "include": "#constants"
490
+ },
491
+ {
492
+ "include": "#comments"
493
+ },
494
+ {
495
+ "include": "#strings"
174
496
  },
175
497
  {
176
- "name": "string.quoted.escape.hexidecimal.zig",
177
- "match": "\\\\u[a-fA-F0-9]{4}"
498
+ "include": "#storage"
178
499
  },
179
500
  {
180
- "name": "string.quoted.escape.hexidecimal.zig",
181
- "match": "\\\\U[a-fA-F0-9]{6}"
501
+ "include": "#keywords"
502
+ },
503
+ {
504
+ "include": "#operators"
505
+ },
506
+ {
507
+ "include": "#support"
508
+ },
509
+ {
510
+ "include": "#field_decl"
511
+ },
512
+ {
513
+ "include": "#block"
182
514
  }
183
515
  ]
184
516
  },
185
- "hex-float-number": {
186
- "name": "constant.numeric.float.hex.zig",
187
- "match": "\\b0x[a-fA-F0-9]+(\\.[a-fA-F0-9]+)?([pP][+-]?[0-9]+)?\\b"
188
- },
189
- "hex-number": {
190
- "name": "constant.numeric.hex.zig",
191
- "match": "\\b0x[a-fA-F0-9]+\\b"
192
- },
193
- "keyword": {
194
- "name": "support.function.zig",
195
- "match": "(?\u003c!\\w)(fn|use|test|@[^\\\"\\d][a-zA-Z_]\\w*)\\b"
196
- },
197
- "multiline-strings": {
198
- "name": "string.quoted.other.zig",
199
- "begin": "c?\\\\\\\\",
200
- "end": "$\\n?"
201
- },
202
- "oct-number": {
203
- "name": "constant.numeric.octal.zig",
204
- "match": "\\b0o[0-7]+\\b"
205
- },
206
- "operator": {
517
+ "operators": {
207
518
  "patterns": [
208
519
  {
209
520
  "name": "keyword.operator.zig",
210
- "match": "(==|!=)"
521
+ "match": "\\b!\\b"
522
+ },
523
+ {
524
+ "name": "keyword.operator.logical.zig",
525
+ "match": "(==|(?:!|\u003e|\u003c)=?)"
211
526
  },
212
527
  {
213
528
  "name": "keyword.operator.word.zig",
214
529
  "match": "\\b(and|or)\\b"
215
530
  },
531
+ {
532
+ "name": "keyword.operator.assignment.zig",
533
+ "match": "((?:(?:\\+|-|\\*)\\%?|/|%|\u003c\u003c|\u003e\u003e|\u0026|\\|(?=[^\\|])|\\^)?=)"
534
+ },
216
535
  {
217
536
  "name": "keyword.operator.arithmetic.zig",
218
- "match": "(\\-\\%?|\\+%?|\\*%?|/[^/]|%)=?"
537
+ "match": "((?:\\+|-|(?\u003c=\\w)\\s*\\*)\\%?|/(?!/)|%)"
219
538
  },
220
539
  {
221
540
  "name": "keyword.operator.bitwise.zig",
222
- "match": "(\\\u003c\\\u003c%?|\u003e\u003e|!|\u0026|\\^|\\|)=?"
541
+ "match": "(\u003c\u003c|\u003e\u003e|\u0026(?=\\W)|\\|(?=[^\\|])|\\^|~)"
223
542
  },
224
543
  {
225
- "name": "keyword.operator.special.zig",
226
- "match": "(==|\\+\\+|\\*\\*)"
544
+ "name": "keyword.operator.other.zig",
545
+ "match": "(\\+\\+|\\*\\*|-\u003e|\\.\\?|\\.\\*|\u0026(?=\\w)|\\?|\\|\\||\\.\\.|\\.\\.\\.)"
227
546
  }
228
547
  ]
229
548
  },
230
- "repeat": {
231
- "name": "keyword.control.zig",
232
- "match": "\\b(while|for)\\b"
549
+ "param_list": {
550
+ "contentName": "storage.type.zig",
551
+ "begin": "(comptime|noalias)?\\s*([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")\\s*(:)\\s*",
552
+ "end": "(?:(,)|(?:\\)))",
553
+ "patterns": [
554
+ {
555
+ "include": "#main"
556
+ }
557
+ ],
558
+ "beginCaptures": {
559
+ "1": {
560
+ "name": "storage.modifier.zig"
561
+ },
562
+ "2": {
563
+ "name": "variable.parameter.zig"
564
+ },
565
+ "3": {
566
+ "name": "punctuation.terminator.zig"
567
+ }
568
+ },
569
+ "endCaptures": {
570
+ "1": {
571
+ "name": "punctuation.separator.zig"
572
+ },
573
+ "2": {
574
+ "name": "punctuation.section.parens.end.zig"
575
+ }
576
+ }
233
577
  },
234
- "statement": {
235
- "name": "keyword.control.zig",
236
- "match": "\\b(break|return|continue|asm|defer|errdefer|unreachable)\\b"
578
+ "punctuation": {
579
+ "patterns": [
580
+ {
581
+ "name": "punctuation.separator.zig",
582
+ "match": ","
583
+ },
584
+ {
585
+ "name": "punctuation.terminator.zig",
586
+ "match": ";"
587
+ },
588
+ {
589
+ "contentName": "meta.group.zig",
590
+ "begin": "(\\()",
591
+ "end": "(\\))",
592
+ "patterns": [
593
+ {
594
+ "include": "#main"
595
+ }
596
+ ],
597
+ "beginCaptures": {
598
+ "1": {
599
+ "name": "punctuation.section.parens.begin.zig"
600
+ }
601
+ },
602
+ "endCaptures": {
603
+ "1": {
604
+ "name": "punctuation.section.parens.end.zig"
605
+ }
606
+ }
607
+ }
608
+ ]
237
609
  },
238
610
  "storage": {
239
- "name": "storage.zig",
611
+ "patterns": [
612
+ {
613
+ "name": "storage.type.zig",
614
+ "match": "\\b(bool|void|noreturn|type|anyerror|promise)\\b"
615
+ },
616
+ {
617
+ "name": "storage.type.integer.zig",
618
+ "match": "\\b(?\u003c!\\.)([iu][0-9]\\d*|[iu]size|comptime_int)\\b"
619
+ },
620
+ {
621
+ "name": "storage.type.float.zig",
622
+ "match": "\\b(f16|f32|f64|f128|comptime_float)\\b"
623
+ },
624
+ {
625
+ "name": "storage.type.c_compat.zig",
626
+ "match": "\\b(c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble|c_void)\\b"
627
+ }
628
+ ]
629
+ },
630
+ "storage_modifier": {
631
+ "name": "storage.modifier.zig",
240
632
  "match": "\\b(const|var|extern|packed|export|pub|noalias|inline|comptime|nakedcc|stdcallcc|volatile|align|linksection|threadlocal|allowzero)\\b"
241
633
  },
242
634
  "strings": {
243
- "name": "string.quoted.double.zig",
244
- "begin": "(c\\\"|\\\")",
245
- "end": "\\\"",
246
635
  "patterns": [
247
636
  {
248
- "include": "#escaped_char"
637
+ "name": "string.quoted.single.zig",
638
+ "begin": "\\'",
639
+ "end": "\\'",
640
+ "patterns": [
641
+ {
642
+ "include": "#character_escapes"
643
+ },
644
+ {
645
+ "name": "invalid.illegal.character.zig",
646
+ "match": "\\\\[^\\'][^\\']*?"
647
+ }
648
+ ]
249
649
  },
250
650
  {
251
- "name": "invalid.illegal.character.zig",
252
- "match": "(\\\\[^\\'][^\\']*?)"
651
+ "name": "string.quoted.double.zig",
652
+ "begin": "c?\\\"",
653
+ "end": "\\\"",
654
+ "patterns": [
655
+ {
656
+ "include": "#character_escapes"
657
+ },
658
+ {
659
+ "name": "invalid.illegal.character.zig",
660
+ "match": "\\\\[^\\'][^\\']*?"
661
+ }
662
+ ]
663
+ },
664
+ {
665
+ "name": "string.quoted.other.zig",
666
+ "begin": "c?\\\\\\\\",
667
+ "end": "$\\n?"
253
668
  }
254
669
  ]
255
670
  },
256
- "structure": {
257
- "name": "storage.type.zig",
258
- "match": "\\b(union|struct|enum|error)\\b"
259
- },
260
- "todo": {
261
- "name": "comment.line.todo.zig",
262
- "match": "TODO"
263
- },
264
- "type": {
265
- "name": "storage.type.zig",
266
- "match": "\\b(bool|f16|f32|f64|f128|comptime_float|void|noreturn|type|anyerror|promise)\\b"
267
- },
268
- "type-c": {
269
- "name": "storage.type.zig.c_compat",
270
- "match": "\\b(c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble|c_void)\\b"
271
- },
272
- "type-int": {
273
- "name": "storage.type.zig.integer",
274
- "match": "\\b([iu][1-9]\\d*|i0|u0|isize|usize|comptime_int)\\b"
671
+ "support": {
672
+ "name": "support.function.zig",
673
+ "match": "(?\u003c!\\w)@[^\\\"\\d][a-zA-Z_]\\w*\\b"
275
674
  }
276
675
  }
277
676
  }