github-linguist 6.2.0 → 6.3.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 +5 -5
  2. data/bin/git-linguist +6 -12
  3. data/ext/linguist/linguist.h +7 -0
  4. data/ext/linguist/strndup.c +10 -0
  5. data/grammars/annotation.liquidhaskell.haskell.json +3 -0
  6. data/grammars/hint.haskell.json +3 -0
  7. data/grammars/hint.message.haskell.json +3 -0
  8. data/grammars/hint.type.haskell.json +3 -0
  9. data/grammars/source.apl.json +97 -106
  10. data/grammars/source.ballerina.json +577 -144
  11. data/grammars/source.batchfile.json +24 -10
  12. data/grammars/source.bsl.json +50 -10
  13. data/grammars/source.cobol.json +4 -4
  14. data/grammars/source.css.json +1 -1
  15. data/grammars/source.gfm.json +20 -3
  16. data/grammars/source.haskell.json +3 -0
  17. data/grammars/source.hsig.json +3 -0
  18. data/grammars/source.hx.argument.json +80 -0
  19. data/grammars/source.hx.json +131 -46
  20. data/grammars/source.hxml.json +17 -9
  21. data/grammars/source.isabelle.root.json +2 -2
  22. data/grammars/source.lua.json +10 -3
  23. data/grammars/source.nim.json +4 -4
  24. data/grammars/source.pawn.json +5 -5
  25. data/grammars/source.pony.json +2 -2
  26. data/grammars/source.powershell.json +128 -87
  27. data/grammars/source.rascal.json +1 -0
  28. data/grammars/source.stan.json +3 -3
  29. data/grammars/source.ts.json +90 -28
  30. data/grammars/source.tsx.json +95 -33
  31. data/grammars/text.elixir.json +1 -3
  32. data/grammars/text.html.erlang.yaws.json +1 -1
  33. data/grammars/text.html.markdown.source.gfm.apib.json +1 -3
  34. data/grammars/text.html.markdown.source.gfm.mson.json +1 -3
  35. data/grammars/text.marko.json +129 -21
  36. data/grammars/text.shell-session.json +1 -1
  37. data/grammars/text.tex.latex.haskell.json +3 -0
  38. data/grammars/text.xml.json +4 -4
  39. data/lib/linguist/generated.rb +19 -1
  40. data/lib/linguist/languages.json +1 -1
  41. data/lib/linguist/languages.yml +68 -59
  42. data/lib/linguist/samples.json +618 -413
  43. data/lib/linguist/version.rb +1 -1
  44. metadata +7 -6
  45. data/grammars/source.elixir.json +0 -927
@@ -2,15 +2,15 @@
2
2
  "name": "Ballerina",
3
3
  "scopeName": "source.ballerina",
4
4
  "patterns": [
5
- {
6
- "include": "#publicKeyword"
7
- },
8
5
  {
9
6
  "include": "#functionDec"
10
7
  },
11
8
  {
12
9
  "include": "#serviceDec"
13
10
  },
11
+ {
12
+ "include": "#endpointDef"
13
+ },
14
14
  {
15
15
  "include": "#documentationDef"
16
16
  },
@@ -20,9 +20,18 @@
20
20
  {
21
21
  "include": "#objectDec"
22
22
  },
23
+ {
24
+ "include": "#record"
25
+ },
23
26
  {
24
27
  "include": "#annotationDec"
25
28
  },
29
+ {
30
+ "include": "#recordLiteral"
31
+ },
32
+ {
33
+ "include": "#comment"
34
+ },
26
35
  {
27
36
  "include": "#code"
28
37
  }
@@ -32,7 +41,7 @@
32
41
  "patterns": [
33
42
  {
34
43
  "name": "storage.type.annotation.ballerina",
35
- "match": "@([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
44
+ "match": "@((?:(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")):)?(?:(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))"
36
45
  }
37
46
  ]
38
47
  },
@@ -44,23 +53,112 @@
44
53
  }
45
54
  ]
46
55
  },
56
+ "butClause": {
57
+ "patterns": [
58
+ {
59
+ "begin": "=\u003e",
60
+ "end": ",|(?=\\})",
61
+ "patterns": [
62
+ {
63
+ "include": "#code"
64
+ }
65
+ ],
66
+ "beginCaptures": {
67
+ "0": {
68
+ "name": "keyword.operator.ballerina"
69
+ }
70
+ }
71
+ }
72
+ ]
73
+ },
47
74
  "butExp": {
48
75
  "patterns": [
49
76
  {
50
- "begin": "\\b(but)\\b",
51
- "end": "(?\u003c=\\})",
77
+ "begin": "\\bbut\\b",
78
+ "end": "\\}",
52
79
  "patterns": [
53
80
  {
54
- "include": "#matchStatementBody"
81
+ "include": "#butExpBody"
55
82
  },
56
83
  {
57
84
  "include": "#comment"
58
85
  }
59
86
  ],
60
87
  "beginCaptures": {
61
- "1": {
88
+ "0": {
62
89
  "name": "keyword.ballerina"
63
90
  }
91
+ },
92
+ "endCaptures": {
93
+ "0": {
94
+ "name": "punctuation.definition.block.ballerina.documentation"
95
+ }
96
+ }
97
+ }
98
+ ]
99
+ },
100
+ "butExpBody": {
101
+ "patterns": [
102
+ {
103
+ "begin": "\\{",
104
+ "end": "(?=\\})",
105
+ "patterns": [
106
+ {
107
+ "include": "#parameter"
108
+ },
109
+ {
110
+ "include": "#butClause"
111
+ },
112
+ {
113
+ "include": "#comment"
114
+ }
115
+ ],
116
+ "beginCaptures": {
117
+ "0": {
118
+ "name": "punctuation.definition.block.ballerina.documentation"
119
+ }
120
+ },
121
+ "endCaptures": {
122
+ "0": {
123
+ "name": "punctuation.definition.block.ballerina.documentation"
124
+ }
125
+ }
126
+ }
127
+ ]
128
+ },
129
+ "call": {
130
+ "patterns": [
131
+ {
132
+ "name": "entity.name.function.ballerina",
133
+ "match": "((?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\s*(?=\\()"
134
+ }
135
+ ]
136
+ },
137
+ "callableUnitBody": {
138
+ "patterns": [
139
+ {
140
+ "begin": "\\{",
141
+ "end": "(?=\\})",
142
+ "patterns": [
143
+ {
144
+ "include": "#endpointDef"
145
+ },
146
+ {
147
+ "include": "#workerDef"
148
+ },
149
+ {
150
+ "include": "#code"
151
+ }
152
+ ],
153
+ "beginCaptures": {
154
+ "0": {
155
+ "name": "punctuation.definition.block.ballerina"
156
+ }
157
+ },
158
+ "endCaptures": {
159
+ "0": {
160
+ "name": "punctuation.definition.block.ballerina"
161
+ }
64
162
  }
65
163
  }
66
164
  ]
@@ -70,6 +168,18 @@
70
168
  {
71
169
  "include": "#booleans"
72
170
  },
171
+ {
172
+ "include": "#matchStatement"
173
+ },
174
+ {
175
+ "include": "#butExp"
176
+ },
177
+ {
178
+ "include": "#xml"
179
+ },
180
+ {
181
+ "include": "#stringTemplate"
182
+ },
73
183
  {
74
184
  "include": "#keywords"
75
185
  },
@@ -90,15 +200,6 @@
90
200
  },
91
201
  {
92
202
  "include": "#comment"
93
- },
94
- {
95
- "include": "#matchStatement"
96
- },
97
- {
98
- "include": "#butExp"
99
- },
100
- {
101
- "include": "#identifiers"
102
203
  }
103
204
  ]
104
205
  },
@@ -124,8 +225,8 @@
124
225
  },
125
226
  {},
126
227
  {
127
- "name": "storage.type.constrain.ballerina",
128
- "match": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b"
228
+ "name": "storage.type.ballerina",
229
+ "match": "\\b((?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b"
129
230
  }
130
231
  ],
131
232
  "beginCaptures": {
@@ -141,19 +242,51 @@
141
242
  }
142
243
  ]
143
244
  },
245
+ "continuedTupleType": {
246
+ "patterns": [
247
+ {
248
+ "begin": "\\(",
249
+ "end": "(?=\\)|;)",
250
+ "patterns": [
251
+ {
252
+ "include": "#comment"
253
+ },
254
+ {
255
+ "include": "#continuedType"
256
+ },
257
+ {},
258
+ {
259
+ "name": "storage.type.ballerina",
260
+ "match": "\\b((?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b"
261
+ }
262
+ ]
263
+ }
264
+ ]
265
+ },
144
266
  "continuedType": {
145
267
  "patterns": [
146
268
  {
147
269
  "begin": "[|,:]",
148
- "end": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
270
+ "end": "(\\b(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")\\b)|(\\))",
149
271
  "patterns": [
150
272
  {
151
273
  "include": "#comment"
274
+ },
275
+ {
276
+ "include": "#continuedTupleType"
152
277
  }
153
278
  ],
279
+ "beginCaptures": {
280
+ "0": {
281
+ "name": "keyword.operator.ballerina"
282
+ }
283
+ },
154
284
  "endCaptures": {
155
285
  "1": {
156
286
  "name": "storage.type.ballerina"
287
+ },
288
+ "2": {
289
+ "name": "source.ballerina"
157
290
  }
158
291
  }
159
292
  }
@@ -168,7 +301,12 @@
168
301
  {
169
302
  "include": "#code"
170
303
  }
171
- ]
304
+ ],
305
+ "beginCaptures": {
306
+ "0": {
307
+ "name": "keyword.operator.ballerina"
308
+ }
309
+ }
172
310
  }
173
311
  ]
174
312
  },
@@ -176,10 +314,10 @@
176
314
  "patterns": [
177
315
  {
178
316
  "begin": "\\{",
179
- "end": "\\}",
317
+ "end": "(?=\\})",
180
318
  "patterns": [
181
319
  {
182
- "match": "(P|R|T|F|V)({{)(.+)(}})",
320
+ "match": "(P|R|T|F|V)({{)(.*)(}})",
183
321
  "captures": {
184
322
  "1": {
185
323
  "name": "keyword.other.ballerina.documentation"
@@ -231,42 +369,48 @@
231
369
  "documentationDef": {
232
370
  "patterns": [
233
371
  {
234
- "begin": "\\b(documentation|deprecated)\\b",
235
- "end": "(?\u003c=\\})",
372
+ "begin": "\\b(?:documentation|deprecated)\\b",
373
+ "end": "\\}",
236
374
  "patterns": [
237
375
  {
238
376
  "include": "#documentationBody"
377
+ },
378
+ {
379
+ "include": "#comment"
239
380
  }
240
381
  ],
241
382
  "beginCaptures": {
242
- "1": {
383
+ "0": {
243
384
  "name": "keyword.ballerina"
244
385
  }
386
+ },
387
+ "endCaptures": {
388
+ "0": {
389
+ "name": "delimiter.curly"
390
+ }
245
391
  }
246
392
  }
247
393
  ]
248
394
  },
249
- "functionBody": {
395
+ "endpointDef": {
250
396
  "patterns": [
251
397
  {
252
- "begin": "\\{",
253
- "end": "\\}",
398
+ "begin": "\\bendpoint\\b",
399
+ "end": ";",
254
400
  "patterns": [
255
401
  {
256
- "include": "#comment"
402
+ "include": "#parameter"
257
403
  },
258
404
  {
259
- "include": "#code"
405
+ "include": "#recordLiteral"
406
+ },
407
+ {
408
+ "include": "#comment"
260
409
  }
261
410
  ],
262
411
  "beginCaptures": {
263
412
  "0": {
264
- "name": "punctuation.definition.block.ballerina"
265
- }
266
- },
267
- "endCaptures": {
268
- "0": {
269
- "name": "punctuation.definition.block.ballerina"
413
+ "name": "keyword.ballerina"
270
414
  }
271
415
  }
272
416
  }
@@ -275,8 +419,8 @@
275
419
  "functionDec": {
276
420
  "patterns": [
277
421
  {
278
- "begin": "\\b(function)\\b",
279
- "end": "(?\u003c=\\})",
422
+ "begin": "\\bfunction\\b",
423
+ "end": "\\}|(?=;)",
280
424
  "patterns": [
281
425
  {
282
426
  "include": "#functionReceiver"
@@ -291,16 +435,21 @@
291
435
  "include": "#functionName"
292
436
  },
293
437
  {
294
- "include": "#functionBody"
438
+ "include": "#callableUnitBody"
295
439
  },
296
440
  {
297
441
  "include": "#comment"
298
442
  }
299
443
  ],
300
444
  "beginCaptures": {
301
- "1": {
445
+ "0": {
302
446
  "name": "keyword.ballerina"
303
447
  }
448
+ },
449
+ "endCaptures": {
450
+ "0": {
451
+ "name": "punctuation.definition.block.ballerina"
452
+ }
304
453
  }
305
454
  }
306
455
  ]
@@ -309,7 +458,7 @@
309
458
  "patterns": [
310
459
  {
311
460
  "name": "entity.name.function.ballerina",
312
- "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
461
+ "match": "(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
313
462
  }
314
463
  ]
315
464
  },
@@ -320,20 +469,23 @@
320
469
  "end": "\\)",
321
470
  "patterns": [
322
471
  {
323
- "include": "#varDefStatement"
472
+ "include": "#parameter"
324
473
  },
325
474
  {
326
475
  "include": "#defaultValue"
476
+ },
477
+ {
478
+ "include": "#comment"
327
479
  }
328
480
  ],
329
481
  "beginCaptures": {
330
482
  "0": {
331
- "name": "punctuation.definition.parameters.begin.ballerina"
483
+ "name": "delimiter.parenthesis"
332
484
  }
333
485
  },
334
486
  "endCaptures": {
335
487
  "0": {
336
- "name": "punctuation.definition.parameters.end.ballerina"
488
+ "name": "delimiter.parenthesis"
337
489
  }
338
490
  }
339
491
  }
@@ -346,7 +498,7 @@
346
498
  "end": "\u003e",
347
499
  "patterns": [
348
500
  {
349
- "include": "#varDefStatement"
501
+ "include": "#parameter"
350
502
  },
351
503
  {
352
504
  "include": "#comment"
@@ -369,11 +521,11 @@
369
521
  "patterns": [
370
522
  {
371
523
  "begin": "\\breturns\\b",
372
- "end": "(?=\\{)",
524
+ "end": "(?=\\{|;)",
373
525
  "patterns": [
374
526
  {
375
527
  "name": "storage.type.ballerina",
376
- "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
528
+ "match": "(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
377
529
  },
378
530
  {
379
531
  "include": "#comment"
@@ -383,27 +535,24 @@
383
535
  "0": {
384
536
  "name": "keyword.ballerina"
385
537
  }
538
+ },
539
+ "endCaptures": {
540
+ "0": {
541
+ "name": "curly"
542
+ }
386
543
  }
387
544
  }
388
545
  ]
389
546
  },
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
- ]
397
- },
398
547
  "keywords": {
399
548
  "patterns": [
400
549
  {
401
550
  "name": "keyword.control.ballerina",
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"
551
+ "match": "\\b(if|else|iterator|try|catch|finally|fork|join|all|some|while|foreach|in|throw|return|returns|break|timeout|transaction|abort|retry|retries|continue|bind|with|lengthof|typeof|enum)\\b"
403
552
  },
404
553
  {
405
554
  "name": "keyword.other.ballerina",
406
- "match": "\\b(import|version|public|private|attach|as|native|documentation|lock)\\b"
555
+ "match": "\\b(import|version|public|private|attach|as|native|documentation|lock|new|record|limit|ascending|descending|check|start|done|untaint|onretry|oncommit|onabort|scope|compensate|compensation|primarykey)\\b"
407
556
  },
408
557
  {
409
558
  "name": "keyword.other.siddhi.ballerina",
@@ -411,7 +560,7 @@
411
560
  },
412
561
  {
413
562
  "name": "keyword.other.ballerina",
414
- "match": "\\b(annotation|package|type|typedesc|connector|function|resource|service|action|worker|struct|transformer|endpoint|object)\\b"
563
+ "match": "\\b(annotation|package|type|connector|function|resource|service|action|worker|struct|transformer|endpoint|object)\\b"
415
564
  },
416
565
  {
417
566
  "name": "keyword.other.ballerina",
@@ -432,9 +581,6 @@
432
581
  "begin": "\\{",
433
582
  "end": "\\}",
434
583
  "patterns": [
435
- {
436
- "include": "#comment"
437
- },
438
584
  {
439
585
  "include": "#code"
440
586
  }
@@ -455,19 +601,21 @@
455
601
  "matchStatement": {
456
602
  "patterns": [
457
603
  {
458
- "begin": "\\b(match)\\b",
459
- "end": "(?\u003c=\\})",
604
+ "begin": "\\bmatch\\b",
605
+ "end": "\\}",
460
606
  "patterns": [
461
607
  {
462
- "name": "variable.parameter.ballerina",
463
- "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
608
+ "include": "#matchStatementBody"
464
609
  },
465
610
  {
466
- "include": "#matchStatementBody"
611
+ "include": "#comment"
612
+ },
613
+ {
614
+ "include": "#code"
467
615
  }
468
616
  ],
469
617
  "beginCaptures": {
470
- "1": {
618
+ "0": {
471
619
  "name": "keyword.ballerina"
472
620
  }
473
621
  }
@@ -478,13 +626,16 @@
478
626
  "patterns": [
479
627
  {
480
628
  "begin": "\\{",
481
- "end": "\\}",
629
+ "end": "(?=\\})",
482
630
  "patterns": [
483
631
  {
484
- "include": "#varDefStatement"
632
+ "include": "#parameter"
485
633
  },
486
634
  {
487
635
  "include": "#matchStatementPatternClause"
636
+ },
637
+ {
638
+ "include": "#comment"
488
639
  }
489
640
  ],
490
641
  "beginCaptures": {
@@ -504,10 +655,10 @@
504
655
  "patterns": [
505
656
  {
506
657
  "begin": "=\u003e",
507
- "end": "((?\u003c=\\})|;|,)",
658
+ "end": "((\\})|;|,)",
508
659
  "patterns": [
509
660
  {
510
- "include": "#functionBody"
661
+ "include": "#callableUnitBody"
511
662
  },
512
663
  {
513
664
  "include": "#code"
@@ -525,7 +676,7 @@
525
676
  "patterns": [
526
677
  {
527
678
  "name": "constant.numeric.decimal.ballerina",
528
- "match": "\\b[0-9]+\\b"
679
+ "match": "\\b0[xX][\\da-f]+\\b|\\b\\d+\\.?\\d*"
529
680
  }
530
681
  ]
531
682
  },
@@ -533,17 +684,26 @@
533
684
  "patterns": [
534
685
  {
535
686
  "begin": "\\{",
536
- "end": "\\}",
687
+ "end": "(?=\\})",
537
688
  "patterns": [
538
689
  {
539
690
  "include": "#varDefBlock"
540
691
  },
692
+ {
693
+ "include": "#documentationDef"
694
+ },
541
695
  {
542
696
  "include": "#objectInitDec"
543
697
  },
544
698
  {
545
699
  "include": "#functionDec"
546
700
  },
701
+ {
702
+ "include": "#annotationDec"
703
+ },
704
+ {
705
+ "include": "#variableDef"
706
+ },
547
707
  {
548
708
  "include": "#comment"
549
709
  },
@@ -567,8 +727,8 @@
567
727
  "objectDec": {
568
728
  "patterns": [
569
729
  {
570
- "begin": "\\b(object)\\b",
571
- "end": "(?\u003c=\\})",
730
+ "begin": "\\bobject\\b",
731
+ "end": "\\}",
572
732
  "patterns": [
573
733
  {
574
734
  "include": "#objectBody"
@@ -578,9 +738,14 @@
578
738
  }
579
739
  ],
580
740
  "beginCaptures": {
581
- "1": {
741
+ "0": {
582
742
  "name": "keyword.ballerina"
583
743
  }
744
+ },
745
+ "endCaptures": {
746
+ "0": {
747
+ "name": "delimiter.curly"
748
+ }
584
749
  }
585
750
  }
586
751
  ]
@@ -589,7 +754,7 @@
589
754
  "patterns": [
590
755
  {
591
756
  "begin": "\\{",
592
- "end": "\\}",
757
+ "end": "(?=\\})",
593
758
  "patterns": [
594
759
  {
595
760
  "include": "#comment"
@@ -614,8 +779,8 @@
614
779
  "objectInitDec": {
615
780
  "patterns": [
616
781
  {
617
- "begin": "\\b(new)\\b",
618
- "end": "(?\u003c=\\})",
782
+ "begin": "\\bnew\\b",
783
+ "end": "\\}",
619
784
  "patterns": [
620
785
  {
621
786
  "include": "#objectInitParameters"
@@ -625,7 +790,7 @@
625
790
  }
626
791
  ],
627
792
  "beginCaptures": {
628
- "1": {
793
+ "0": {
629
794
  "name": "keyword.ballerina"
630
795
  }
631
796
  }
@@ -639,14 +804,11 @@
639
804
  "end": "\\)",
640
805
  "patterns": [
641
806
  {
642
- "include": "#types"
807
+ "include": "#code"
643
808
  },
644
809
  {
645
810
  "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"
811
+ "match": "\\b((?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b"
650
812
  }
651
813
  ],
652
814
  "beginCaptures": {
@@ -662,6 +824,73 @@
662
824
  }
663
825
  ]
664
826
  },
827
+ "objectMemberFunctionDec": {
828
+ "patterns": [
829
+ {
830
+ "begin": "\\bfunction\\b",
831
+ "end": "(?=(?:\\}|;))",
832
+ "patterns": [
833
+ {
834
+ "include": "#functionReceiver"
835
+ },
836
+ {
837
+ "include": "#functionParameters"
838
+ },
839
+ {
840
+ "include": "#functionReturns"
841
+ },
842
+ {
843
+ "include": "#functionName"
844
+ },
845
+ {
846
+ "include": "#callableUnitBody"
847
+ },
848
+ {
849
+ "include": "#comment"
850
+ }
851
+ ],
852
+ "beginCaptures": {
853
+ "0": {
854
+ "name": "keyword.ballerina"
855
+ }
856
+ },
857
+ "endCaptures": {
858
+ "0": {
859
+ "name": "punctuation.definition.block.ballerina"
860
+ }
861
+ }
862
+ }
863
+ ]
864
+ },
865
+ "parameter": {
866
+ "patterns": [
867
+ {
868
+ "begin": "\\b(?:(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
869
+ "end": "\\b(?:(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b|(?==\u003e)|(?=\\))",
870
+ "patterns": [
871
+ {
872
+ "include": "#continuedType"
873
+ },
874
+ {
875
+ "include": "#constrainType"
876
+ },
877
+ {
878
+ "include": "#comment"
879
+ }
880
+ ],
881
+ "beginCaptures": {
882
+ "0": {
883
+ "name": "storage.type.ballerina"
884
+ }
885
+ },
886
+ "endCaptures": {
887
+ "0": {
888
+ "name": "variable.parameter.ballerina"
889
+ }
890
+ }
891
+ }
892
+ ]
893
+ },
665
894
  "paranthesised": {
666
895
  "patterns": [
667
896
  {
@@ -694,20 +923,44 @@
694
923
  }
695
924
  ]
696
925
  },
697
- "publicKeyword": {
926
+ "record": {
698
927
  "patterns": [
699
928
  {
700
- "name": "keyword.ballerina",
701
- "match": "\\bpublic\\b"
929
+ "begin": "\\brecord\\b",
930
+ "end": "\\}",
931
+ "patterns": [
932
+ {
933
+ "include": "#recordBody"
934
+ },
935
+ {
936
+ "include": "#comment"
937
+ }
938
+ ],
939
+ "beginCaptures": {
940
+ "0": {
941
+ "name": "keyword.ballerina"
942
+ }
943
+ },
944
+ "endCaptures": {
945
+ "0": {
946
+ "name": "delimiter.curly"
947
+ }
948
+ }
702
949
  }
703
950
  ]
704
951
  },
705
- "resourceBody": {
952
+ "recordBody": {
706
953
  "patterns": [
707
954
  {
708
955
  "begin": "\\{",
709
- "end": "\\}",
956
+ "end": "(?=\\})",
710
957
  "patterns": [
958
+ {
959
+ "include": "#annotationDec"
960
+ },
961
+ {
962
+ "include": "#variableDef"
963
+ },
711
964
  {
712
965
  "include": "#comment"
713
966
  },
@@ -728,11 +981,34 @@
728
981
  }
729
982
  ]
730
983
  },
984
+ "recordLiteral": {
985
+ "patterns": [
986
+ {
987
+ "begin": "\\{",
988
+ "end": "\\}",
989
+ "patterns": [
990
+ {
991
+ "include": "#code"
992
+ }
993
+ ],
994
+ "beginCaptures": {
995
+ "0": {
996
+ "name": "punctuation.definition.block.ballerina"
997
+ }
998
+ },
999
+ "endCaptures": {
1000
+ "0": {
1001
+ "name": "punctuation.definition.block.ballerina"
1002
+ }
1003
+ }
1004
+ }
1005
+ ]
1006
+ },
731
1007
  "resourceDef": {
732
1008
  "patterns": [
733
1009
  {
734
- "begin": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
735
- "end": "(?\u003c=\\})",
1010
+ "begin": "((?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\s*(?=\\()",
1011
+ "end": "\\}",
736
1012
  "patterns": [
737
1013
  {
738
1014
  "include": "#comment"
@@ -741,13 +1017,54 @@
741
1017
  "include": "#functionParameters"
742
1018
  },
743
1019
  {
744
- "include": "#resourceBody"
1020
+ "include": "#callableUnitBody"
745
1021
  }
746
1022
  ],
747
1023
  "beginCaptures": {
748
- "1": {
1024
+ "0": {
749
1025
  "name": "entity.name.function.ballerina"
750
1026
  }
1027
+ },
1028
+ "endCaptures": {
1029
+ "0": {
1030
+ "name": "punctuation.definition.block.ballerina"
1031
+ }
1032
+ }
1033
+ }
1034
+ ]
1035
+ },
1036
+ "serviceBindRecordLiteral": {
1037
+ "patterns": [
1038
+ {
1039
+ "begin": "\\{",
1040
+ "end": "(?=\\})",
1041
+ "patterns": [
1042
+ {
1043
+ "include": "#code"
1044
+ }
1045
+ ],
1046
+ "beginCaptures": {
1047
+ "0": {
1048
+ "name": "punctuation.definition.block.ballerina"
1049
+ }
1050
+ },
1051
+ "endCaptures": {
1052
+ "0": {
1053
+ "name": "punctuation.definition.block.ballerina"
1054
+ }
1055
+ }
1056
+ }
1057
+ ]
1058
+ },
1059
+ "serviceBindVarContinued": {
1060
+ "patterns": [
1061
+ {
1062
+ "begin": ",",
1063
+ "end": "(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")",
1064
+ "endCaptures": {
1065
+ "0": {
1066
+ "name": "variable.parameter.ballerina"
1067
+ }
751
1068
  }
752
1069
  }
753
1070
  ]
@@ -756,7 +1073,7 @@
756
1073
  "patterns": [
757
1074
  {
758
1075
  "begin": "\\{",
759
- "end": "\\}",
1076
+ "end": "(?=\\})",
760
1077
  "patterns": [
761
1078
  {
762
1079
  "include": "#comment"
@@ -767,8 +1084,17 @@
767
1084
  {
768
1085
  "include": "#annotationDec"
769
1086
  },
1087
+ {
1088
+ "include": "#endpointDef"
1089
+ },
770
1090
  {
771
1091
  "include": "#resourceDef"
1092
+ },
1093
+ {
1094
+ "include": "#recordLiteral"
1095
+ },
1096
+ {
1097
+ "include": "#code"
772
1098
  }
773
1099
  ],
774
1100
  "beginCaptures": {
@@ -787,8 +1113,8 @@
787
1113
  "serviceDec": {
788
1114
  "patterns": [
789
1115
  {
790
- "begin": "\\b(service)\\b",
791
- "end": "(?\u003c=\\})",
1116
+ "begin": "\\bservice\\b",
1117
+ "end": "\\}",
792
1118
  "patterns": [
793
1119
  {
794
1120
  "include": "#serviceReceiver"
@@ -799,17 +1125,25 @@
799
1125
  {
800
1126
  "include": "#serviceName"
801
1127
  },
1128
+ {
1129
+ "include": "#comment"
1130
+ },
802
1131
  {
803
1132
  "include": "#serviceBody"
804
1133
  },
805
1134
  {
806
- "include": "#comment"
1135
+ "include": "#serviceBindVarContinued"
807
1136
  }
808
1137
  ],
809
1138
  "beginCaptures": {
810
- "1": {
1139
+ "0": {
811
1140
  "name": "keyword.ballerina"
812
1141
  }
1142
+ },
1143
+ "endCaptures": {
1144
+ "0": {
1145
+ "name": "punctuation.definition.block.ballerina"
1146
+ }
813
1147
  }
814
1148
  }
815
1149
  ]
@@ -818,11 +1152,10 @@
818
1152
  "patterns": [
819
1153
  {
820
1154
  "begin": "bind",
821
- "end": "(?=\\{)",
1155
+ "end": "(\\})|((?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))",
822
1156
  "patterns": [
823
1157
  {
824
- "name": "variable.parameter.ballerina",
825
- "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
1158
+ "include": "#serviceBindRecordLiteral"
826
1159
  },
827
1160
  {
828
1161
  "include": "#comment"
@@ -832,6 +1165,14 @@
832
1165
  "0": {
833
1166
  "name": "keyword.ballerina"
834
1167
  }
1168
+ },
1169
+ "endCaptures": {
1170
+ "1": {
1171
+ "name": "punctuation.definition.block.ballerina"
1172
+ },
1173
+ "2": {
1174
+ "name": "variable.parameter.ballerina"
1175
+ }
835
1176
  }
836
1177
  }
837
1178
  ]
@@ -840,7 +1181,7 @@
840
1181
  "patterns": [
841
1182
  {
842
1183
  "name": "entity.name.function.ballerina",
843
- "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
1184
+ "match": "(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
844
1185
  }
845
1186
  ]
846
1187
  },
@@ -852,7 +1193,7 @@
852
1193
  "patterns": [
853
1194
  {
854
1195
  "name": "storage.type.ballerina",
855
- "match": "([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
1196
+ "match": "(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")"
856
1197
  },
857
1198
  {
858
1199
  "include": "#comment"
@@ -871,56 +1212,106 @@
871
1212
  }
872
1213
  ]
873
1214
  },
1215
+ "stringTemplate": {
1216
+ "patterns": [
1217
+ {
1218
+ "begin": "(\\bstring)(\\s*)(`)",
1219
+ "end": "`",
1220
+ "patterns": [
1221
+ {
1222
+ "include": "#templateVariable"
1223
+ },
1224
+ {
1225
+ "name": "string",
1226
+ "match": "."
1227
+ }
1228
+ ],
1229
+ "beginCaptures": {
1230
+ "1": {
1231
+ "name": "keyword.ballerina"
1232
+ },
1233
+ "2": {},
1234
+ "3": {
1235
+ "name": "string.template.ballerina"
1236
+ }
1237
+ },
1238
+ "endCaptures": {
1239
+ "0": {
1240
+ "name": "string.template.ballerina"
1241
+ }
1242
+ }
1243
+ }
1244
+ ]
1245
+ },
874
1246
  "strings": {
875
1247
  "patterns": [
876
1248
  {
877
- "name": "string.quoted.double.ballerina",
878
1249
  "begin": "\\\"",
879
1250
  "end": "\\\"",
880
1251
  "patterns": [
881
1252
  {
882
1253
  "name": "constant.character.escape.ballerina",
883
1254
  "match": "\\\\."
1255
+ },
1256
+ {
1257
+ "name": "string",
1258
+ "match": "."
884
1259
  }
885
1260
  ],
886
1261
  "beginCaptures": {
887
1262
  "0": {
888
- "name": "punctuation.definition.string.begin.ballerina"
1263
+ "name": "string.begin.ballerina"
889
1264
  }
890
1265
  },
891
1266
  "endCaptures": {
892
1267
  "0": {
893
- "name": "punctuation.definition.string.end.ballerina"
1268
+ "name": "string.end.ballerina"
894
1269
  }
895
1270
  }
896
1271
  }
897
1272
  ]
898
1273
  },
899
- "typeDef": {
1274
+ "templateVariable": {
900
1275
  "patterns": [
901
1276
  {
902
- "begin": "\\b(type)\\b",
903
- "end": "\\b(([a-zA-Z_]([a-zA-Z0-9_])*)|(\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b",
1277
+ "begin": "{{",
1278
+ "end": "}}",
904
1279
  "patterns": [
905
1280
  {
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
- },
1281
+ "include": "#code"
1282
+ }
1283
+ ],
1284
+ "beginCaptures": {
1285
+ "0": {
1286
+ "name": "constant.character.escape.ballerina"
1287
+ }
1288
+ },
1289
+ "endCaptures": {
1290
+ "0": {
1291
+ "name": "constant.character.escape.ballerina"
1292
+ }
1293
+ }
1294
+ }
1295
+ ]
1296
+ },
1297
+ "typeDef": {
1298
+ "patterns": [
1299
+ {
1300
+ "begin": "\\btype\\b",
1301
+ "end": "\\b(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\")\\b",
1302
+ "patterns": [
912
1303
  {
913
1304
  "include": "#comment"
914
1305
  }
915
1306
  ],
916
1307
  "beginCaptures": {
917
- "1": {
1308
+ "0": {
918
1309
  "name": "keyword.ballerina"
919
1310
  }
920
1311
  },
921
1312
  "endCaptures": {
922
- "1": {
923
- "name": "entity.name.function.ballerina"
1313
+ "0": {
1314
+ "name": "source.ballerina"
924
1315
  }
925
1316
  }
926
1317
  }
@@ -930,14 +1321,14 @@
930
1321
  "patterns": [
931
1322
  {
932
1323
  "name": "storage.type.ballerina",
933
- "match": "\\b(boolean|int|float|string|var|any|datatable|table|blob)\\b"
1324
+ "match": "\\b(boolean|int|float|string|var|any|datatable|table|byte|future|typedesc)\\b"
934
1325
  },
935
1326
  {
936
1327
  "name": "storage.type.ballerina",
937
1328
  "match": "\\b(map|exception|json|xml|xmlns|error)\\b"
938
1329
  },
939
1330
  {
940
- "name": "storage.type.siddhi.ballerina",
1331
+ "name": "storage.type.ballerina",
941
1332
  "match": "\\b(stream|streamlet|aggregation)\\b"
942
1333
  }
943
1334
  ]
@@ -945,74 +1336,116 @@
945
1336
  "varDefBlock": {
946
1337
  "patterns": [
947
1338
  {
948
- "begin": "\\b(private|public)\\b",
949
- "end": "(?\u003c=\\})",
1339
+ "begin": "\\b(?:private|public)\\b",
1340
+ "end": "\\}|;|,",
950
1341
  "patterns": [
951
1342
  {
952
- "include": "#varDefBlockBody"
1343
+ "include": "#objectMemberFunctionDec"
953
1344
  },
954
1345
  {
955
- "include": "#functionDec"
1346
+ "include": "#variableDef"
1347
+ },
1348
+ {
1349
+ "include": "#code"
956
1350
  }
957
1351
  ],
958
1352
  "beginCaptures": {
959
- "1": {
1353
+ "0": {
960
1354
  "name": "keyword.ballerina"
961
1355
  }
962
1356
  }
963
1357
  }
964
1358
  ]
965
1359
  },
966
- "varDefBlockBody": {
1360
+ "variableDef": {
967
1361
  "patterns": [
968
1362
  {
969
- "begin": "\\{",
970
- "end": "\\}",
1363
+ "begin": "\\b(?:(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b|(?=\\()",
1364
+ "end": "\\b(?:(?:[a-zA-Z_][a-zA-Z0-9_]*)|(?:\\^\"([^|\"\\\\\\f\\n\\r\\t]|\\\\\\\\[btnfr]|\\\\[|\"\\\\/])+\"))\\b|(?=\\,)|(?=;)|\\.\\.\\.",
971
1365
  "patterns": [
972
1366
  {
973
- "include": "#comment"
1367
+ "include": "#continuedTupleType"
1368
+ },
1369
+ {
1370
+ "include": "#continuedType"
974
1371
  },
975
1372
  {
976
- "include": "#varDefStatement"
1373
+ "include": "#constrainType"
1374
+ },
1375
+ {
1376
+ "include": "#comment"
977
1377
  }
978
1378
  ],
979
1379
  "beginCaptures": {
980
1380
  "0": {
981
- "name": "punctuation.definition.block.ballerina.documentation"
1381
+ "name": "storage.type.ballerina"
982
1382
  }
983
1383
  },
984
1384
  "endCaptures": {
985
1385
  "0": {
986
- "name": "punctuation.definition.block.ballerina.documentation"
1386
+ "name": "source.ballerina"
987
1387
  }
988
1388
  }
989
1389
  }
990
1390
  ]
991
1391
  },
992
- "varDefStatement": {
1392
+ "workerBody": {
993
1393
  "patterns": [
994
1394
  {
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)",
1395
+ "begin": "\\{",
1396
+ "end": "(?=\\})",
997
1397
  "patterns": [
998
1398
  {
999
- "include": "#continuedType"
1000
- },
1399
+ "include": "#code"
1400
+ }
1401
+ ]
1402
+ }
1403
+ ]
1404
+ },
1405
+ "workerDef": {
1406
+ "patterns": [
1407
+ {
1408
+ "begin": "\\bworker\\b",
1409
+ "end": "\\}",
1410
+ "patterns": [
1001
1411
  {
1002
- "include": "#constrainType"
1412
+ "include": "#workerBody"
1413
+ }
1414
+ ],
1415
+ "beginCaptures": {
1416
+ "0": {
1417
+ "name": "keyword.ballerina"
1418
+ }
1419
+ }
1420
+ }
1421
+ ]
1422
+ },
1423
+ "xml": {
1424
+ "patterns": [
1425
+ {
1426
+ "begin": "(\\bxml)(\\s*)(`)",
1427
+ "end": "`",
1428
+ "patterns": [
1429
+ {
1430
+ "include": "#templateVariable"
1003
1431
  },
1004
1432
  {
1005
- "include": "#comment"
1433
+ "name": "string",
1434
+ "match": "."
1006
1435
  }
1007
1436
  ],
1008
1437
  "beginCaptures": {
1009
1438
  "1": {
1010
- "name": "storage.type.ballerina"
1439
+ "name": "keyword.ballerina"
1440
+ },
1441
+ "2": {},
1442
+ "3": {
1443
+ "name": "string.template.ballerina"
1011
1444
  }
1012
1445
  },
1013
1446
  "endCaptures": {
1014
- "1": {
1015
- "name": "variable.parameter.ballerina"
1447
+ "0": {
1448
+ "name": "string.template.ballerina"
1016
1449
  }
1017
1450
  }
1018
1451
  }