github-linguist 7.8.0 → 7.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/annotation.liquidhaskell.haskell.json +47 -0
  3. data/grammars/hint.haskell.json +47 -0
  4. data/grammars/hint.message.haskell.json +47 -0
  5. data/grammars/hint.type.haskell.json +47 -0
  6. data/grammars/markdown.plantuml.codeblock.json +26 -0
  7. data/grammars/source.4dm.json +104 -33
  8. data/grammars/source.abap.json +1 -1
  9. data/grammars/source.ahk.json +6 -2
  10. data/grammars/source.chapel.json +4 -4
  11. data/grammars/source.clarion.json +6 -6
  12. data/grammars/source.csound.json +1 -1
  13. data/grammars/source.dart.json +57 -31
  14. data/grammars/source.elixir.json +8 -0
  15. data/grammars/source.gcode.json +0 -4
  16. data/grammars/source.hack.json +4 -18
  17. data/grammars/source.haskell.json +47 -0
  18. data/grammars/source.hsig.json +47 -0
  19. data/grammars/source.julia.json +17 -17
  20. data/grammars/source.lean.json +19 -3
  21. data/grammars/source.lean.markdown.json +2598 -0
  22. data/grammars/source.matlab.json +215 -152
  23. data/grammars/source.mrc.json +416 -534
  24. data/grammars/source.nasl.json +155 -0
  25. data/grammars/source.nextflow.json +2 -2
  26. data/grammars/source.p4.json +21 -5
  27. data/grammars/source.prisma.json +7 -0
  28. data/grammars/source.qasm.json +66 -0
  29. data/grammars/source.ql.json +1408 -0
  30. data/grammars/source.tnsaudit.json +256 -0
  31. data/grammars/source.v.json +1 -1
  32. data/grammars/source.wsd.json +775 -0
  33. data/grammars/text.tex.latex.haskell.json +47 -0
  34. data/grammars/version +1 -1
  35. data/lib/linguist/VERSION +1 -1
  36. data/lib/linguist/file_blob.rb +1 -1
  37. data/lib/linguist/generated.rb +14 -3
  38. data/lib/linguist/heuristics.yml +7 -0
  39. data/lib/linguist/languages.json +1 -1
  40. data/lib/linguist/languages.yml +39 -0
  41. data/lib/linguist/linguist.bundle +0 -0
  42. data/lib/linguist/samples.json +1169 -38
  43. data/lib/linguist/shebang.rb +5 -3
  44. metadata +9 -3
  45. 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
  },
@@ -413,12 +373,12 @@
413
373
  {
414
374
  "name": "meta.class.matlab",
415
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",
416
- "end": "^\\s*(end)\\b",
376
+ "end": "\\s*(?:^|[\\s,;])(end)\\b",
417
377
  "patterns": [
418
378
  {
419
379
  "name": "meta.properties.matlab",
420
- "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",
421
- "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",
422
382
  "patterns": [
423
383
  {
424
384
  "include": "#validators"
@@ -462,8 +422,8 @@
462
422
  },
463
423
  {
464
424
  "name": "meta.methods.matlab",
465
- "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",
466
- "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",
467
427
  "patterns": [
468
428
  {
469
429
  "include": "$self"
@@ -504,8 +464,13 @@
504
464
  },
505
465
  {
506
466
  "name": "meta.events.matlab",
507
- "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",
508
- "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
+ ],
509
474
  "beginCaptures": {
510
475
  "2": {
511
476
  "name": "keyword.control.events.matlab"
@@ -541,8 +506,8 @@
541
506
  },
542
507
  {
543
508
  "name": "meta.enumeration.matlab",
544
- "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",
545
- "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",
546
511
  "patterns": [
547
512
  {
548
513
  "include": "$self"
@@ -570,7 +535,7 @@
570
535
  "3": {
571
536
  "patterns": [
572
537
  {
573
- "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",
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",
574
539
  "captures": {
575
540
  "1": {
576
541
  "patterns": [
@@ -613,6 +578,13 @@
613
578
  "match": "\u0026"
614
579
  }
615
580
  ]
581
+ },
582
+ "6": {
583
+ "patterns": [
584
+ {
585
+ "include": "$self"
586
+ }
587
+ ]
616
588
  }
617
589
  }
618
590
  }
@@ -715,19 +687,44 @@
715
687
  }
716
688
  ]
717
689
  },
690
+ "conjugate_transpose": {
691
+ "name": "keyword.operator.transpose.matlab",
692
+ "match": "((?\u003c=[^\\s])|(?\u003c=\\])|(?\u003c=\\))|(?\u003c=\\}))'"
693
+ },
718
694
  "constants": {
719
695
  "name": "constant.language.matlab",
720
696
  "match": "(?\u003c!\\.)\\b(eps|false|Inf|inf|intmax|intmin|namelengthmax|NaN|nan|on|off|realmax|realmin|true|pi)\\b"
721
697
  },
722
698
  "control_statements": {
723
699
  "name": "meta.control.matlab",
724
- "match": "^\\s*(break|continue|return)\\b",
700
+ "match": "\\s*(?:^|[\\s,;])(break|continue|return)\\b",
725
701
  "captures": {
726
702
  "1": {
727
703
  "name": "keyword.control.matlab"
728
704
  }
729
705
  }
730
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
+ },
731
728
  "end_in_parens": {
732
729
  "name": "keyword.operator.symbols.matlab",
733
730
  "match": "\\bend\\b"
@@ -737,13 +734,16 @@
737
734
  {
738
735
  "name": "meta.function.matlab",
739
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",
740
- "end": "^\\s*(end)\\b(\\s*\\n)?",
737
+ "end": "\\s*(?:^|[\\s,;])(end)\\b(\\s*\\n)?",
741
738
  "patterns": [
742
739
  {
743
740
  "name": "meta.arguments.function.matlab",
744
741
  "begin": "\\G\\(",
745
742
  "end": "\\)",
746
743
  "patterns": [
744
+ {
745
+ "include": "#line_continuation"
746
+ },
747
747
  {
748
748
  "name": "variable.parameter.input.matlab",
749
749
  "match": "\\w+"
@@ -752,8 +752,8 @@
752
752
  },
753
753
  {
754
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*(end)\\b",
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
757
  "patterns": [
758
758
  {
759
759
  "include": "#validators"
@@ -827,6 +827,36 @@
827
827
  }
828
828
  }
829
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
+ },
830
860
  "line_continuation": {
831
861
  "name": "meta.linecontinuation.matlab",
832
862
  "match": "(\\.\\.\\.)(.*)$",
@@ -847,6 +877,39 @@
847
877
  "name": "keyword.operator.symbols.matlab",
848
878
  "match": "(?\u003c=\\s)(==|~=|\u003e|\u003e=|\u003c|\u003c=|\u0026|\u0026\u0026|:|\\||\\|\\||\\+|-|\\*|\\.\\*|/|\\./|\\\\|\\.\\\\|\\^|\\.\\^)(?=\\s)"
849
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
+ },
850
913
  "string": {
851
914
  "patterns": [
852
915
  {
@@ -918,7 +981,7 @@
918
981
  },
919
982
  "transpose": {
920
983
  "name": "keyword.operator.transpose.matlab",
921
- "match": "((\\w+)|(?\u003c=\\])|(?\u003c=\\)))\\.?'"
984
+ "match": "\\.'"
922
985
  },
923
986
  "validator_strings": {
924
987
  "patterns": [