github-linguist 6.1.0 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/annotation.liquidhaskell.haskell.json +14 -14
  3. data/grammars/hint.haskell.json +14 -14
  4. data/grammars/hint.message.haskell.json +14 -14
  5. data/grammars/hint.type.haskell.json +14 -14
  6. data/grammars/markdown.haxe.codeblock.json +26 -0
  7. data/grammars/markdown.hxml.codeblock.json +26 -0
  8. data/grammars/source.angelscript.json +1 -1
  9. data/grammars/source.ballerina.json +973 -61
  10. data/grammars/source.csound.json +1 -1
  11. data/grammars/source.emacs.lisp.json +35 -0
  12. data/grammars/source.firestore.json +289 -0
  13. data/grammars/source.gfm.json +7 -7
  14. data/grammars/source.haskell.json +14 -14
  15. data/grammars/source.hql.json +492 -0
  16. data/grammars/source.hsig.json +14 -14
  17. data/grammars/source.hx.json +14 -6
  18. data/grammars/source.hx.type.json +8 -0
  19. data/grammars/source.jison.json +1 -1
  20. data/grammars/source.js.json +1 -1
  21. data/grammars/source.powershell.json +384 -141
  22. data/grammars/source.q.json +120 -0
  23. data/grammars/source.q_output.json +348 -0
  24. data/grammars/source.rascal.json +0 -1
  25. data/grammars/source.sas.json +3 -3
  26. data/grammars/source.solidity.json +84 -13
  27. data/grammars/source.ts.json +226 -85
  28. data/grammars/source.tsx.json +230 -89
  29. data/grammars/source.viml.json +73 -18
  30. data/grammars/text.hamlc.json +1 -1
  31. data/grammars/text.html.markdown.source.gfm.apib.json +11 -2
  32. data/grammars/text.html.mediawiki.json +6 -6
  33. data/grammars/text.html.php.blade.json +3 -3
  34. data/grammars/text.tex.latex.haskell.json +14 -14
  35. data/lib/linguist/generated.rb +27 -1
  36. data/lib/linguist/heuristics.rb +8 -0
  37. data/lib/linguist/language.rb +12 -15
  38. data/lib/linguist/languages.json +1 -1
  39. data/lib/linguist/languages.yml +55 -10
  40. data/lib/linguist/samples.json +1623 -158
  41. data/lib/linguist/strategy/modeline.rb +11 -11
  42. data/lib/linguist/version.rb +1 -1
  43. metadata +9 -3
  44. data/grammars/source.j.json +0 -46
@@ -100,7 +100,7 @@
100
100
  },
101
101
  {
102
102
  "name": "storage.modifier.angelscript",
103
- "match": "\\b(get|in|inout|out|override|set|private|public|const|default|final|shared|mixin)\\b"
103
+ "match": "\\b(get|in|inout|out|override|set|private|public|const|default|final|shared|external|mixin)\\b"
104
104
  },
105
105
  {
106
106
  "name": "storage.type.angelscript",
@@ -3,98 +3,415 @@
3
3
  "scopeName": "source.ballerina",
4
4
  "patterns": [
5
5
  {
6
- "begin": "\\b(function|service|resource|connector|action|worker)\\b",
7
- "end": "(\\(|\\{)",
6
+ "include": "#publicKeyword"
7
+ },
8
+ {
9
+ "include": "#functionDec"
10
+ },
11
+ {
12
+ "include": "#serviceDec"
13
+ },
14
+ {
15
+ "include": "#documentationDef"
16
+ },
17
+ {
18
+ "include": "#typeDef"
19
+ },
20
+ {
21
+ "include": "#objectDec"
22
+ },
23
+ {
24
+ "include": "#annotationDec"
25
+ },
26
+ {
27
+ "include": "#code"
28
+ }
29
+ ],
30
+ "repository": {
31
+ "annotationDec": {
8
32
  "patterns": [
9
33
  {
10
- "name": "entity.name.function.ballerina",
11
- "match": "([_$[:alpha:]][_$[:alnum:]]*) | (\\|.+\\|)"
34
+ "name": "storage.type.annotation.ballerina",
35
+ "match": "@([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
12
36
  }
13
- ],
14
- "beginCaptures": {
15
- "0": {
16
- "name": "keyword.other.function-name.ballerina"
37
+ ]
38
+ },
39
+ "booleans": {
40
+ "patterns": [
41
+ {
42
+ "name": "constant.language.boolean.ballerina",
43
+ "match": "\\b(true|false)\\b"
17
44
  }
18
- }
45
+ ]
19
46
  },
20
- {
21
- "begin": "\\b(documentation)\\s*(\\{)",
22
- "end": "\\}",
47
+ "butExp": {
23
48
  "patterns": [
24
49
  {
25
- "name": "string.quoted.double.ballerina",
26
- "match": "."
50
+ "begin": "\\b(but)\\b",
51
+ "end": "(?\u003c=\\})",
52
+ "patterns": [
53
+ {
54
+ "include": "#matchStatementBody"
55
+ },
56
+ {
57
+ "include": "#comment"
58
+ }
59
+ ],
60
+ "beginCaptures": {
61
+ "1": {
62
+ "name": "keyword.ballerina"
63
+ }
64
+ }
27
65
  }
28
- ],
29
- "beginCaptures": {
30
- "1": {
31
- "name": "keyword.other.ballerina"
66
+ ]
67
+ },
68
+ "code": {
69
+ "patterns": [
70
+ {
71
+ "include": "#booleans"
72
+ },
73
+ {
74
+ "include": "#keywords"
75
+ },
76
+ {
77
+ "include": "#strings"
32
78
  },
33
- "2": {
34
- "name": "punctuation.definition.block.ballerina"
79
+ {
80
+ "include": "#maps"
81
+ },
82
+ {
83
+ "include": "#paranthesised"
84
+ },
85
+ {
86
+ "include": "#paranthesisedBracket"
87
+ },
88
+ {
89
+ "include": "#numbers"
90
+ },
91
+ {
92
+ "include": "#comment"
93
+ },
94
+ {
95
+ "include": "#matchStatement"
96
+ },
97
+ {
98
+ "include": "#butExp"
99
+ },
100
+ {
101
+ "include": "#identifiers"
102
+ }
103
+ ]
104
+ },
105
+ "comment": {
106
+ "patterns": [
107
+ {
108
+ "name": "comment.ballerina",
109
+ "match": "\\/\\/.*"
35
110
  }
36
- },
37
- "endCaptures": {
38
- "0": {
39
- "name": "punctuation.definition.block.ballerina"
111
+ ]
112
+ },
113
+ "constrainType": {
114
+ "patterns": [
115
+ {
116
+ "begin": "\u003c",
117
+ "end": "\u003e",
118
+ "patterns": [
119
+ {
120
+ "include": "#comment"
121
+ },
122
+ {
123
+ "include": "#continuedType"
124
+ },
125
+ {},
126
+ {
127
+ "name": "storage.type.constrain.ballerina",
128
+ "match": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b"
129
+ }
130
+ ],
131
+ "beginCaptures": {
132
+ "0": {
133
+ "name": "punctuation.definition.parameters.begin.ballerina"
134
+ }
135
+ },
136
+ "endCaptures": {
137
+ "0": {
138
+ "name": "punctuation.definition.parameters.end.ballerina"
139
+ }
140
+ }
40
141
  }
41
- }
142
+ ]
42
143
  },
43
- {
44
- "include": "#keywords"
144
+ "continuedType": {
145
+ "patterns": [
146
+ {
147
+ "begin": "[|,:]",
148
+ "end": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
149
+ "patterns": [
150
+ {
151
+ "include": "#comment"
152
+ }
153
+ ],
154
+ "endCaptures": {
155
+ "1": {
156
+ "name": "storage.type.ballerina"
157
+ }
158
+ }
159
+ }
160
+ ]
45
161
  },
46
- {
47
- "name": "string.quoted.double.ballerina",
48
- "begin": "\\\"",
49
- "end": "\\\"",
162
+ "defaultValue": {
163
+ "patterns": [
164
+ {
165
+ "begin": "[=:]",
166
+ "end": "(?=[,)])",
167
+ "patterns": [
168
+ {
169
+ "include": "#code"
170
+ }
171
+ ]
172
+ }
173
+ ]
174
+ },
175
+ "documentationBody": {
50
176
  "patterns": [
51
177
  {
52
- "name": "constant.character.escape.ballerina",
53
- "match": "\\\\."
178
+ "begin": "\\{",
179
+ "end": "\\}",
180
+ "patterns": [
181
+ {
182
+ "match": "(P|R|T|F|V)({{)(.+)(}})",
183
+ "captures": {
184
+ "1": {
185
+ "name": "keyword.other.ballerina.documentation"
186
+ },
187
+ "2": {
188
+ "name": "keyword.other.ballerina.documentation"
189
+ },
190
+ "3": {
191
+ "name": "variable.parameter.ballerina.documentation"
192
+ },
193
+ "4": {
194
+ "name": "keyword.other.ballerina.documentation"
195
+ }
196
+ }
197
+ },
198
+ {
199
+ "name": "comment.block.code.ballerina.documentation",
200
+ "begin": "\\```",
201
+ "end": "\\```"
202
+ },
203
+ {
204
+ "name": "comment.block.code.ballerina.documentation",
205
+ "begin": "\\``",
206
+ "end": "\\``"
207
+ },
208
+ {
209
+ "name": "comment.block.code.ballerina.documentation",
210
+ "begin": "\\`",
211
+ "end": "\\`"
212
+ },
213
+ {
214
+ "name": "comment.block.ballerina.documentation",
215
+ "match": "."
216
+ }
217
+ ],
218
+ "beginCaptures": {
219
+ "0": {
220
+ "name": "punctuation.definition.block.ballerina.documentation"
221
+ }
222
+ },
223
+ "endCaptures": {
224
+ "0": {
225
+ "name": "punctuation.definition.block.ballerina.documentation"
226
+ }
227
+ }
54
228
  }
55
- ],
56
- "beginCaptures": {
57
- "0": {
58
- "name": "punctuation.definition.string.begin.ballerina"
229
+ ]
230
+ },
231
+ "documentationDef": {
232
+ "patterns": [
233
+ {
234
+ "begin": "\\b(documentation|deprecated)\\b",
235
+ "end": "(?\u003c=\\})",
236
+ "patterns": [
237
+ {
238
+ "include": "#documentationBody"
239
+ }
240
+ ],
241
+ "beginCaptures": {
242
+ "1": {
243
+ "name": "keyword.ballerina"
244
+ }
245
+ }
59
246
  }
60
- },
61
- "endCaptures": {
62
- "0": {
63
- "name": "punctuation.definition.string.end.ballerina"
247
+ ]
248
+ },
249
+ "functionBody": {
250
+ "patterns": [
251
+ {
252
+ "begin": "\\{",
253
+ "end": "\\}",
254
+ "patterns": [
255
+ {
256
+ "include": "#comment"
257
+ },
258
+ {
259
+ "include": "#code"
260
+ }
261
+ ],
262
+ "beginCaptures": {
263
+ "0": {
264
+ "name": "punctuation.definition.block.ballerina"
265
+ }
266
+ },
267
+ "endCaptures": {
268
+ "0": {
269
+ "name": "punctuation.definition.block.ballerina"
270
+ }
271
+ }
64
272
  }
65
- }
273
+ ]
66
274
  },
67
- {
68
- "name": "comment.block.ballerina",
69
- "match": "\\s*((//).*$\\n?)"
275
+ "functionDec": {
276
+ "patterns": [
277
+ {
278
+ "begin": "\\b(function)\\b",
279
+ "end": "(?\u003c=\\})",
280
+ "patterns": [
281
+ {
282
+ "include": "#functionReceiver"
283
+ },
284
+ {
285
+ "include": "#functionParameters"
286
+ },
287
+ {
288
+ "include": "#functionReturns"
289
+ },
290
+ {
291
+ "include": "#functionName"
292
+ },
293
+ {
294
+ "include": "#functionBody"
295
+ },
296
+ {
297
+ "include": "#comment"
298
+ }
299
+ ],
300
+ "beginCaptures": {
301
+ "1": {
302
+ "name": "keyword.ballerina"
303
+ }
304
+ }
305
+ }
306
+ ]
307
+ },
308
+ "functionName": {
309
+ "patterns": [
310
+ {
311
+ "name": "entity.name.function.ballerina",
312
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
313
+ }
314
+ ]
315
+ },
316
+ "functionParameters": {
317
+ "patterns": [
318
+ {
319
+ "begin": "\\(",
320
+ "end": "\\)",
321
+ "patterns": [
322
+ {
323
+ "include": "#varDefStatement"
324
+ },
325
+ {
326
+ "include": "#defaultValue"
327
+ }
328
+ ],
329
+ "beginCaptures": {
330
+ "0": {
331
+ "name": "punctuation.definition.parameters.begin.ballerina"
332
+ }
333
+ },
334
+ "endCaptures": {
335
+ "0": {
336
+ "name": "punctuation.definition.parameters.end.ballerina"
337
+ }
338
+ }
339
+ }
340
+ ]
341
+ },
342
+ "functionReceiver": {
343
+ "patterns": [
344
+ {
345
+ "begin": "\u003c",
346
+ "end": "\u003e",
347
+ "patterns": [
348
+ {
349
+ "include": "#varDefStatement"
350
+ },
351
+ {
352
+ "include": "#comment"
353
+ }
354
+ ],
355
+ "beginCaptures": {
356
+ "0": {
357
+ "name": "punctuation.definition.parameters.begin.ballerina"
358
+ }
359
+ },
360
+ "endCaptures": {
361
+ "0": {
362
+ "name": "punctuation.definition.parameters.end.ballerina"
363
+ }
364
+ }
365
+ }
366
+ ]
367
+ },
368
+ "functionReturns": {
369
+ "patterns": [
370
+ {
371
+ "begin": "\\breturns\\b",
372
+ "end": "(?=\\{)",
373
+ "patterns": [
374
+ {
375
+ "name": "storage.type.ballerina",
376
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
377
+ },
378
+ {
379
+ "include": "#comment"
380
+ }
381
+ ],
382
+ "beginCaptures": {
383
+ "0": {
384
+ "name": "keyword.ballerina"
385
+ }
386
+ }
387
+ }
388
+ ]
389
+ },
390
+ "identifiers": {
391
+ "patterns": [
392
+ {
393
+ "name": "variable.other.ballerina",
394
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
395
+ }
396
+ ]
70
397
  },
71
- {
72
- "name": "storage.type.annotation.ballerina",
73
- "match": "@[a-zA-Z_$][a-zA-Z0-9_$]*"
74
- }
75
- ],
76
- "repository": {
77
398
  "keywords": {
78
399
  "patterns": [
79
400
  {
80
401
  "name": "keyword.control.ballerina",
81
- "match": "\\b(if|else|iterator|try|catch|finally|fork|join|all|some|while|throw|return|returns|break|timeout|transaction|aborted|abort|committed|failed|retries|next|bind|with|lengthof|typeof|enum)\\b"
402
+ "match": "\\b(if|else|iterator|try|catch|finally|fork|join|all|some|while|foreach|in|throw|return|returns|break|timeout|transaction|aborted|abort|committed|failed|retries|next|bind|with|lengthof|typeof|enum)\\b"
82
403
  },
83
404
  {
84
405
  "name": "keyword.other.ballerina",
85
- "match": "\\b(import|version|public|attach|as|native|documentation|lock)\\b"
86
- },
87
- {
88
- "name": "storage.type.ballerina",
89
- "match": "\\b(boolean|int|float|string|var|any|datatable|blob)\\b"
406
+ "match": "\\b(import|version|public|private|attach|as|native|documentation|lock)\\b"
90
407
  },
91
408
  {
92
- "name": "storage.type.ballerina",
93
- "match": "\\b(map|exception|json|xml|xmlns|error)\\b"
409
+ "name": "keyword.other.siddhi.ballerina",
410
+ "match": "\\b(forever|from|on|select|group|by|having|order|where|followed|insert|into|update|delete|set|for|window|query)\\b"
94
411
  },
95
412
  {
96
413
  "name": "keyword.other.ballerina",
97
- "match": "\\b(annotation|package|type|connector|function|resource|service|action|worker|struct|transformer|endpoint)\\b"
414
+ "match": "\\b(annotation|package|type|typedesc|connector|function|resource|service|action|worker|struct|transformer|endpoint|object)\\b"
98
415
  },
99
416
  {
100
417
  "name": "keyword.other.ballerina",
@@ -102,7 +419,602 @@
102
419
  },
103
420
  {
104
421
  "name": "keyword.operator.ballerina",
105
- "match": "(!|%|\\+|\\-|~=|==|=|!=|\u003c|\u003e|\u0026\u0026|\\|\\|)"
422
+ "match": "(!|%|\\+|\\-|~=|==|=|!=|\u003c|\u003e|\u0026\u0026|\\|\\||\\?:)"
423
+ },
424
+ {
425
+ "include": "#types"
426
+ }
427
+ ]
428
+ },
429
+ "maps": {
430
+ "patterns": [
431
+ {
432
+ "begin": "\\{",
433
+ "end": "\\}",
434
+ "patterns": [
435
+ {
436
+ "include": "#comment"
437
+ },
438
+ {
439
+ "include": "#code"
440
+ }
441
+ ],
442
+ "beginCaptures": {
443
+ "0": {
444
+ "name": "punctuation.definition.string.begin.ballerina"
445
+ }
446
+ },
447
+ "endCaptures": {
448
+ "0": {
449
+ "name": "punctuation.definition.string.end.ballerina"
450
+ }
451
+ }
452
+ }
453
+ ]
454
+ },
455
+ "matchStatement": {
456
+ "patterns": [
457
+ {
458
+ "begin": "\\b(match)\\b",
459
+ "end": "(?\u003c=\\})",
460
+ "patterns": [
461
+ {
462
+ "name": "variable.parameter.ballerina",
463
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
464
+ },
465
+ {
466
+ "include": "#matchStatementBody"
467
+ }
468
+ ],
469
+ "beginCaptures": {
470
+ "1": {
471
+ "name": "keyword.ballerina"
472
+ }
473
+ }
474
+ }
475
+ ]
476
+ },
477
+ "matchStatementBody": {
478
+ "patterns": [
479
+ {
480
+ "begin": "\\{",
481
+ "end": "\\}",
482
+ "patterns": [
483
+ {
484
+ "include": "#varDefStatement"
485
+ },
486
+ {
487
+ "include": "#matchStatementPatternClause"
488
+ }
489
+ ],
490
+ "beginCaptures": {
491
+ "0": {
492
+ "name": "punctuation.definition.block.ballerina.documentation"
493
+ }
494
+ },
495
+ "endCaptures": {
496
+ "0": {
497
+ "name": "punctuation.definition.block.ballerina.documentation"
498
+ }
499
+ }
500
+ }
501
+ ]
502
+ },
503
+ "matchStatementPatternClause": {
504
+ "patterns": [
505
+ {
506
+ "begin": "=\u003e",
507
+ "end": "((?\u003c=\\})|;|,)",
508
+ "patterns": [
509
+ {
510
+ "include": "#functionBody"
511
+ },
512
+ {
513
+ "include": "#code"
514
+ }
515
+ ],
516
+ "beginCaptures": {
517
+ "0": {
518
+ "name": "keyword.ballerina"
519
+ }
520
+ }
521
+ }
522
+ ]
523
+ },
524
+ "numbers": {
525
+ "patterns": [
526
+ {
527
+ "name": "constant.numeric.decimal.ballerina",
528
+ "match": "\\b[0-9]+\\b"
529
+ }
530
+ ]
531
+ },
532
+ "objectBody": {
533
+ "patterns": [
534
+ {
535
+ "begin": "\\{",
536
+ "end": "\\}",
537
+ "patterns": [
538
+ {
539
+ "include": "#varDefBlock"
540
+ },
541
+ {
542
+ "include": "#objectInitDec"
543
+ },
544
+ {
545
+ "include": "#functionDec"
546
+ },
547
+ {
548
+ "include": "#comment"
549
+ },
550
+ {
551
+ "include": "#code"
552
+ }
553
+ ],
554
+ "beginCaptures": {
555
+ "0": {
556
+ "name": "punctuation.definition.block.ballerina"
557
+ }
558
+ },
559
+ "endCaptures": {
560
+ "0": {
561
+ "name": "punctuation.definition.block.ballerina"
562
+ }
563
+ }
564
+ }
565
+ ]
566
+ },
567
+ "objectDec": {
568
+ "patterns": [
569
+ {
570
+ "begin": "\\b(object)\\b",
571
+ "end": "(?\u003c=\\})",
572
+ "patterns": [
573
+ {
574
+ "include": "#objectBody"
575
+ },
576
+ {
577
+ "include": "#comment"
578
+ }
579
+ ],
580
+ "beginCaptures": {
581
+ "1": {
582
+ "name": "keyword.ballerina"
583
+ }
584
+ }
585
+ }
586
+ ]
587
+ },
588
+ "objectInitBody": {
589
+ "patterns": [
590
+ {
591
+ "begin": "\\{",
592
+ "end": "\\}",
593
+ "patterns": [
594
+ {
595
+ "include": "#comment"
596
+ },
597
+ {
598
+ "include": "#code"
599
+ }
600
+ ],
601
+ "beginCaptures": {
602
+ "0": {
603
+ "name": "punctuation.definition.block.ballerina"
604
+ }
605
+ },
606
+ "endCaptures": {
607
+ "0": {
608
+ "name": "punctuation.definition.block.ballerina"
609
+ }
610
+ }
611
+ }
612
+ ]
613
+ },
614
+ "objectInitDec": {
615
+ "patterns": [
616
+ {
617
+ "begin": "\\b(new)\\b",
618
+ "end": "(?\u003c=\\})",
619
+ "patterns": [
620
+ {
621
+ "include": "#objectInitParameters"
622
+ },
623
+ {
624
+ "include": "#objectInitBody"
625
+ }
626
+ ],
627
+ "beginCaptures": {
628
+ "1": {
629
+ "name": "keyword.ballerina"
630
+ }
631
+ }
632
+ }
633
+ ]
634
+ },
635
+ "objectInitParameters": {
636
+ "patterns": [
637
+ {
638
+ "begin": "\\(",
639
+ "end": "\\)",
640
+ "patterns": [
641
+ {
642
+ "include": "#types"
643
+ },
644
+ {
645
+ "name": "variable.parameter.ballerina",
646
+ "match": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b"
647
+ },
648
+ {
649
+ "include": "#defaultValue"
650
+ }
651
+ ],
652
+ "beginCaptures": {
653
+ "0": {
654
+ "name": "punctuation.definition.parameters.begin.ballerina"
655
+ }
656
+ },
657
+ "endCaptures": {
658
+ "0": {
659
+ "name": "punctuation.definition.parameters.end.ballerina"
660
+ }
661
+ }
662
+ }
663
+ ]
664
+ },
665
+ "paranthesised": {
666
+ "patterns": [
667
+ {
668
+ "begin": "\\(",
669
+ "end": "\\)",
670
+ "patterns": [
671
+ {
672
+ "include": "#comment"
673
+ },
674
+ {
675
+ "include": "#code"
676
+ }
677
+ ]
678
+ }
679
+ ]
680
+ },
681
+ "paranthesisedBracket": {
682
+ "patterns": [
683
+ {
684
+ "begin": "\\[",
685
+ "end": "\\]",
686
+ "patterns": [
687
+ {
688
+ "include": "#comment"
689
+ },
690
+ {
691
+ "include": "#code"
692
+ }
693
+ ]
694
+ }
695
+ ]
696
+ },
697
+ "publicKeyword": {
698
+ "patterns": [
699
+ {
700
+ "name": "keyword.ballerina",
701
+ "match": "\\bpublic\\b"
702
+ }
703
+ ]
704
+ },
705
+ "resourceBody": {
706
+ "patterns": [
707
+ {
708
+ "begin": "\\{",
709
+ "end": "\\}",
710
+ "patterns": [
711
+ {
712
+ "include": "#comment"
713
+ },
714
+ {
715
+ "include": "#code"
716
+ }
717
+ ],
718
+ "beginCaptures": {
719
+ "0": {
720
+ "name": "punctuation.definition.block.ballerina"
721
+ }
722
+ },
723
+ "endCaptures": {
724
+ "0": {
725
+ "name": "punctuation.definition.block.ballerina"
726
+ }
727
+ }
728
+ }
729
+ ]
730
+ },
731
+ "resourceDef": {
732
+ "patterns": [
733
+ {
734
+ "begin": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
735
+ "end": "(?\u003c=\\})",
736
+ "patterns": [
737
+ {
738
+ "include": "#comment"
739
+ },
740
+ {
741
+ "include": "#functionParameters"
742
+ },
743
+ {
744
+ "include": "#resourceBody"
745
+ }
746
+ ],
747
+ "beginCaptures": {
748
+ "1": {
749
+ "name": "entity.name.function.ballerina"
750
+ }
751
+ }
752
+ }
753
+ ]
754
+ },
755
+ "serviceBody": {
756
+ "patterns": [
757
+ {
758
+ "begin": "\\{",
759
+ "end": "\\}",
760
+ "patterns": [
761
+ {
762
+ "include": "#comment"
763
+ },
764
+ {
765
+ "include": "#documentationDef"
766
+ },
767
+ {
768
+ "include": "#annotationDec"
769
+ },
770
+ {
771
+ "include": "#resourceDef"
772
+ }
773
+ ],
774
+ "beginCaptures": {
775
+ "0": {
776
+ "name": "punctuation.definition.block.ballerina"
777
+ }
778
+ },
779
+ "endCaptures": {
780
+ "0": {
781
+ "name": "punctuation.definition.block.ballerina"
782
+ }
783
+ }
784
+ }
785
+ ]
786
+ },
787
+ "serviceDec": {
788
+ "patterns": [
789
+ {
790
+ "begin": "\\b(service)\\b",
791
+ "end": "(?\u003c=\\})",
792
+ "patterns": [
793
+ {
794
+ "include": "#serviceReceiver"
795
+ },
796
+ {
797
+ "include": "#serviceEndpointAttachments"
798
+ },
799
+ {
800
+ "include": "#serviceName"
801
+ },
802
+ {
803
+ "include": "#serviceBody"
804
+ },
805
+ {
806
+ "include": "#comment"
807
+ }
808
+ ],
809
+ "beginCaptures": {
810
+ "1": {
811
+ "name": "keyword.ballerina"
812
+ }
813
+ }
814
+ }
815
+ ]
816
+ },
817
+ "serviceEndpointAttachments": {
818
+ "patterns": [
819
+ {
820
+ "begin": "bind",
821
+ "end": "(?=\\{)",
822
+ "patterns": [
823
+ {
824
+ "name": "variable.parameter.ballerina",
825
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
826
+ },
827
+ {
828
+ "include": "#comment"
829
+ }
830
+ ],
831
+ "beginCaptures": {
832
+ "0": {
833
+ "name": "keyword.ballerina"
834
+ }
835
+ }
836
+ }
837
+ ]
838
+ },
839
+ "serviceName": {
840
+ "patterns": [
841
+ {
842
+ "name": "entity.name.function.ballerina",
843
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
844
+ }
845
+ ]
846
+ },
847
+ "serviceReceiver": {
848
+ "patterns": [
849
+ {
850
+ "begin": "\u003c",
851
+ "end": "\u003e",
852
+ "patterns": [
853
+ {
854
+ "name": "storage.type.ballerina",
855
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
856
+ },
857
+ {
858
+ "include": "#comment"
859
+ }
860
+ ],
861
+ "beginCaptures": {
862
+ "0": {
863
+ "name": "punctuation.definition.parameters.begin.ballerina"
864
+ }
865
+ },
866
+ "endCaptures": {
867
+ "0": {
868
+ "name": "punctuation.definition.parameters.end.ballerina"
869
+ }
870
+ }
871
+ }
872
+ ]
873
+ },
874
+ "strings": {
875
+ "patterns": [
876
+ {
877
+ "name": "string.quoted.double.ballerina",
878
+ "begin": "\\\"",
879
+ "end": "\\\"",
880
+ "patterns": [
881
+ {
882
+ "name": "constant.character.escape.ballerina",
883
+ "match": "\\\\."
884
+ }
885
+ ],
886
+ "beginCaptures": {
887
+ "0": {
888
+ "name": "punctuation.definition.string.begin.ballerina"
889
+ }
890
+ },
891
+ "endCaptures": {
892
+ "0": {
893
+ "name": "punctuation.definition.string.end.ballerina"
894
+ }
895
+ }
896
+ }
897
+ ]
898
+ },
899
+ "typeDef": {
900
+ "patterns": [
901
+ {
902
+ "begin": "\\b(type)\\b",
903
+ "end": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
904
+ "patterns": [
905
+ {
906
+ "include": "#objectDec"
907
+ },
908
+ {
909
+ "name": "entity.name.function.ballerina",
910
+ "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
911
+ },
912
+ {
913
+ "include": "#comment"
914
+ }
915
+ ],
916
+ "beginCaptures": {
917
+ "1": {
918
+ "name": "keyword.ballerina"
919
+ }
920
+ },
921
+ "endCaptures": {
922
+ "1": {
923
+ "name": "entity.name.function.ballerina"
924
+ }
925
+ }
926
+ }
927
+ ]
928
+ },
929
+ "types": {
930
+ "patterns": [
931
+ {
932
+ "name": "storage.type.ballerina",
933
+ "match": "\\b(boolean|int|float|string|var|any|datatable|table|blob)\\b"
934
+ },
935
+ {
936
+ "name": "storage.type.ballerina",
937
+ "match": "\\b(map|exception|json|xml|xmlns|error)\\b"
938
+ },
939
+ {
940
+ "name": "storage.type.siddhi.ballerina",
941
+ "match": "\\b(stream|streamlet|aggregation)\\b"
942
+ }
943
+ ]
944
+ },
945
+ "varDefBlock": {
946
+ "patterns": [
947
+ {
948
+ "begin": "\\b(private|public)\\b",
949
+ "end": "(?\u003c=\\})",
950
+ "patterns": [
951
+ {
952
+ "include": "#varDefBlockBody"
953
+ },
954
+ {
955
+ "include": "#functionDec"
956
+ }
957
+ ],
958
+ "beginCaptures": {
959
+ "1": {
960
+ "name": "keyword.ballerina"
961
+ }
962
+ }
963
+ }
964
+ ]
965
+ },
966
+ "varDefBlockBody": {
967
+ "patterns": [
968
+ {
969
+ "begin": "\\{",
970
+ "end": "\\}",
971
+ "patterns": [
972
+ {
973
+ "include": "#comment"
974
+ },
975
+ {
976
+ "include": "#varDefStatement"
977
+ }
978
+ ],
979
+ "beginCaptures": {
980
+ "0": {
981
+ "name": "punctuation.definition.block.ballerina.documentation"
982
+ }
983
+ },
984
+ "endCaptures": {
985
+ "0": {
986
+ "name": "punctuation.definition.block.ballerina.documentation"
987
+ }
988
+ }
989
+ }
990
+ ]
991
+ },
992
+ "varDefStatement": {
993
+ "patterns": [
994
+ {
995
+ "begin": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
996
+ "end": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b|(?==\u003e)",
997
+ "patterns": [
998
+ {
999
+ "include": "#continuedType"
1000
+ },
1001
+ {
1002
+ "include": "#constrainType"
1003
+ },
1004
+ {
1005
+ "include": "#comment"
1006
+ }
1007
+ ],
1008
+ "beginCaptures": {
1009
+ "1": {
1010
+ "name": "storage.type.ballerina"
1011
+ }
1012
+ },
1013
+ "endCaptures": {
1014
+ "1": {
1015
+ "name": "variable.parameter.ballerina"
1016
+ }
1017
+ }
106
1018
  }
107
1019
  ]
108
1020
  }