github-linguist 7.6.0 → 7.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +5 -5
  2. data/bin/github-linguist +17 -4
  3. data/grammars/annotation.liquidhaskell.haskell.json +58 -11
  4. data/grammars/etc.json +472 -4
  5. data/grammars/hidden.manref.json +29 -0
  6. data/grammars/hidden.regexp.injection-shell.json +28 -0
  7. data/grammars/hint.haskell.json +58 -11
  8. data/grammars/hint.message.haskell.json +58 -11
  9. data/grammars/hint.type.haskell.json +58 -11
  10. data/grammars/injections.etc.json +601 -1
  11. data/grammars/markdown.plantuml.codeblock.json +26 -0
  12. data/grammars/source.4dm.json +1156 -0
  13. data/grammars/source.abap.json +7 -7
  14. data/grammars/source.abl.json +685 -83
  15. data/grammars/source.abnf.json +23 -1
  16. data/grammars/source.agda.json +33 -203
  17. data/grammars/source.ahk.json +9 -5
  18. data/grammars/source.angelscript.json +1 -1
  19. data/grammars/source.ballerina.json +55 -19
  20. data/grammars/source.c++.json +4 -4
  21. data/grammars/source.c.platform.json +584 -33
  22. data/grammars/source.chapel.json +7 -4
  23. data/grammars/source.csound.json +1 -1
  24. data/grammars/source.css.json +3 -3
  25. data/grammars/source.css.scss.json +164 -15
  26. data/grammars/source.curlrc.json +869 -65
  27. data/grammars/source.d.json +2 -2
  28. data/grammars/source.dart.json +58 -32
  29. data/grammars/source.dircolors.json +137 -0
  30. data/grammars/source.direct-x.json +135 -0
  31. data/grammars/source.ebnf.json +67 -39
  32. data/grammars/source.editorconfig.json +23 -5
  33. data/grammars/source.elixir.json +51 -0
  34. data/grammars/source.elm.json +1 -1
  35. data/grammars/source.emacs.lisp.json +10 -0
  36. data/grammars/source.faust.json +119 -0
  37. data/grammars/source.futhark.json +146 -0
  38. data/grammars/source.gcode.json +166 -8
  39. data/grammars/source.gedcom.json +196 -0
  40. data/grammars/source.generic-db.json +41 -0
  41. data/grammars/source.gfm.blade.json +15 -0
  42. data/grammars/source.gfm.json +1697 -1439
  43. data/grammars/source.gitconfig.json +1 -1
  44. data/grammars/source.hack.json +200 -98
  45. data/grammars/source.haskell.json +58 -11
  46. data/grammars/source.hlsl.json +9 -5
  47. data/grammars/source.hosts.json +40 -0
  48. data/grammars/source.hsig.json +58 -11
  49. data/grammars/source.httpspec.json +1 -1
  50. data/grammars/source.hx.json +9 -5
  51. data/grammars/source.hxml.json +2 -2
  52. data/grammars/source.idris.json +1 -1
  53. data/grammars/source.igor.json +46 -2
  54. data/grammars/source.ini.npmrc.json +311 -0
  55. data/grammars/source.inno.json +133 -0
  56. data/grammars/source.inputrc.json +500 -0
  57. data/grammars/source.isabelle.root.json +1 -1
  58. data/grammars/source.jison.json +3 -0
  59. data/grammars/source.jisonlex.json +3 -0
  60. data/grammars/source.js.json +4 -4
  61. data/grammars/source.julia.json +70 -24
  62. data/grammars/source.kotlin.json +17 -51
  63. data/grammars/source.lcov.json +398 -0
  64. data/grammars/source.lean.json +20 -4
  65. data/grammars/source.lean.markdown.json +2598 -0
  66. data/grammars/source.lex.json +4 -4
  67. data/grammars/source.m2.json +125 -0
  68. data/grammars/source.m4.json +141 -99
  69. data/grammars/source.man-conf.json +47 -35
  70. data/grammars/source.matlab.json +437 -184
  71. data/grammars/source.mcfunction-snapshot.json +21388 -561
  72. data/grammars/source.mcfunction.json +55 -5
  73. data/grammars/source.meson.json +1 -1
  74. data/grammars/source.mlir.json +37 -317
  75. data/grammars/source.modula-3.json +10 -0
  76. data/grammars/source.msl.json +755 -0
  77. data/grammars/source.nasl.json +155 -0
  78. data/grammars/source.neon.json +381 -0
  79. data/grammars/source.nextflow.json +2 -2
  80. data/grammars/source.objc.platform.json +493 -35
  81. data/grammars/source.odin-ehr.json +806 -0
  82. data/grammars/source.odin.json +402 -0
  83. data/grammars/source.openbsd-pkg.contents.json +128 -0
  84. data/grammars/source.opts.json +12 -2
  85. data/grammars/source.perl6fe.json +1 -1
  86. data/grammars/source.postscript.json +358 -103
  87. data/grammars/source.prisma.json +435 -0
  88. data/grammars/source.purescript.json +29 -2
  89. data/grammars/source.python.json +52 -0
  90. data/grammars/source.q.json +150 -63
  91. data/grammars/source.qasm.json +66 -0
  92. data/grammars/source.ql.json +1408 -0
  93. data/grammars/source.r.json +4 -4
  94. data/grammars/source.reason.json +28 -16
  95. data/grammars/source.rego.json +124 -0
  96. data/grammars/source.sass.json +158 -3
  97. data/grammars/source.scala.json +53 -18
  98. data/grammars/source.sieve.json +383 -0
  99. data/grammars/source.solidity.json +1 -1
  100. data/grammars/source.ssh-config.json +1 -14
  101. data/grammars/source.swift.json +162 -2
  102. data/grammars/source.sy.json +2088 -183
  103. data/grammars/source.tags.json +266 -0
  104. data/grammars/source.terraform.json +576 -132
  105. data/grammars/source.tnsaudit.json +256 -0
  106. data/grammars/source.ts.json +246 -70
  107. data/grammars/source.tsx.json +247 -71
  108. data/grammars/source.v.json +587 -761
  109. data/grammars/source.vim-snippet.json +645 -0
  110. data/grammars/source.viml.json +6 -6
  111. data/grammars/source.webassembly.json +10 -0
  112. data/grammars/source.webidl.json +8 -0
  113. data/grammars/source.wgetrc.json +1640 -0
  114. data/grammars/source.wsd.json +781 -0
  115. data/grammars/source.x86.json +7 -3
  116. data/grammars/source.zig.json +231 -360
  117. data/grammars/text.dfy.dafny.json +188 -0
  118. data/grammars/text.html.php.blade.json +535 -528
  119. data/grammars/text.html.riot.json +788 -0
  120. data/grammars/text.muse.json +1471 -0
  121. data/grammars/text.openbsd-pkg.desc.json +78 -0
  122. data/grammars/text.roff.json +49 -1
  123. data/grammars/text.sfd.json +21 -0
  124. data/grammars/text.tex.latex.haskell.json +58 -11
  125. data/grammars/text.vim-help.json +383 -0
  126. data/grammars/text.xml.svg.json +8 -2
  127. data/grammars/version +1 -1
  128. data/lib/linguist/VERSION +1 -1
  129. data/lib/linguist/blob_helper.rb +4 -2
  130. data/lib/linguist/file_blob.rb +1 -1
  131. data/lib/linguist/generated.rb +96 -28
  132. data/lib/linguist/heuristics.yml +64 -4
  133. data/lib/linguist/languages.json +1 -1
  134. data/lib/linguist/languages.yml +408 -49
  135. data/lib/linguist/lazy_blob.rb +10 -10
  136. data/lib/linguist/linguist.bundle +0 -0
  137. data/lib/linguist/samples.json +48129 -31562
  138. data/lib/linguist/shebang.rb +5 -3
  139. data/lib/linguist/vendor.yml +71 -60
  140. metadata +48 -17
  141. data/grammars/source.LS.json +0 -85
  142. data/grammars/source.MCPOST.json +0 -54
  143. data/grammars/source.MOD.json +0 -55
  144. data/grammars/source.apt.json +0 -18
  145. data/grammars/source.jlex.json +0 -322
  146. data/grammars/source.yaml-ext.json +0 -324
  147. data/grammars/text.html.abl.json +0 -70
@@ -170,11 +170,15 @@
170
170
  },
171
171
  {
172
172
  "name": "support.constant.preprocessor",
173
- "match": "^\\s*(?\u003c!#)(?:#(?:#(?!#)|(?:un)?assert|define|elif|else|endif|error|ident|(?:ifn?|un)?def|if|import|include(?:_next)?|line|pragma|sccs|warning))|__(?:FILE|LINE|DATE|TIME(?:STAMP)?|STDC_(?:VERSION|HOSTED)?|GNUC|GNUC_MINOR|GNUC_PATCHLEVEL|VERSION|STRICT_ANSI|BASE_FILE|INCLUDE_LEVEL|OPTIMIZE|OPTIMIZE_SIZE|NO_INLINE|CHAR_UNSIGNED|CHAR_BIT|INT_SHORT|SCHAR_MAX|SHRT_MAX|INT_MAX|LONG_MAX|LONG_LONG_MAX|REGISTER_PREFIX|USER_LABEL_PREFIX)__\\b"
173
+ "match": "^\\s*(?\u003c!#)(?:#(?:#(?!#)|(?:un)?assert|define|elif|else|endif|error|ident|(?:ifn?|un)?def|if|import|include(?:_next)?|line|pragma|sccs|warning))\\b"
174
174
  },
175
175
  {
176
- "name": "invalid.warnings",
177
- "match": "^\\s*(?:#\\s+(?:(?:un)?assert|define|elif|else|endif|error|ident|(?:ifn?|un)?def|if|import|include(?:_next)?|line|pragma|sccs|warning)\\b).*"
176
+ "name": "support.constant.preprocessor",
177
+ "match": "\\b__(?:FILE|LINE|DATE|TIME(?:STAMP)?|STDC_(?:VERSION|HOSTED)?|GNUC(?:_MINOR|_PATCHLEVEL)?|VERSION|STRICT_ANSI|BASE_FILE|INCLUDE_LEVEL|OPTIMIZE(?:_SIZE)?|NO_INLINE|CHAR_UNSIGNED|CHAR_BIT|INT_SHORT|SCHAR_MAX|SHRT_MAX|INT_MAX|LONG_MAX|LONG_LONG_MAX|REGISTER_PREFIX|USER_LABEL_PREFIX)__\\b"
178
+ },
179
+ {
180
+ "name": "support.constant.preprocessor",
181
+ "match": "^\\s*(?:#\\s+(?:(?:un)?assert|define|elif|else|endif|error|ident|(?:ifn?|un)?def|if|import|include(?:_next)?|line|pragma|sccs|warning)\\b)"
178
182
  },
179
183
  {
180
184
  "name": "comment.assembly",
@@ -3,17 +3,16 @@
3
3
  "scopeName": "source.zig",
4
4
  "patterns": [
5
5
  {
6
- "include": "#main"
6
+ "include": "#dummy_main"
7
7
  }
8
8
  ],
9
9
  "repository": {
10
10
  "block": {
11
- "contentName": "meta.block.zig",
12
- "begin": "([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")?\\s*(\\{)",
11
+ "begin": "([a-zA-Z_][\\w.]*|@\\\".+\\\")?\\s*(\\{)",
13
12
  "end": "(\\})",
14
13
  "patterns": [
15
14
  {
16
- "include": "#main"
15
+ "include": "#dummy_main"
17
16
  }
18
17
  ],
19
18
  "beginCaptures": {
@@ -58,33 +57,29 @@
58
57
  },
59
58
  {
60
59
  "name": "constant.character.escape.hexidecimal.zig",
61
- "match": "\\\\x[a-fA-F0-9]{2}"
60
+ "match": "\\\\x[a-fA-F\\d]{2}"
62
61
  },
63
62
  {
64
63
  "name": "constant.character.escape.hexidecimal.zig",
65
- "match": "\\\\u\\{[a-fA-F0-9]{1,6}\\}"
64
+ "match": "\\\\u\\{[a-fA-F\\d]{1,6}\\}"
66
65
  }
67
66
  ]
68
67
  },
69
68
  "comments": {
70
69
  "patterns": [
71
70
  {
72
- "name": "comment.line.todo.zig",
73
- "match": "TODO"
71
+ "name": "comment.line.documentation.zig",
72
+ "begin": "///",
73
+ "end": "$\\n?"
74
74
  },
75
75
  {
76
- "name": "comment.line.zig",
77
- "begin": "//[^/]",
78
- "end": "$\\n?",
79
- "patterns": [
80
- {
81
- "include": "#todo"
82
- }
83
- ]
76
+ "name": "comment.line.todo.zig",
77
+ "begin": "//[^/]\\s*TODO",
78
+ "end": "$\\n?"
84
79
  },
85
80
  {
86
- "name": "comment.line.documentation.zig",
87
- "begin": "///",
81
+ "name": "comment.line.zig",
82
+ "begin": "//[^/]*",
88
83
  "end": "$\\n?"
89
84
  }
90
85
  ]
@@ -97,162 +92,47 @@
97
92
  },
98
93
  {
99
94
  "name": "constant.numeric.integer.zig",
100
- "match": "\\b(?\u003c!\\.)(-?[0-9]+)(?!\\.)\\b"
95
+ "match": "\\b(?\u003c!\\.)(-?[\\d_]+)(?!\\.)\\b"
101
96
  },
102
97
  {
103
98
  "name": "constant.numeric.integer.hexadecimal.zig",
104
- "match": "\\b(?\u003c!\\.)(0x[a-fA-F0-9]+)(?!\\.)\\b"
99
+ "match": "\\b(?\u003c!\\.)(0x[a-fA-F\\d_]+)(?!\\.)\\b"
105
100
  },
106
101
  {
107
102
  "name": "constant.numeric.integer.octal.zig",
108
- "match": "\\b(?\u003c!\\.)(0o[0-7]+)(?!\\.)\\b"
103
+ "match": "\\b(?\u003c!\\.)(0o[0-7_]+)(?!\\.)\\b"
109
104
  },
110
105
  {
111
106
  "name": "constant.numeric.integer.binary.zig",
112
- "match": "\\b(?\u003c!\\.)(0b[01]+)(?!\\.)\\b"
107
+ "match": "\\b(?\u003c!\\.)(0b[01_]+)(?!\\.)\\b"
113
108
  },
114
109
  {
115
110
  "name": "constant.numeric.float.zig",
116
- "match": "(?\u003c!\\.)(-?\\b[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)(?!\\.)\\b"
111
+ "match": "(?\u003c!\\.)(-?\\b[\\d_]+(?:\\.[\\d_]+)?(?:[eE][+-]?[\\d_]+)?)(?!\\.)\\b"
117
112
  },
118
113
  {
119
114
  "name": "constant.numeric.float.hexadecimal.zig",
120
- "match": "(?\u003c!\\.)(-?\\b0x[a-fA-F0-9]+(?:\\.[a-fA-F0-9]+)?[pP]?(?:[+-]?[0-9]+)?)(?!\\.)\\b"
115
+ "match": "(?\u003c!\\.)(-?\\b0x[a-fA-F\\d_]+(?:\\.[a-fA-F\\d_]+)?[pP]?(?:[+-]?[\\d_]+)?)(?!\\.)\\b"
121
116
  }
122
117
  ]
123
118
  },
124
119
  "container_decl": {
125
120
  "patterns": [
126
121
  {
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
- }
122
+ "name": "entity.name.union.zig",
123
+ "match": "\\b(?!\\d)([a-zA-Z_]\\w*|@\\\".+\\\")?(?=\\s*=\\s*(?:extern|packed)?\\b\\s*(?:union)\\s*[(\\{])"
163
124
  },
164
125
  {
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
- }
126
+ "name": "entity.name.struct.zig",
127
+ "match": "\\b(?!\\d)([a-zA-Z_]\\w*|@\\\".+\\\")?(?=\\s*=\\s*(?:extern|packed)?\\b\\s*(?:struct)\\s*[(\\{])"
192
128
  },
193
129
  {
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
- }
130
+ "name": "entity.name.enum.zig",
131
+ "match": "\\b(?!\\d)([a-zA-Z_]\\w*|@\\\".+\\\")?(?=\\s*=\\s*(?:extern|packed)?\\b\\s*(?:enum)\\s*[(\\{])"
230
132
  },
231
133
  {
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
- }
134
+ "name": "entity.name.error.zig",
135
+ "match": "\\b(?!\\d)([a-zA-Z_]\\w*|@\\\".+\\\")?(?=\\s*=\\s*(?:error)\\s*[(\\{])"
256
136
  },
257
137
  {
258
138
  "match": "\\b(error)(\\.)([a-zA-Z_]\\w*|@\\\".+\\\")",
@@ -270,13 +150,71 @@
270
150
  }
271
151
  ]
272
152
  },
153
+ "dummy_main": {
154
+ "patterns": [
155
+ {
156
+ "include": "#label"
157
+ },
158
+ {
159
+ "include": "#function_type"
160
+ },
161
+ {
162
+ "include": "#punctuation"
163
+ },
164
+ {
165
+ "include": "#storage_modifier"
166
+ },
167
+ {
168
+ "include": "#container_decl"
169
+ },
170
+ {
171
+ "include": "#constants"
172
+ },
173
+ {
174
+ "include": "#comments"
175
+ },
176
+ {
177
+ "include": "#strings"
178
+ },
179
+ {
180
+ "include": "#storage"
181
+ },
182
+ {
183
+ "include": "#keywords"
184
+ },
185
+ {
186
+ "include": "#operators"
187
+ },
188
+ {
189
+ "include": "#support"
190
+ },
191
+ {
192
+ "include": "#field_decl"
193
+ },
194
+ {
195
+ "include": "#block"
196
+ },
197
+ {
198
+ "include": "#function_def"
199
+ },
200
+ {
201
+ "include": "#function_call"
202
+ },
203
+ {
204
+ "include": "#enum_literal"
205
+ }
206
+ ]
207
+ },
208
+ "enum_literal": {
209
+ "name": "constant.language.enum",
210
+ "match": "(?\u003c!\\w|\\))(\\.(?:[a-zA-Z_]\\w*\\b|@\\\"[^\\\"]*\\\"))(?!\\(|\\s*=[^=\u003e])"
211
+ },
273
212
  "field_decl": {
274
- "contentName": "storage.type.zig",
275
213
  "begin": "([a-zA-Z_]\\w*|@\\\".+\\\")\\s*(:)\\s*",
276
- "end": "(?:(,)|(?:\\n|\\r))",
214
+ "end": "([a-zA-Z_][\\w.]*|@\\\".+\\\")?\\s*(?:(,)|(=)|$)",
277
215
  "patterns": [
278
216
  {
279
- "include": "#main"
217
+ "include": "#dummy_main"
280
218
  }
281
219
  ],
282
220
  "beginCaptures": {
@@ -284,38 +222,46 @@
284
222
  "name": "variable.other.member.zig"
285
223
  },
286
224
  "2": {
287
- "name": "punctuation.terminator.zig"
225
+ "name": "punctuation.separator.zig"
288
226
  }
289
227
  },
290
228
  "endCaptures": {
291
229
  "1": {
230
+ "name": "storage.type.zig"
231
+ },
232
+ "2": {
292
233
  "name": "punctuation.separator.zig"
234
+ },
235
+ "3": {
236
+ "name": "keyword.operator.assignment.zig"
293
237
  }
294
238
  }
295
239
  },
296
- "func_call": {
297
- "contentName": "meta.function-call.zig",
298
- "begin": "([a-zA-Z_]\\w*|@\\\".+\\\")(\\()",
299
- "end": "(\\))",
240
+ "function_call": {
241
+ "name": "variable.function.zig",
242
+ "match": "(?\u003c!fn)\\b([a-zA-Z_]\\w*|@\\\".+\\\")(?=\\s*\\()"
243
+ },
244
+ "function_def": {
245
+ "begin": "(?\u003c=fn)\\s+([a-zA-Z_]\\w*|@\\\".+\\\")(\\()",
246
+ "end": "(?\u003c=\\)[^\\)])\\s*([a-zA-Z_][\\w.]*|@\\\".+\\\")?(!)?\\s*(?:([a-zA-Z_][\\w.]*|@\\\".+\\\")\\b(?!\\s*\\())?",
300
247
  "patterns": [
301
248
  {
302
- "include": "#main"
249
+ "include": "#label"
303
250
  },
304
251
  {
305
- "match": "(?:(,)|(?:\\)))",
306
- "captures": {
307
- "1": {
308
- "name": "punctuation.separator.zig"
309
- },
310
- "2": {
311
- "name": "punctuation.section.parens.end.zig"
312
- }
313
- }
252
+ "include": "#param_list"
253
+ },
254
+ {
255
+ "name": "storage.type.zig",
256
+ "match": "([a-zA-Z_][\\w.]*|@\\\".+\\\")"
257
+ },
258
+ {
259
+ "include": "#dummy_main"
314
260
  }
315
261
  ],
316
262
  "beginCaptures": {
317
263
  "1": {
318
- "name": "variable.function.zig"
264
+ "name": "entity.name.function"
319
265
  },
320
266
  "2": {
321
267
  "name": "punctuation.section.parens.begin.zig"
@@ -323,196 +269,92 @@
323
269
  },
324
270
  "endCaptures": {
325
271
  "1": {
326
- "name": "punctuation.section.parens.end.zig"
272
+ "name": "storage.type.zig"
273
+ },
274
+ "2": {
275
+ "name": "keyword.operator.zig"
276
+ },
277
+ "3": {
278
+ "name": "storage.type.zig"
327
279
  }
328
280
  }
329
281
  },
330
- "keywords": {
282
+ "function_type": {
283
+ "contentName": "meta.function.parameters.zig",
284
+ "begin": "\\b(fn)\\s*(\\()",
285
+ "end": "(?\u003c=\\)|\\})\\s*([a-zA-Z_][\\w.]*|@\\\".+\\\")?\\s*(!)?\\s*([a-zA-Z_][\\w.]*|@\\\".+\\\")",
331
286
  "patterns": [
332
287
  {
333
- "name": "keyword.control.zig",
334
- "match": "\\b(while|for|break|return|continue|asm|defer|errdefer|unreachable)\\b"
288
+ "include": "#label"
335
289
  },
336
290
  {
337
- "name": "keyword.control.async.zig",
338
- "match": "\\b(async|await|suspend|resume|cancel)\\b"
291
+ "include": "#param_list"
339
292
  },
340
293
  {
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"
294
+ "name": "storage.type.zig",
295
+ "match": "([a-zA-Z_][\\w.]*|@\\\".+\\\")"
347
296
  },
348
297
  {
349
- "name": "keyword.other.usingnamespace.zig",
350
- "match": "\\busingnamespace\\b"
298
+ "include": "#dummy_main"
299
+ }
300
+ ],
301
+ "beginCaptures": {
302
+ "1": {
303
+ "name": "storage.type.function.zig"
351
304
  },
352
- {
353
- "name": "keyword.other.test.zig",
354
- "match": "\\btest\\b"
305
+ "2": {
306
+ "name": "punctuation.section.parens.begin.zig"
355
307
  }
356
- ]
357
- },
358
- "label": {
359
- "patterns": [
360
- {
361
- "name": "entity.name.label.zig",
362
- "match": "(?\u003c!\\w):([a-zA-Z_]\\w*|@\\\".+\\\")"
308
+ },
309
+ "endCaptures": {
310
+ "1": {
311
+ "name": "storage.type.zig"
363
312
  },
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
- }
313
+ "2": {
314
+ "name": "keyword.operator.zig"
315
+ },
316
+ "3": {
317
+ "name": "storage.type.zig"
388
318
  }
389
- ]
319
+ }
390
320
  },
391
- "main": {
321
+ "keywords": {
392
322
  "patterns": [
393
323
  {
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
- }
426
- },
427
- {
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
- }
452
- },
453
- {
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
- }
472
- },
473
- {
474
- "include": "#func_call"
475
- },
476
- {
477
- "include": "#label"
478
- },
479
- {
480
- "include": "#punctuation"
481
- },
482
- {
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"
324
+ "name": "keyword.control.zig",
325
+ "match": "\\b(while|for|break|return|continue|asm|defer|errdefer|unreachable)\\b"
496
326
  },
497
327
  {
498
- "include": "#storage"
328
+ "name": "keyword.control.async.zig",
329
+ "match": "\\b(noasync|async|await|suspend|resume|cancel)\\b"
499
330
  },
500
331
  {
501
- "include": "#keywords"
332
+ "name": "keyword.control.conditional.zig",
333
+ "match": "\\b(if|else|switch|try|catch|orelse)\\b"
502
334
  },
503
335
  {
504
- "include": "#operators"
336
+ "name": "keyword.control.import.zig",
337
+ "match": "(?\u003c!\\w)(@import|@cImport|@cInclude)\\b"
505
338
  },
506
339
  {
507
- "include": "#support"
340
+ "name": "keyword.other.usingnamespace.zig",
341
+ "match": "\\b(usingnamespace)\\b"
342
+ }
343
+ ]
344
+ },
345
+ "label": {
346
+ "match": "\\b(break|continue)\\s*:\\s*([a-zA-Z_]\\w*|@\\\".+\\\")\\b|\\b(?!\\d)([a-zA-Z_]\\w*|@\\\".+\\\")\\b(?=\\s*:\\s*(?:\\{|while\\b))",
347
+ "captures": {
348
+ "1": {
349
+ "name": "keyword.control.zig"
508
350
  },
509
- {
510
- "include": "#field_decl"
351
+ "2": {
352
+ "name": "entity.name.label.zig"
511
353
  },
512
- {
513
- "include": "#block"
354
+ "3": {
355
+ "name": "entity.name.label.zig"
514
356
  }
515
- ]
357
+ }
516
358
  },
517
359
  "operators": {
518
360
  "patterns": [
@@ -534,43 +376,46 @@
534
376
  },
535
377
  {
536
378
  "name": "keyword.operator.arithmetic.zig",
537
- "match": "((?:\\+|-|(?\u003c=\\w)\\s*\\*)\\%?|/(?!/)|%)"
379
+ "match": "((?:\\+|-|\\*)\\%?|/(?!/)|%)"
538
380
  },
539
381
  {
540
382
  "name": "keyword.operator.bitwise.zig",
541
- "match": "(\u003c\u003c|\u003e\u003e|\u0026(?=\\W)|\\|(?=[^\\|])|\\^|~)"
383
+ "match": "(\u003c\u003c|\u003e\u003e|\u0026(?=[a-zA-Z_]|@\\\")|\\|(?=[^\\|])|\\^|~)"
542
384
  },
543
385
  {
544
386
  "name": "keyword.operator.other.zig",
545
- "match": "(\\+\\+|\\*\\*|-\u003e|\\.\\?|\\.\\*|\u0026(?=\\w)|\\?|\\|\\||\\.\\.|\\.\\.\\.)"
387
+ "match": "(\\+\\+|\\*\\*|-\u003e|\\.\\?|\\.\\*|\u0026(?=[a-zA-Z_]|@\\\")|\\?|\\|\\||\\.{2,3})"
546
388
  }
547
389
  ]
548
390
  },
549
391
  "param_list": {
550
- "contentName": "storage.type.zig",
551
- "begin": "(comptime|noalias)?\\s*([a-zA-Z_][a-zA-Z0-9_.]*|@\\\".+\\\")\\s*(:)\\s*",
552
- "end": "(?:(,)|(?:\\)))",
392
+ "begin": "([a-zA-Z_]\\w*|@\\\".+\\\")\\s*(:)\\s*",
393
+ "end": "([a-zA-Z_][\\w.]*|@\\\".+\\\")?\\s*(?:(,)|(\\)))",
553
394
  "patterns": [
554
395
  {
555
- "include": "#main"
396
+ "include": "#dummy_main"
397
+ },
398
+ {
399
+ "name": "storage.type.zig",
400
+ "match": "([a-zA-Z_][\\w.]*|@\\\".+\\\")"
556
401
  }
557
402
  ],
558
403
  "beginCaptures": {
559
404
  "1": {
560
- "name": "storage.modifier.zig"
561
- },
562
- "2": {
563
405
  "name": "variable.parameter.zig"
564
406
  },
565
- "3": {
566
- "name": "punctuation.terminator.zig"
407
+ "2": {
408
+ "name": "punctuation.separator.zig"
567
409
  }
568
410
  },
569
411
  "endCaptures": {
570
412
  "1": {
571
- "name": "punctuation.separator.zig"
413
+ "name": "storage.type.zig"
572
414
  },
573
415
  "2": {
416
+ "name": "punctuation.separator.zig"
417
+ },
418
+ "3": {
574
419
  "name": "punctuation.section.parens.end.zig"
575
420
  }
576
421
  }
@@ -586,24 +431,12 @@
586
431
  "match": ";"
587
432
  },
588
433
  {
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
- }
434
+ "name": "punctuation.section.parens.begin.zig",
435
+ "match": "(\\()"
436
+ },
437
+ {
438
+ "name": "punctuation.section.parens.end.zig",
439
+ "match": "(\\))"
607
440
  }
608
441
  ]
609
442
  },
@@ -611,11 +444,11 @@
611
444
  "patterns": [
612
445
  {
613
446
  "name": "storage.type.zig",
614
- "match": "\\b(bool|void|noreturn|type|anyerror|promise)\\b"
447
+ "match": "\\b(bool|void|noreturn|type|anyerror)\\b"
615
448
  },
616
449
  {
617
450
  "name": "storage.type.integer.zig",
618
- "match": "\\b(?\u003c!\\.)([iu][0-9]\\d*|[iu]size|comptime_int)\\b"
451
+ "match": "\\b(?\u003c!\\.)([iu]\\d+|[iu]size|comptime_int)\\b"
619
452
  },
620
453
  {
621
454
  "name": "storage.type.float.zig",
@@ -624,6 +457,44 @@
624
457
  {
625
458
  "name": "storage.type.c_compat.zig",
626
459
  "match": "\\b(c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble|c_void)\\b"
460
+ },
461
+ {
462
+ "match": "\\b(anyframe)\\b\\s*(-\u003e)?\\s*(?:([a-zA-Z_][\\w.]*|@\\\".+\\\")\\b(?!\\s*\\())?",
463
+ "captures": {
464
+ "1": {
465
+ "name": "storage.type.zig"
466
+ },
467
+ "2": {
468
+ "name": "keyword.operator.zig"
469
+ },
470
+ "3": {
471
+ "name": "storage.type.zig"
472
+ }
473
+ }
474
+ },
475
+ {
476
+ "name": "storage.type.function.zig",
477
+ "match": "\\bfn\\b"
478
+ },
479
+ {
480
+ "name": "storage.type.test.zig",
481
+ "match": "\\btest\\b"
482
+ },
483
+ {
484
+ "name": "storage.type.struct.zig",
485
+ "match": "\\bstruct\\b"
486
+ },
487
+ {
488
+ "name": "storage.type.enum.zig",
489
+ "match": "\\benum\\b"
490
+ },
491
+ {
492
+ "name": "storage.type.union.zig",
493
+ "match": "\\bunion\\b"
494
+ },
495
+ {
496
+ "name": "storage.type.error.zig",
497
+ "match": "\\berror\\b"
627
498
  }
628
499
  ]
629
500
  },