github-linguist 7.6.1 → 7.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) 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 +212 -3
  5. data/grammars/hidden.manref.json +29 -0
  6. data/grammars/hint.haskell.json +58 -11
  7. data/grammars/hint.message.haskell.json +58 -11
  8. data/grammars/hint.type.haskell.json +58 -11
  9. data/grammars/injections.etc.json +601 -1
  10. data/grammars/markdown.plantuml.codeblock.json +26 -0
  11. data/grammars/source.4dm.json +1100 -0
  12. data/grammars/source.abap.json +7 -7
  13. data/grammars/source.abnf.json +23 -1
  14. data/grammars/source.agda.json +32 -202
  15. data/grammars/source.ahk.json +9 -5
  16. data/grammars/source.angelscript.json +1 -1
  17. data/grammars/source.ballerina.json +54 -18
  18. data/grammars/source.chapel.json +4 -4
  19. data/grammars/source.csound.json +1 -1
  20. data/grammars/source.css.json +2 -2
  21. data/grammars/source.css.scss.json +164 -15
  22. data/grammars/source.curlrc.json +869 -65
  23. data/grammars/source.dart.json +58 -32
  24. data/grammars/source.dircolors.json +137 -0
  25. data/grammars/source.direct-x.json +135 -0
  26. data/grammars/source.ebnf.json +67 -39
  27. data/grammars/source.editorconfig.json +23 -5
  28. data/grammars/source.elixir.json +51 -0
  29. data/grammars/source.elm.json +1 -1
  30. data/grammars/source.emacs.lisp.json +10 -0
  31. data/grammars/source.faust.json +119 -0
  32. data/grammars/source.gcode.json +166 -8
  33. data/grammars/source.gfm.json +1 -1
  34. data/grammars/source.gitconfig.json +1 -1
  35. data/grammars/source.hack.json +200 -98
  36. data/grammars/source.haskell.json +58 -11
  37. data/grammars/source.hlsl.json +9 -5
  38. data/grammars/source.hosts.json +40 -0
  39. data/grammars/source.hsig.json +58 -11
  40. data/grammars/source.hx.json +4 -0
  41. data/grammars/source.igor.json +46 -2
  42. data/grammars/source.ini.npmrc.json +311 -0
  43. data/grammars/source.inno.json +133 -0
  44. data/grammars/source.inputrc.json +500 -0
  45. data/grammars/source.js.json +4 -4
  46. data/grammars/source.julia.json +69 -23
  47. data/grammars/source.kotlin.json +1 -1
  48. data/grammars/source.lean.json +19 -3
  49. data/grammars/source.lean.markdown.json +2598 -0
  50. data/grammars/source.lex.json +4 -4
  51. data/grammars/source.m4.json +141 -99
  52. data/grammars/source.man-conf.json +46 -34
  53. data/grammars/source.matlab.json +437 -184
  54. data/grammars/source.mcfunction-snapshot.json +21388 -561
  55. data/grammars/source.mcfunction.json +55 -5
  56. data/grammars/source.meson.json +1 -1
  57. data/grammars/source.mlir.json +37 -317
  58. data/grammars/source.mrc.json +740 -0
  59. data/grammars/source.nasl.json +155 -0
  60. data/grammars/source.nextflow.json +2 -2
  61. data/grammars/source.odin-ehr.json +806 -0
  62. data/grammars/source.odin.json +402 -0
  63. data/grammars/source.opts.json +12 -2
  64. data/grammars/source.p4.json +21 -5
  65. data/grammars/source.prisma.json +435 -0
  66. data/grammars/source.python.json +2 -0
  67. data/grammars/source.qasm.json +66 -0
  68. data/grammars/source.ql.json +1408 -0
  69. data/grammars/source.reason.json +28 -16
  70. data/grammars/source.rego.json +124 -0
  71. data/grammars/source.sass.json +158 -3
  72. data/grammars/source.scala.json +53 -18
  73. data/grammars/source.ssh-config.json +1 -14
  74. data/grammars/source.swift.json +162 -2
  75. data/grammars/source.sy.json +2088 -183
  76. data/grammars/source.terraform.json +576 -132
  77. data/grammars/source.tnsaudit.json +256 -0
  78. data/grammars/source.ts.json +159 -51
  79. data/grammars/source.tsx.json +160 -52
  80. data/grammars/source.v.json +559 -764
  81. data/grammars/source.vim-snippet.json +645 -0
  82. data/grammars/source.viml.json +6 -6
  83. data/grammars/source.webassembly.json +10 -0
  84. data/grammars/source.wgetrc.json +1640 -0
  85. data/grammars/source.wsd.json +775 -0
  86. data/grammars/source.zig.json +169 -304
  87. data/grammars/text.html.php.blade.json +1 -1
  88. data/grammars/text.html.riot.json +788 -0
  89. data/grammars/text.muse.json +1471 -0
  90. data/grammars/text.tex.latex.haskell.json +58 -11
  91. data/grammars/text.vim-help.json +383 -0
  92. data/grammars/version +1 -1
  93. data/lib/linguist/VERSION +1 -1
  94. data/lib/linguist/blob_helper.rb +4 -2
  95. data/lib/linguist/file_blob.rb +1 -1
  96. data/lib/linguist/generated.rb +60 -13
  97. data/lib/linguist/heuristics.yml +64 -4
  98. data/lib/linguist/languages.json +1 -1
  99. data/lib/linguist/languages.yml +336 -45
  100. data/lib/linguist/lazy_blob.rb +10 -10
  101. data/lib/linguist/linguist.bundle +0 -0
  102. data/lib/linguist/samples.json +43560 -31457
  103. data/lib/linguist/shebang.rb +5 -3
  104. data/lib/linguist/vendor.yml +9 -0
  105. metadata +29 -10
  106. data/grammars/source.LS.json +0 -85
  107. data/grammars/source.MCPOST.json +0 -54
  108. data/grammars/source.MOD.json +0 -55
  109. data/grammars/source.apt.json +0 -18
  110. data/grammars/source.jlex.json +0 -322
  111. data/grammars/source.yaml-ext.json +0 -324
@@ -3,78 +3,91 @@
3
3
  "scopeName": "source.matlab",
4
4
  "patterns": [
5
5
  {
6
- "include": "#classdef"
7
- },
8
- {
9
- "include": "#function"
10
- },
11
- {
12
- "include": "#blocks"
13
- },
14
- {
15
- "include": "#control_statements"
16
- },
17
- {
18
- "include": "#global_persistent"
6
+ "include": "#all_before_command_dual"
19
7
  },
20
8
  {
21
9
  "include": "#command_dual"
22
10
  },
23
11
  {
24
- "include": "#string"
25
- },
26
- {
27
- "include": "#line_continuation"
28
- },
29
- {
30
- "include": "#comments"
31
- },
32
- {
33
- "include": "#transpose"
34
- },
35
- {
36
- "include": "#constants"
37
- },
38
- {
39
- "include": "#variables"
40
- },
41
- {
42
- "include": "#end_in_parens"
43
- },
44
- {
45
- "include": "#numbers"
46
- },
47
- {
48
- "include": "#operators"
12
+ "include": "#all_after_command_dual"
49
13
  }
50
14
  ],
51
15
  "repository": {
16
+ "all_after_command_dual": {
17
+ "patterns": [
18
+ {
19
+ "include": "#string"
20
+ },
21
+ {
22
+ "include": "#line_continuation"
23
+ },
24
+ {
25
+ "include": "#comments"
26
+ },
27
+ {
28
+ "include": "#conjugate_transpose"
29
+ },
30
+ {
31
+ "include": "#transpose"
32
+ },
33
+ {
34
+ "include": "#constants"
35
+ },
36
+ {
37
+ "include": "#variables"
38
+ },
39
+ {
40
+ "include": "#numbers"
41
+ },
42
+ {
43
+ "include": "#operators"
44
+ }
45
+ ]
46
+ },
47
+ "all_before_command_dual": {
48
+ "patterns": [
49
+ {
50
+ "include": "#classdef"
51
+ },
52
+ {
53
+ "include": "#function"
54
+ },
55
+ {
56
+ "include": "#blocks"
57
+ },
58
+ {
59
+ "include": "#control_statements"
60
+ },
61
+ {
62
+ "include": "#global_persistent"
63
+ },
64
+ {
65
+ "include": "#parens"
66
+ },
67
+ {
68
+ "include": "#square_brackets"
69
+ },
70
+ {
71
+ "include": "#indexing_curly_brackets"
72
+ },
73
+ {
74
+ "include": "#curly_brackets"
75
+ }
76
+ ]
77
+ },
52
78
  "blocks": {
53
79
  "patterns": [
54
80
  {
55
81
  "name": "meta.for.matlab",
56
- "begin": "(^\\s*)(for)\\b",
57
- "end": "^\\s*(end)\\b",
82
+ "begin": "\\s*(?:^|[\\s,;])(for)\\b",
83
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
58
84
  "patterns": [
59
- {
60
- "name": "meta.for-quantity.matlab",
61
- "begin": "\\G(?!$)",
62
- "end": "$\\n?",
63
- "patterns": [
64
- {
65
- "include": "$self"
66
- }
67
- ]
68
- },
69
85
  {
70
86
  "include": "$self"
71
87
  }
72
88
  ],
73
89
  "beginCaptures": {
74
- "0": {
75
- "name": "meta.for-quantity.matlab"
76
- },
77
- "2": {
90
+ "1": {
78
91
  "name": "keyword.control.for.matlab"
79
92
  }
80
93
  },
@@ -86,27 +99,14 @@
86
99
  },
87
100
  {
88
101
  "name": "meta.if.matlab",
89
- "begin": "(^\\s*)(if)\\b",
90
- "end": "^\\s*(end)\\b",
102
+ "begin": "\\s*(?:^|[\\s,;])(if)\\b",
103
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
91
104
  "patterns": [
92
- {
93
- "name": "meta.if-condition.matlab",
94
- "begin": "\\G(?!$)",
95
- "end": "$\\n?",
96
- "patterns": [
97
- {
98
- "include": "$self"
99
- }
100
- ]
101
- },
102
105
  {
103
106
  "name": "meta.elseif.matlab",
104
- "match": "(^\\s*)(elseif)\\b(.*)$\\n?",
107
+ "match": "(\\s*)(?:^|[\\s,;])(elseif)\\b(.*)$\\n?",
105
108
  "end": "^",
106
109
  "captures": {
107
- "0": {
108
- "name": "meta.elseif-condition.matlab"
109
- },
110
110
  "2": {
111
111
  "name": "keyword.control.elseif.matlab"
112
112
  },
@@ -121,12 +121,9 @@
121
121
  },
122
122
  {
123
123
  "name": "meta.else.matlab",
124
- "match": "(^\\s*)(else)\\b(.*)?$\\n?",
124
+ "match": "(\\s*)(?:^|[\\s,;])(else)\\b(.*)?$\\n?",
125
125
  "end": "^",
126
126
  "captures": {
127
- "0": {
128
- "name": "meta.else-condition.matlab"
129
- },
130
127
  "2": {
131
128
  "name": "keyword.control.else.matlab"
132
129
  },
@@ -144,23 +141,27 @@
144
141
  }
145
142
  ],
146
143
  "beginCaptures": {
147
- "0": {
148
- "name": "meta.if-condition.matlab"
149
- },
150
- "2": {
144
+ "1": {
151
145
  "name": "keyword.control.if.matlab"
152
146
  }
153
147
  },
154
148
  "endCaptures": {
155
149
  "1": {
156
150
  "name": "keyword.control.end.if.matlab"
151
+ },
152
+ "2": {
153
+ "patterns": [
154
+ {
155
+ "include": "$self"
156
+ }
157
+ ]
157
158
  }
158
159
  }
159
160
  },
160
161
  {
161
162
  "name": "meta.parfor.matlab",
162
- "begin": "(^\\s*)(parfor)\\b",
163
- "end": "^\\s*(end)\\b",
163
+ "begin": "\\s*(?:^|[\\s,;])(parfor)\\b",
164
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
164
165
  "patterns": [
165
166
  {
166
167
  "name": "meta.parfor-quantity.matlab",
@@ -177,10 +178,7 @@
177
178
  }
178
179
  ],
179
180
  "beginCaptures": {
180
- "0": {
181
- "name": "meta.parfor-quantity.matlab"
182
- },
183
- "2": {
181
+ "1": {
184
182
  "name": "keyword.control.for.matlab"
185
183
  }
186
184
  },
@@ -192,8 +190,8 @@
192
190
  },
193
191
  {
194
192
  "name": "meta.spmd.matlab",
195
- "begin": "(^\\s*)(spmd)\\b",
196
- "end": "^\\s*(end)\\b",
193
+ "begin": "\\s*(?:^|[\\s,;])(spmd)\\b",
194
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
197
195
  "patterns": [
198
196
  {
199
197
  "name": "meta.spmd-statement.matlab",
@@ -210,10 +208,7 @@
210
208
  }
211
209
  ],
212
210
  "beginCaptures": {
213
- "0": {
214
- "name": "meta.spmd-statement.matlab"
215
- },
216
- "2": {
211
+ "1": {
217
212
  "name": "keyword.control.spmd.matlab"
218
213
  }
219
214
  },
@@ -225,27 +220,14 @@
225
220
  },
226
221
  {
227
222
  "name": "meta.switch.matlab",
228
- "begin": "(^\\s*)(switch)\\b",
229
- "end": "^\\s*(end)\\b",
223
+ "begin": "\\s*(?:^|[\\s,;])(switch)\\b",
224
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
230
225
  "patterns": [
231
- {
232
- "name": "meta.switch-expression.matlab",
233
- "begin": "\\G(?!$)",
234
- "end": "$\\n?",
235
- "patterns": [
236
- {
237
- "include": "$self"
238
- }
239
- ]
240
- },
241
226
  {
242
227
  "name": "meta.case.matlab",
243
- "match": "(^\\s*)(case)\\b(.*)$\\n?",
228
+ "match": "(\\s*)(?:^|[\\s,;])(case)\\b(.*)$\\n?",
244
229
  "end": "^",
245
230
  "captures": {
246
- "0": {
247
- "name": "meta.case-expression.matlab"
248
- },
249
231
  "2": {
250
232
  "name": "keyword.control.case.matlab"
251
233
  },
@@ -260,12 +242,9 @@
260
242
  },
261
243
  {
262
244
  "name": "meta.otherwise.matlab",
263
- "match": "(^\\s*)(otherwise)\\b(.*)?$\\n?",
245
+ "match": "(\\s*)(?:^|[\\s,;])(otherwise)\\b(.*)?$\\n?",
264
246
  "end": "^",
265
247
  "captures": {
266
- "0": {
267
- "name": "meta.otherwise-expression.matlab"
268
- },
269
248
  "2": {
270
249
  "name": "keyword.control.otherwise.matlab"
271
250
  },
@@ -283,10 +262,7 @@
283
262
  }
284
263
  ],
285
264
  "beginCaptures": {
286
- "0": {
287
- "name": "meta.switch-expression.matlab"
288
- },
289
- "2": {
265
+ "1": {
290
266
  "name": "keyword.control.switch.matlab"
291
267
  }
292
268
  },
@@ -298,17 +274,14 @@
298
274
  },
299
275
  {
300
276
  "name": "meta.try.matlab",
301
- "begin": "(^\\s*)(try)\\b",
302
- "end": "^\\s*(end)\\b",
277
+ "begin": "\\s*(?:^|[\\s,;])(try)\\b",
278
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
303
279
  "patterns": [
304
280
  {
305
281
  "name": "meta.catch.matlab",
306
- "match": "(^\\s*)(catch)\\b(.*)?$\\n?",
282
+ "match": "(\\s*)(?:^|[\\s,;])(catch)\\b(.*)?$\\n?",
307
283
  "end": "^",
308
284
  "captures": {
309
- "0": {
310
- "name": "meta.catch-exception.matlab"
311
- },
312
285
  "2": {
313
286
  "name": "keyword.control.catch.matlab"
314
287
  },
@@ -326,7 +299,7 @@
326
299
  }
327
300
  ],
328
301
  "beginCaptures": {
329
- "2": {
302
+ "1": {
330
303
  "name": "keyword.control.try.matlab"
331
304
  }
332
305
  },
@@ -338,28 +311,15 @@
338
311
  },
339
312
  {
340
313
  "name": "meta.while.matlab",
341
- "begin": "(^\\s*)(while)\\b",
342
- "end": "^\\s*(end)\\b",
314
+ "begin": "\\s*(?:^|[\\s,;])(while)\\b",
315
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
343
316
  "patterns": [
344
- {
345
- "name": "meta.while-condition.matlab",
346
- "begin": "\\G(?!$)",
347
- "end": "$\\n?",
348
- "patterns": [
349
- {
350
- "include": "$self"
351
- }
352
- ]
353
- },
354
317
  {
355
318
  "include": "$self"
356
319
  }
357
320
  ],
358
321
  "beginCaptures": {
359
- "0": {
360
- "name": "meta.while-condition.matlab"
361
- },
362
- "2": {
322
+ "1": {
363
323
  "name": "keyword.control.while.matlab"
364
324
  }
365
325
  },
@@ -371,18 +331,58 @@
371
331
  }
372
332
  ]
373
333
  },
334
+ "braced_validator_list": {
335
+ "begin": "\\s*({)\\s*",
336
+ "end": "(})",
337
+ "patterns": [
338
+ {
339
+ "include": "#braced_validator_list"
340
+ },
341
+ {
342
+ "include": "#validator_strings"
343
+ },
344
+ {
345
+ "include": "#line_continuation"
346
+ },
347
+ {
348
+ "match": "([^{}}'\"\\.]+)",
349
+ "captures": {
350
+ "1": {
351
+ "name": "storage.type.matlab"
352
+ }
353
+ }
354
+ },
355
+ {
356
+ "name": "storage.type.matlab",
357
+ "match": "\\."
358
+ }
359
+ ],
360
+ "beginCaptures": {
361
+ "1": {
362
+ "name": "storage.type.matlab"
363
+ }
364
+ },
365
+ "endCaptures": {
366
+ "1": {
367
+ "name": "storage.type.matlab"
368
+ }
369
+ }
370
+ },
374
371
  "classdef": {
375
372
  "patterns": [
376
373
  {
377
374
  "name": "meta.class.matlab",
378
- "begin": "(?x)\n\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t(classdef)\n\t\t\t\t\t\t\t\\b\\s*\n\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t([a-zA-Z][a-zA-Z0-9_]*)\t\t\t# Class name\n\t\t\t\t\t\t\t\t(?:\t\t\t\t\t\t\t\t# Optional inheritance\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\u003c)\n\t\t\t\t\t\t\t\t\t\\s*\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\t\\s*($|(?=%))\n\t\t\t\t\t\t",
379
- "end": "^\\s*(end)\\b",
375
+ "begin": "(?x)\n\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t(classdef)\n\t\t\t\t\t\t\t\\b\\s*\n\t\t\t\t\t\t\t(.*)\n\t\t\t\t\t",
376
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
380
377
  "patterns": [
381
378
  {
382
379
  "name": "meta.properties.matlab",
383
- "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(properties)\\b(.*)$\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
384
- "end": "^\\s*(end)\\b",
380
+ "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(properties)\\b([^%]*)\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
381
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
385
382
  "patterns": [
383
+ {
384
+ "include": "#validators"
385
+ },
386
386
  {
387
387
  "include": "$self"
388
388
  }
@@ -422,8 +422,8 @@
422
422
  },
423
423
  {
424
424
  "name": "meta.methods.matlab",
425
- "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(methods)\\b(.*)$\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
426
- "end": "^\\s*(end)\\b",
425
+ "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(methods)\\b([^%]*)\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
426
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
427
427
  "patterns": [
428
428
  {
429
429
  "include": "$self"
@@ -464,8 +464,13 @@
464
464
  },
465
465
  {
466
466
  "name": "meta.events.matlab",
467
- "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(events)\\b(.*)$\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
468
- "end": "^\\s*(end)\\b",
467
+ "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(events)\\b([^%]*)\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
468
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
469
+ "patterns": [
470
+ {
471
+ "include": "$self"
472
+ }
473
+ ],
469
474
  "beginCaptures": {
470
475
  "2": {
471
476
  "name": "keyword.control.events.matlab"
@@ -501,8 +506,13 @@
501
506
  },
502
507
  {
503
508
  "name": "meta.enumeration.matlab",
504
- "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(enumeration)\\b(.*)$\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
505
- "end": "^\\s*(end)\\b",
509
+ "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(enumeration)\\b([^%]*)\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
510
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
511
+ "patterns": [
512
+ {
513
+ "include": "$self"
514
+ }
515
+ ],
506
516
  "beginCaptures": {
507
517
  "2": {
508
518
  "name": "keyword.control.enumeration.matlab"
@@ -525,42 +535,58 @@
525
535
  "3": {
526
536
  "patterns": [
527
537
  {
528
- "name": "variable.parameter.class.matlab",
529
- "match": "[a-zA-Z][a-zA-Z0-9_]*"
530
- },
531
- {
532
- "begin": "=\\s*",
533
- "end": ",|(?=\\))",
534
- "patterns": [
535
- {
536
- "name": "constant.language.boolean.matlab",
537
- "match": "true|false"
538
+ "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\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\\s*\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t([a-zA-Z][a-zA-Z0-9_]*)\t\t\t# Class name\n\t\t\t\t\t\t\t\t\t\t\t(?:\t\t\t\t\t\t\t\t# Optional inheritance\n\t\t\t\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t\t\t\t(\u003c)\n\t\t\t\t\t\t\t\t\t\t\t\t\\s*\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\\s*($|(?=(%|...)).*)\n\t\t\t\t\t\t\t\t\t",
539
+ "captures": {
540
+ "1": {
541
+ "patterns": [
542
+ {
543
+ "name": "variable.parameter.class.matlab",
544
+ "match": "[a-zA-Z][a-zA-Z0-9_]*"
545
+ },
546
+ {
547
+ "begin": "=\\s*",
548
+ "end": ",|(?=\\))",
549
+ "patterns": [
550
+ {
551
+ "name": "constant.language.boolean.matlab",
552
+ "match": "true|false"
553
+ },
554
+ {
555
+ "include": "#string"
556
+ }
557
+ ]
558
+ }
559
+ ]
538
560
  },
539
- {
540
- "include": "#string"
561
+ "2": {
562
+ "name": "meta.class-declaration.matlab"
563
+ },
564
+ "3": {
565
+ "name": "entity.name.section.class.matlab"
566
+ },
567
+ "4": {
568
+ "name": "keyword.operator.other.matlab"
569
+ },
570
+ "5": {
571
+ "patterns": [
572
+ {
573
+ "name": "entity.other.inherited-class.matlab",
574
+ "match": "[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)*"
575
+ },
576
+ {
577
+ "name": "keyword.operator.other.matlab",
578
+ "match": "\u0026"
579
+ }
580
+ ]
581
+ },
582
+ "6": {
583
+ "patterns": [
584
+ {
585
+ "include": "$self"
586
+ }
587
+ ]
541
588
  }
542
- ]
543
- }
544
- ]
545
- },
546
- "4": {
547
- "name": "meta.class-declaration.matlab"
548
- },
549
- "5": {
550
- "name": "entity.name.section.class.matlab"
551
- },
552
- "6": {
553
- "name": "keyword.operator.other.matlab"
554
- },
555
- "7": {
556
- "patterns": [
557
- {
558
- "name": "entity.other.inherited-class.matlab",
559
- "match": "[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)*"
560
- },
561
- {
562
- "name": "keyword.operator.other.matlab",
563
- "match": "\u0026"
589
+ }
564
590
  }
565
591
  ]
566
592
  }
@@ -661,19 +687,44 @@
661
687
  }
662
688
  ]
663
689
  },
690
+ "conjugate_transpose": {
691
+ "name": "keyword.operator.transpose.matlab",
692
+ "match": "((?\u003c=[^\\s])|(?\u003c=\\])|(?\u003c=\\))|(?\u003c=\\}))'"
693
+ },
664
694
  "constants": {
665
695
  "name": "constant.language.matlab",
666
696
  "match": "(?\u003c!\\.)\\b(eps|false|Inf|inf|intmax|intmin|namelengthmax|NaN|nan|on|off|realmax|realmin|true|pi)\\b"
667
697
  },
668
698
  "control_statements": {
669
699
  "name": "meta.control.matlab",
670
- "match": "^\\s*(break|continue|return)\\b",
700
+ "match": "\\s*(?:^|[\\s,;])(break|continue|return)\\b",
671
701
  "captures": {
672
702
  "1": {
673
703
  "name": "keyword.control.matlab"
674
704
  }
675
705
  }
676
706
  },
707
+ "curly_brackets": {
708
+ "begin": "\\{",
709
+ "end": "\\}",
710
+ "patterns": [
711
+ {
712
+ "include": "#end_in_parens"
713
+ },
714
+ {
715
+ "include": "#all_before_command_dual"
716
+ },
717
+ {
718
+ "include": "#all_after_command_dual"
719
+ },
720
+ {
721
+ "include": "#end_in_parens"
722
+ },
723
+ {
724
+ "include": "#block_keywords"
725
+ }
726
+ ]
727
+ },
677
728
  "end_in_parens": {
678
729
  "name": "keyword.operator.symbols.matlab",
679
730
  "match": "\\bend\\b"
@@ -683,19 +734,53 @@
683
734
  {
684
735
  "name": "meta.function.matlab",
685
736
  "begin": "(?x)\n\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t(function)\n\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t(?:\t\t\t\t\t\t\t\t\t\t\t\t\t# Optional\n\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t(\\[) ([^\\]]*) (\\])\n\t\t\t\t\t\t\t\t | ([a-zA-Z][a-zA-Z0-9_]*)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\\s* = \\s*\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t([a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)*)\t# Function name\n\t\t\t\t\t\t\t\\s*\t\t\t\t\t\t\t\t\t\t\t\t\t# Trailing space\n\t\t\t\t\t\t",
686
- "end": "^\\s*(end)\\b(\\s*\\n)?",
737
+ "end": "\\s*(?:^|[\\s,;])(end)\\b(\\s*\\n)?",
687
738
  "patterns": [
688
739
  {
689
740
  "name": "meta.arguments.function.matlab",
690
741
  "begin": "\\G\\(",
691
742
  "end": "\\)",
692
743
  "patterns": [
744
+ {
745
+ "include": "#line_continuation"
746
+ },
693
747
  {
694
748
  "name": "variable.parameter.input.matlab",
695
749
  "match": "\\w+"
696
750
  }
697
751
  ]
698
752
  },
753
+ {
754
+ "name": "meta.arguments.matlab",
755
+ "begin": "(?x)\n\t\t\t\t\t\t\t\t\t(^\\s*)\t\t\t\t\t\t\t\t# Leading whitespace\n\t\t\t\t\t\t\t\t\t(arguments)\\b([^%]*)\n\t\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t\t\t# Optional attributes\n\t\t\t\t\t\t\t\t\t\t\\( [^)]* \\)\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t\\s*($|(?=%))\n\t\t\t\t\t\t\t\t",
756
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
757
+ "patterns": [
758
+ {
759
+ "include": "#validators"
760
+ },
761
+ {
762
+ "include": "$self"
763
+ }
764
+ ],
765
+ "beginCaptures": {
766
+ "2": {
767
+ "name": "keyword.control.arguments.matlab"
768
+ },
769
+ "3": {
770
+ "patterns": [
771
+ {
772
+ "name": "variable.parameter.arguments.matlab",
773
+ "match": "[a-zA-Z][a-zA-Z0-9_]*"
774
+ }
775
+ ]
776
+ }
777
+ },
778
+ "endCaptures": {
779
+ "1": {
780
+ "name": "keyword.control.end.arguments.matlab"
781
+ }
782
+ }
783
+ },
699
784
  {
700
785
  "include": "$self"
701
786
  }
@@ -742,6 +827,36 @@
742
827
  }
743
828
  }
744
829
  },
830
+ "indexing_curly_brackets": {
831
+ "begin": "([a-zA-Z][a-zA-Z0-9_\\.]*\\s*)\\{",
832
+ "end": "(\\}|(?\u003c!\\.\\.\\.).\\n)",
833
+ "patterns": [
834
+ {
835
+ "include": "#end_in_parens"
836
+ },
837
+ {
838
+ "include": "#all_before_command_dual"
839
+ },
840
+ {
841
+ "include": "#all_after_command_dual"
842
+ },
843
+ {
844
+ "include": "#end_in_parens"
845
+ },
846
+ {
847
+ "include": "#block_keywords"
848
+ }
849
+ ],
850
+ "beginCaptures": {
851
+ "1": {
852
+ "patterns": [
853
+ {
854
+ "include": "$self"
855
+ }
856
+ ]
857
+ }
858
+ }
859
+ },
745
860
  "line_continuation": {
746
861
  "name": "meta.linecontinuation.matlab",
747
862
  "match": "(\\.\\.\\.)(.*)$",
@@ -762,6 +877,39 @@
762
877
  "name": "keyword.operator.symbols.matlab",
763
878
  "match": "(?\u003c=\\s)(==|~=|\u003e|\u003e=|\u003c|\u003c=|\u0026|\u0026\u0026|:|\\||\\|\\||\\+|-|\\*|\\.\\*|/|\\./|\\\\|\\.\\\\|\\^|\\.\\^)(?=\\s)"
764
879
  },
880
+ "parens": {
881
+ "begin": "\\(",
882
+ "end": "(\\)|(?\u003c!\\.\\.\\.).\\n)",
883
+ "patterns": [
884
+ {
885
+ "include": "#end_in_parens"
886
+ },
887
+ {
888
+ "include": "#all_before_command_dual"
889
+ },
890
+ {
891
+ "include": "#all_after_command_dual"
892
+ },
893
+ {
894
+ "include": "#block_keywords"
895
+ }
896
+ ]
897
+ },
898
+ "square_brackets": {
899
+ "begin": "\\[",
900
+ "end": "\\]",
901
+ "patterns": [
902
+ {
903
+ "include": "#all_before_command_dual"
904
+ },
905
+ {
906
+ "include": "#all_after_command_dual"
907
+ },
908
+ {
909
+ "include": "#block_keywords"
910
+ }
911
+ ]
912
+ },
765
913
  "string": {
766
914
  "patterns": [
767
915
  {
@@ -833,7 +981,112 @@
833
981
  },
834
982
  "transpose": {
835
983
  "name": "keyword.operator.transpose.matlab",
836
- "match": "((\\w+)|(?\u003c=\\])|(?\u003c=\\)))\\.?'"
984
+ "match": "\\.'"
985
+ },
986
+ "validator_strings": {
987
+ "patterns": [
988
+ {
989
+ "patterns": [
990
+ {
991
+ "name": "storage.type.matlab",
992
+ "begin": "((?\u003c=(\\[|\\(|\\{|=|\\s|;|:|,|~|\u003c|\u003e|\u0026|\\||-|\\+|\\*|/|\\\\|\\.|\\^))|^)'",
993
+ "end": "'(?=(\\[|\\(|\\{|\\]|\\)|\\}|=|~|\u003c|\u003e|\u0026|\\||-|\\+|\\*|/|\\\\|\\.|\\^|\\s|;|:|,))",
994
+ "patterns": [
995
+ {
996
+ "match": "''"
997
+ },
998
+ {
999
+ "match": "'(?=.)"
1000
+ },
1001
+ {
1002
+ "match": "([^']+)"
1003
+ }
1004
+ ]
1005
+ },
1006
+ {
1007
+ "name": "storage.type.matlab",
1008
+ "begin": "((?\u003c=(\\[|\\(|\\{|=|\\s|;|:|,|~|\u003c|\u003e|\u0026|\\||-|\\+|\\*|/|\\\\|\\.|\\^))|^)\"",
1009
+ "end": "\"(?=(\\[|\\(|\\{|\\]|\\)|\\}|=|~|\u003c|\u003e|\u0026|\\||-|\\+|\\*|/|\\\\|\\.|\\^|\\||\\s|;|:|,))",
1010
+ "patterns": [
1011
+ {
1012
+ "match": "\"\""
1013
+ },
1014
+ {
1015
+ "match": "\"(?=.)"
1016
+ },
1017
+ {
1018
+ "match": "[^\"]+"
1019
+ }
1020
+ ]
1021
+ }
1022
+ ]
1023
+ }
1024
+ ]
1025
+ },
1026
+ "validators": {
1027
+ "begin": "\\s*[;]?\\s*([a-zA-Z][a-zA-Z0-9_\\.\\?]*)",
1028
+ "end": "([;\\n%=].*)",
1029
+ "patterns": [
1030
+ {
1031
+ "include": "#line_continuation"
1032
+ },
1033
+ {
1034
+ "name": "storage.type.matlab",
1035
+ "match": "\\s*(\\([^\\)]*\\))"
1036
+ },
1037
+ {
1038
+ "name": "storage.type.matlab",
1039
+ "match": "([a-zA-Z][a-zA-Z0-9_\\.]*)"
1040
+ },
1041
+ {
1042
+ "include": "#braced_validator_list"
1043
+ }
1044
+ ],
1045
+ "endCaptures": {
1046
+ "1": {
1047
+ "patterns": [
1048
+ {
1049
+ "match": "([%].*)",
1050
+ "captures": {
1051
+ "1": {
1052
+ "patterns": [
1053
+ {
1054
+ "include": "$self"
1055
+ }
1056
+ ]
1057
+ }
1058
+ }
1059
+ },
1060
+ {
1061
+ "match": "(=[^;]*)",
1062
+ "captures": {
1063
+ "1": {
1064
+ "patterns": [
1065
+ {
1066
+ "include": "$self"
1067
+ }
1068
+ ]
1069
+ }
1070
+ }
1071
+ },
1072
+ {
1073
+ "match": "([\\n;]\\s*[a-zA-Z].*)",
1074
+ "captures": {
1075
+ "1": {
1076
+ "patterns": [
1077
+ {
1078
+ "include": "#validators"
1079
+ }
1080
+ ]
1081
+ }
1082
+ }
1083
+ },
1084
+ {
1085
+ "include": "$self"
1086
+ }
1087
+ ]
1088
+ }
1089
+ }
837
1090
  },
838
1091
  "variables": {
839
1092
  "name": "variable.other.function.matlab",