github-linguist 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/annotation.liquidhaskell.haskell.json +1445 -0
  3. data/grammars/hint.haskell.json +134 -17
  4. data/grammars/hint.message.haskell.json +134 -17
  5. data/grammars/hint.type.haskell.json +134 -17
  6. data/grammars/source.abl.json +48 -48
  7. data/grammars/source.afm.json +8 -1
  8. data/grammars/source.angelscript.json +195 -0
  9. data/grammars/source.ats.json +128 -58
  10. data/grammars/source.awk.json +138 -138
  11. data/grammars/source.ballerina.json +434 -0
  12. data/grammars/source.chapel.json +1 -1
  13. data/grammars/source.clips.json +20 -20
  14. data/grammars/source.cobol.json +4 -3
  15. data/grammars/source.coffee.json +556 -109
  16. data/grammars/source.cs.json +10 -5
  17. data/grammars/source.csound-document.json +1 -1
  18. data/grammars/source.csound-score.json +9 -9
  19. data/grammars/source.csound.json +23 -28
  20. data/grammars/source.css.json +6 -5
  21. data/grammars/source.data-weave.json +1584 -0
  22. data/grammars/source.elixir.json +3 -61
  23. data/grammars/source.elm.json +88 -88
  24. data/grammars/source.emacs.lisp.json +12 -1
  25. data/grammars/source.haskell.json +134 -17
  26. data/grammars/source.hsig.json +1376 -0
  27. data/grammars/source.httpspec.json +128 -128
  28. data/grammars/source.jison.json +6 -14
  29. data/grammars/source.jisonlex.json +1 -9
  30. data/grammars/source.js.json +1 -0
  31. data/grammars/source.js.regexp.json +0 -4
  32. data/grammars/source.js.regexp.replacement.json +0 -4
  33. data/grammars/source.jsdoc.json +3 -3
  34. data/grammars/source.lsl.json +146 -53
  35. data/grammars/source.mercury.json +166 -166
  36. data/grammars/source.ne.json +108 -0
  37. data/grammars/source.nim_filter.json +51 -51
  38. data/grammars/source.nut.json +266 -0
  39. data/grammars/source.opal.json +112 -112
  40. data/grammars/source.opalsysdefs.json +16 -16
  41. data/grammars/source.pan.json +1 -1
  42. data/grammars/source.papyrus.skyrim.json +720 -720
  43. data/grammars/source.pawn.json +2 -2
  44. data/grammars/source.prolog.eclipse.json +42 -42
  45. data/grammars/source.prolog.json +41 -41
  46. data/grammars/source.purescript.json +41 -25
  47. data/grammars/source.python.json +47 -34
  48. data/grammars/source.racket.json +54 -54
  49. data/grammars/source.reason.json +37 -3
  50. data/grammars/source.regexp.python.json +31 -0
  51. data/grammars/source.ruby.gemfile.json +27 -0
  52. data/grammars/source.ruby.json +1057 -356
  53. data/grammars/source.rust.json +1 -1
  54. data/grammars/source.sbt.json +13 -3
  55. data/grammars/source.scala.json +74 -55
  56. data/grammars/source.shaderlab.json +1 -1
  57. data/grammars/source.shell.json +26 -21
  58. data/grammars/source.shen.json +91 -91
  59. data/grammars/source.sqf.json +1 -1
  60. data/grammars/source.supercollider.json +1 -1
  61. data/grammars/source.swift.json +4 -0
  62. data/grammars/source.terra.json +36 -37
  63. data/grammars/source.terraform.json +98 -98
  64. data/grammars/source.ts.json +2231 -1677
  65. data/grammars/source.tsx.json +142 -3520
  66. data/grammars/source.vbnet.json +201 -263
  67. data/grammars/source.viml.json +2 -2
  68. data/grammars/source.wdl.json +200 -0
  69. data/grammars/source.yaml.json +34 -16
  70. data/grammars/text.find-refs.json +3 -3
  71. data/grammars/text.haml.json +1 -1
  72. data/grammars/text.html.abl.json +6 -6
  73. data/grammars/text.html.erb.json +8 -11
  74. data/grammars/text.html.php.blade.json +256 -220
  75. data/grammars/text.html.vue.json +1 -1
  76. data/grammars/text.slim.json +31 -17
  77. data/grammars/text.tex.latex.haskell.json +150 -33
  78. data/lib/linguist/heuristics.rb +8 -0
  79. data/lib/linguist/languages.json +1 -1
  80. data/lib/linguist/languages.yml +82 -26
  81. data/lib/linguist/samples.json +134512 -132868
  82. data/lib/linguist/vendor.yml +3 -0
  83. data/lib/linguist/version.rb +1 -1
  84. metadata +13 -4
@@ -1,8 +1,9 @@
1
1
  {
2
+ "name": "AWK",
3
+ "scopeName": "source.awk",
2
4
  "fileTypes": [
3
5
  "awk"
4
6
  ],
5
- "name": "AWK",
6
7
  "patterns": [
7
8
  {
8
9
  "include": "#comment"
@@ -15,44 +16,44 @@
15
16
  }
16
17
  ],
17
18
  "repository": {
18
- "builtin-pattern": {
19
- "match": "\\b(BEGINFILE|BEGIN|ENDFILE|END)\\b",
20
- "name": "constant.language.awk"
19
+ "comment": {
20
+ "match": "#.*",
21
+ "name": "comment.line.number-sign.awk"
21
22
  },
22
- "command": {
23
+ "procedure": {
24
+ "begin": "\\{",
25
+ "end": "\\}",
23
26
  "patterns": [
24
27
  {
25
- "match": "\\b(?:next|print|printf)\\b",
26
- "name": "keyword.other.command.awk"
28
+ "include": "#comment"
27
29
  },
28
30
  {
29
- "match": "\\b(?:close|getline|delete|system)\\b",
30
- "name": "keyword.other.command.nawk"
31
+ "include": "#procedure"
31
32
  },
32
33
  {
33
- "match": "\\b(?:fflush|nextfile)\\b",
34
- "name": "keyword.other.command.bell-awk"
34
+ "include": "#keyword"
35
+ },
36
+ {
37
+ "include": "#expression"
35
38
  }
36
39
  ]
37
40
  },
38
- "comment": {
39
- "match": "#.*",
40
- "name": "comment.line.number-sign.awk"
41
- },
42
- "constant": {
41
+ "pattern": {
43
42
  "patterns": [
44
43
  {
45
- "include": "#numeric-constant"
44
+ "include": "#regexp-as-pattern"
46
45
  },
47
46
  {
48
- "include": "#string-constant"
47
+ "include": "#function-definition"
48
+ },
49
+ {
50
+ "include": "#builtin-pattern"
51
+ },
52
+ {
53
+ "include": "#expression"
49
54
  }
50
55
  ]
51
56
  },
52
- "escaped-char": {
53
- "match": "\\\\(?:[\\\\abfnrtv/\"]|x[0-9A-Fa-f]{2}|[0-7]{3})",
54
- "name": "constant.character.escape.awk"
55
- },
56
57
  "expression": {
57
58
  "patterns": [
58
59
  {
@@ -78,22 +79,26 @@
78
79
  }
79
80
  ]
80
81
  },
81
- "function": {
82
+ "groupings": {
82
83
  "patterns": [
83
84
  {
84
- "match": "\\b(?:exp|int|log|sqrt|index|length|split|sprintf|substr)\\b",
85
- "name": "support.function.awk"
85
+ "match": "\\(",
86
+ "name": "meta.brace.round.awk"
86
87
  },
87
88
  {
88
- "match": "\\b(?:atan2|cos|rand|sin|srand|gsub|match|sub|tolower|toupper)\\b",
89
- "name": "support.function.nawk"
89
+ "match": "\\)",
90
+ "name": "meta.brace.round.awk"
90
91
  },
91
92
  {
92
- "match": "\\b(?:gensub|strftime|systime)\\b",
93
- "name": "support.function.gawk"
93
+ "match": "\\,",
94
+ "name": "punctuation.separator.parameters.awk"
94
95
  }
95
96
  ]
96
97
  },
98
+ "builtin-pattern": {
99
+ "match": "\\b(BEGINFILE|BEGIN|ENDFILE|END)\\b",
100
+ "name": "constant.language.awk"
101
+ },
97
102
  "function-definition": {
98
103
  "begin": "\\b(function)\\s+(\\w+)(\\()",
99
104
  "beginCaptures": {
@@ -124,93 +129,77 @@
124
129
  }
125
130
  ]
126
131
  },
127
- "groupings": {
132
+ "constant": {
128
133
  "patterns": [
129
134
  {
130
- "match": "\\(",
131
- "name": "meta.brace.round.awk"
132
- },
133
- {
134
- "match": "\\)",
135
- "name": "meta.brace.round.awk"
135
+ "include": "#numeric-constant"
136
136
  },
137
137
  {
138
- "match": "\\,",
139
- "name": "punctuation.separator.parameters.awk"
138
+ "include": "#string-constant"
140
139
  }
141
140
  ]
142
141
  },
143
- "keyword": {
144
- "match": "\\b(?:break|continue|do|while|exit|for|if|else|return)\\b",
145
- "name": "keyword.control.awk"
146
- },
147
142
  "numeric-constant": {
148
143
  "match": "\\b[0-9]+(?:\\.[0-9]+)?(?:e[+-][0-9]+)?\\b",
149
144
  "name": "constant.numeric.awk"
150
145
  },
151
- "operator": {
146
+ "string-constant": {
147
+ "begin": "\"",
148
+ "beginCaptures": {
149
+ "0": {
150
+ "name": "punctuation.definition.string.begin.awk"
151
+ }
152
+ },
153
+ "end": "\"",
154
+ "endCaptures": {
155
+ "0": {
156
+ "name": "punctuation.definition.string.end.awk"
157
+ }
158
+ },
159
+ "name": "string.quoted.double.awk",
152
160
  "patterns": [
153
161
  {
154
- "match": "(!?~|[=<>!]=|[<>])",
155
- "name": "keyword.operator.comparison.awk"
156
- },
157
- {
158
- "match": "\\b(in)\\b",
159
- "name": "keyword.operator.comparison.awk"
160
- },
161
- {
162
- "match": "([+\\-*/%^]=|\\+\\+|--|>>|=)",
163
- "name": "keyword.operator.assignment.awk"
164
- },
165
- {
166
- "match": "(\\|\\||&&|!)",
167
- "name": "keyword.operator.boolean.awk"
168
- },
169
- {
170
- "match": "([+\\-*/%^])",
171
- "name": "keyword.operator.arithmetic.awk"
172
- },
173
- {
174
- "match": "([?:])",
175
- "name": "keyword.operator.trinary.awk"
176
- },
177
- {
178
- "match": "(\\[|\\])",
179
- "name": "keyword.operator.index.awk"
162
+ "include": "#escaped-char"
180
163
  }
181
164
  ]
182
165
  },
183
- "pattern": {
166
+ "escaped-char": {
167
+ "match": "\\\\(?:[\\\\abfnrtv/\"]|x[0-9A-Fa-f]{2}|[0-7]{3})",
168
+ "name": "constant.character.escape.awk"
169
+ },
170
+ "regexp-as-pattern": {
171
+ "begin": "/",
172
+ "beginCaptures": {
173
+ "0": {
174
+ "name": "punctuation.definition.regex.begin.awk"
175
+ }
176
+ },
177
+ "end": "/",
178
+ "endCaptures": {
179
+ "0": {
180
+ "name": "punctuation.definition.regex.end.awk"
181
+ }
182
+ },
183
+ "contentName": "string.regexp",
184
184
  "patterns": [
185
185
  {
186
- "include": "#regexp-as-pattern"
187
- },
188
- {
189
- "include": "#function-definition"
190
- },
191
- {
192
- "include": "#builtin-pattern"
193
- },
194
- {
195
- "include": "#expression"
186
+ "include": "source.regexp"
196
187
  }
197
188
  ]
198
189
  },
199
- "procedure": {
200
- "begin": "\\{",
201
- "end": "\\}",
190
+ "regexp-in-expression": {
202
191
  "patterns": [
203
192
  {
204
- "include": "#comment"
193
+ "include": "#regex-as-assignment"
205
194
  },
206
195
  {
207
- "include": "#procedure"
196
+ "include": "#regex-as-comparison"
208
197
  },
209
198
  {
210
- "include": "#keyword"
199
+ "include": "#regex-as-first-argument"
211
200
  },
212
201
  {
213
- "include": "#expression"
202
+ "include": "#regex-as-nth-argument"
214
203
  }
215
204
  ]
216
205
  },
@@ -224,13 +213,13 @@
224
213
  "name": "punctuation.definition.regex.begin.awk"
225
214
  }
226
215
  },
227
- "contentName": "string.regexp",
228
216
  "end": "/",
229
217
  "endCaptures": {
230
218
  "0": {
231
219
  "name": "punctuation.definition.regex.end.awk"
232
220
  }
233
221
  },
222
+ "contentName": "string.regexp",
234
223
  "patterns": [
235
224
  {
236
225
  "include": "source.regexp"
@@ -247,13 +236,13 @@
247
236
  "name": "punctuation.definition.regex.begin.awk"
248
237
  }
249
238
  },
250
- "contentName": "string.regexp",
251
239
  "end": "/",
252
240
  "endCaptures": {
253
241
  "0": {
254
242
  "name": "punctuation.definition.regex.end.awk"
255
243
  }
256
244
  },
245
+ "contentName": "string.regexp",
257
246
  "patterns": [
258
247
  {
259
248
  "include": "source.regexp"
@@ -270,13 +259,13 @@
270
259
  "name": "punctuation.definition.regex.begin.awk"
271
260
  }
272
261
  },
273
- "contentName": "string.regexp",
274
262
  "end": "/",
275
263
  "endCaptures": {
276
264
  "0": {
277
265
  "name": "punctuation.definition.regex.end.awk"
278
266
  }
279
267
  },
268
+ "contentName": "string.regexp",
280
269
  "patterns": [
281
270
  {
282
271
  "include": "source.regexp"
@@ -293,96 +282,107 @@
293
282
  "name": "punctuation.definition.regex.begin.awk"
294
283
  }
295
284
  },
296
- "contentName": "string.regexp",
297
285
  "end": "/",
298
286
  "endCaptures": {
299
287
  "0": {
300
288
  "name": "punctuation.definition.regex.end.awk"
301
289
  }
302
290
  },
291
+ "contentName": "string.regexp",
303
292
  "patterns": [
304
293
  {
305
294
  "include": "source.regexp"
306
295
  }
307
296
  ]
308
297
  },
309
- "regexp-as-pattern": {
310
- "begin": "/",
311
- "beginCaptures": {
312
- "0": {
313
- "name": "punctuation.definition.regex.begin.awk"
314
- }
315
- },
316
- "contentName": "string.regexp",
317
- "end": "/",
318
- "endCaptures": {
319
- "0": {
320
- "name": "punctuation.definition.regex.end.awk"
321
- }
322
- },
298
+ "variable": {
323
299
  "patterns": [
324
300
  {
325
- "include": "source.regexp"
301
+ "match": "\\$[0-9]+",
302
+ "name": "variable.language.awk"
303
+ },
304
+ {
305
+ "match": "\\b(?:FILENAME|FS|NF|NR|OFMT|OFS|ORS|RS)\\b",
306
+ "name": "variable.language.awk"
307
+ },
308
+ {
309
+ "match": "\\b(?:ARGC|ARGV|CONVFMT|ENVIRON|FNR|RLENGTH|RSTART|SUBSEP)\\b",
310
+ "name": "variable.language.nawk"
311
+ },
312
+ {
313
+ "match": "\\b(?:ARGIND|ERRNO|FIELDWIDTHS|IGNORECASE|RT)\\b",
314
+ "name": "variable.language.gawk"
326
315
  }
327
316
  ]
328
317
  },
329
- "regexp-in-expression": {
318
+ "keyword": {
319
+ "match": "\\b(?:break|continue|do|while|exit|for|if|else|return)\\b",
320
+ "name": "keyword.control.awk"
321
+ },
322
+ "command": {
330
323
  "patterns": [
331
324
  {
332
- "include": "#regex-as-assignment"
333
- },
334
- {
335
- "include": "#regex-as-comparison"
325
+ "match": "\\b(?:next|print|printf)\\b",
326
+ "name": "keyword.other.command.awk"
336
327
  },
337
328
  {
338
- "include": "#regex-as-first-argument"
329
+ "match": "\\b(?:close|getline|delete|system)\\b",
330
+ "name": "keyword.other.command.nawk"
339
331
  },
340
332
  {
341
- "include": "#regex-as-nth-argument"
333
+ "match": "\\b(?:fflush|nextfile)\\b",
334
+ "name": "keyword.other.command.bell-awk"
342
335
  }
343
336
  ]
344
337
  },
345
- "string-constant": {
346
- "begin": "\"",
347
- "beginCaptures": {
348
- "0": {
349
- "name": "punctuation.definition.string.begin.awk"
350
- }
351
- },
352
- "end": "\"",
353
- "endCaptures": {
354
- "0": {
355
- "name": "punctuation.definition.string.end.awk"
356
- }
357
- },
358
- "name": "string.quoted.double.awk",
338
+ "function": {
359
339
  "patterns": [
360
340
  {
361
- "include": "#escaped-char"
341
+ "match": "\\b(?:exp|int|log|sqrt|index|length|split|sprintf|substr)\\b",
342
+ "name": "support.function.awk"
343
+ },
344
+ {
345
+ "match": "\\b(?:atan2|cos|rand|sin|srand|gsub|match|sub|tolower|toupper)\\b",
346
+ "name": "support.function.nawk"
347
+ },
348
+ {
349
+ "match": "\\b(?:gensub|strftime|systime)\\b",
350
+ "name": "support.function.gawk"
362
351
  }
363
352
  ]
364
353
  },
365
- "variable": {
354
+ "operator": {
366
355
  "patterns": [
367
356
  {
368
- "match": "\\$[0-9]+",
369
- "name": "variable.language.awk"
357
+ "match": "(!?~|[=<>!]=|[<>])",
358
+ "name": "keyword.operator.comparison.awk"
370
359
  },
371
360
  {
372
- "match": "\\b(?:FILENAME|FS|NF|NR|OFMT|OFS|ORS|RS)\\b",
373
- "name": "variable.language.awk"
361
+ "match": "\\b(in)\\b",
362
+ "name": "keyword.operator.comparison.awk"
374
363
  },
375
364
  {
376
- "match": "\\b(?:ARGC|ARGV|CONVFMT|ENVIRON|FNR|RLENGTH|RSTART|SUBSEP)\\b",
377
- "name": "variable.language.nawk"
365
+ "match": "([+\\-*/%^]=|\\+\\+|--|>>|=)",
366
+ "name": "keyword.operator.assignment.awk"
378
367
  },
379
368
  {
380
- "match": "\\b(?:ARGIND|ERRNO|FIELDWIDTHS|IGNORECASE|RT)\\b",
381
- "name": "variable.language.gawk"
369
+ "match": "(\\|\\||&&|!)",
370
+ "name": "keyword.operator.boolean.awk"
371
+ },
372
+ {
373
+ "match": "([+\\-*/%^])",
374
+ "name": "keyword.operator.arithmetic.awk"
375
+ },
376
+ {
377
+ "match": "([?:])",
378
+ "name": "keyword.operator.trinary.awk"
379
+ },
380
+ {
381
+ "match": "(\\[|\\])",
382
+ "name": "keyword.operator.index.awk"
382
383
  }
383
384
  ]
384
385
  }
385
386
  },
386
- "scopeName": "source.awk",
387
387
  "uuid": "67bd1ff0-006b-4c32-8b97-8bc198777582"
388
388
  }
@@ -0,0 +1,434 @@
1
+ {
2
+ "fileTypes": [
3
+ "bal"
4
+ ],
5
+ "foldingStartMarker": "(\\{\\s*(//.*)?$|^\\s*// \\{\\{\\{)",
6
+ "foldingStopMarker": "^\\s*(\\}|// \\}\\}\\}$)",
7
+ "name": "Ballerina",
8
+ "patterns": [
9
+ {
10
+ "captures": {
11
+ "1": {
12
+ "name": "keyword.other.package.ballerina"
13
+ },
14
+ "2": {
15
+ "name": "storage.modifier.package.ballerina"
16
+ },
17
+ "3": {
18
+ "name": "punctuation.terminator.ballerina"
19
+ }
20
+ },
21
+ "match": "^\\s*(package)\\b(?:\\s*([^ ;$]+)\\s*(;)?)?",
22
+ "name": "meta.package.ballerina"
23
+ },
24
+ {
25
+ "captures": {
26
+ "1": {
27
+ "name": "keyword.other.import.ballerina"
28
+ },
29
+ "2": {
30
+ "name": "storage.modifier.import.ballerina"
31
+ },
32
+ "3": {
33
+ "name": "punctuation.terminator.ballerina"
34
+ }
35
+ },
36
+ "match": "^\\s*(import)\\b(?:\\s*([^ ;$]+)\\s*(;)?)?",
37
+ "name": "meta.import.ballerina"
38
+ },
39
+ {
40
+ "include": "#code"
41
+ }
42
+ ],
43
+ "repository": {
44
+ "annotations": {
45
+ "patterns": [
46
+ {
47
+ "begin": "(@[^(]+)(\\()",
48
+ "beginCaptures": {
49
+ "1": {
50
+ "name": "storage.type.annotation.ballerina"
51
+ },
52
+ "2": {
53
+ "name": "punctuation.definition.annotation-arguments.begin.ballerina"
54
+ }
55
+ },
56
+ "end": "(\\))",
57
+ "endCaptures": {
58
+ "1": {
59
+ "name": "punctuation.definition.annotation-arguments.end.ballerina"
60
+ }
61
+ },
62
+ "name": "meta.declaration.annotation.ballerina",
63
+ "patterns": [
64
+ {
65
+ "captures": {
66
+ "1": {
67
+ "name": "constant.other.key.ballerina"
68
+ },
69
+ "2": {
70
+ "name": "keyword.operator.assignment.ballerina"
71
+ }
72
+ },
73
+ "match": "(\\w*)\\s*(=)"
74
+ },
75
+ {
76
+ "include": "#code"
77
+ },
78
+ {
79
+ "match": ",",
80
+ "name": "punctuation.seperator.property.ballerina"
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "match": "@\\w*",
86
+ "name": "storage.type.annotation.ballerina"
87
+ }
88
+ ]
89
+ },
90
+ "all-types": {
91
+ "patterns": [
92
+ {
93
+ "include": "#primitive-arrays"
94
+ },
95
+ {
96
+ "include": "#primitive-types"
97
+ },
98
+ {
99
+ "include": "#reference-types"
100
+ }
101
+ ]
102
+ },
103
+ "comments-inline": {
104
+ "patterns": [
105
+ {
106
+ "begin": "/\\*",
107
+ "captures": {
108
+ "0": {
109
+ "name": "punctuation.definition.comment.ballerina"
110
+ }
111
+ },
112
+ "end": "\\*/",
113
+ "name": "comment.block.ballerina"
114
+ },
115
+ {
116
+ "captures": {
117
+ "1": {
118
+ "name": "comment.line.double-slash.ballerina"
119
+ },
120
+ "2": {
121
+ "name": "punctuation.definition.comment.ballerina"
122
+ }
123
+ },
124
+ "match": "\\s*((//).*$\\n?)"
125
+ }
126
+ ]
127
+ },
128
+ "strings": {
129
+ "patterns": [
130
+ {
131
+ "begin": "\"",
132
+ "beginCaptures": {
133
+ "0": {
134
+ "name": "punctuation.definition.string.begin.ballerina"
135
+ }
136
+ },
137
+ "end": "\"",
138
+ "endCaptures": {
139
+ "0": {
140
+ "name": "punctuation.definition.string.end.ballerina"
141
+ }
142
+ },
143
+ "name": "string.quoted.double.ballerina",
144
+ "patterns": [
145
+ {
146
+ "match": "\\\\.",
147
+ "name": "constant.character.escape.ballerina"
148
+ }
149
+ ]
150
+ },
151
+ {
152
+ "begin": "'",
153
+ "beginCaptures": {
154
+ "0": {
155
+ "name": "punctuation.definition.string.begin.ballerina"
156
+ }
157
+ },
158
+ "end": "'",
159
+ "endCaptures": {
160
+ "0": {
161
+ "name": "punctuation.definition.string.end.ballerina"
162
+ }
163
+ },
164
+ "name": "string.quoted.single.ballerina",
165
+ "patterns": [
166
+ {
167
+ "match": "\\\\.",
168
+ "name": "constant.character.escape.ballerina"
169
+ }
170
+ ]
171
+ }
172
+ ]
173
+ },
174
+ "keywords": {
175
+ "patterns": [
176
+ {
177
+ "match": "\\b(const)\\b",
178
+ "name": "keyword.constant.ballerina"
179
+ },
180
+ {
181
+ "match": "\\b(try|catch|throw)\\b",
182
+ "name": "keyword.control.catch-exception.ballerina"
183
+ },
184
+ {
185
+ "match": "\\?|:",
186
+ "name": "keyword.control.ballerina"
187
+ },
188
+ {
189
+ "match": "\\b(return|reply|break|while|iterate|if|else|fork|join|timeout)\\b",
190
+ "name": "keyword.control.ballerina"
191
+ },
192
+ {
193
+ "match": "(==|!=|<=|>=|<>|<|>)",
194
+ "name": "keyword.operator.comparison.ballerina"
195
+ },
196
+ {
197
+ "match": "(=)",
198
+ "name": "keyword.operator.assignment.ballerina"
199
+ },
200
+ {
201
+ "match": "(\\-\\-|\\+\\+)",
202
+ "name": "keyword.operator.increment-decrement.ballerina"
203
+ },
204
+ {
205
+ "match": "(\\-|\\+|\\*|\\/|%)",
206
+ "name": "keyword.operator.arithmetic.ballerina"
207
+ },
208
+ {
209
+ "match": "(!|&&|\\|\\|)",
210
+ "name": "keyword.operator.logical.ballerina"
211
+ },
212
+ {
213
+ "match": "(?<=\\S)\\.(?=\\S)",
214
+ "name": "keyword.operator.dereference.ballerina"
215
+ },
216
+ {
217
+ "match": ";",
218
+ "name": "punctuation.terminator.ballerina"
219
+ }
220
+ ]
221
+ },
222
+ "methods": {
223
+ "begin": "(?=\\w.*\\s+)(?=[^=]+\\()",
224
+ "end": "}|(?=;)",
225
+ "name": "meta.method.ballerina",
226
+ "patterns": [
227
+ {
228
+ "include": "#storage-modifiers"
229
+ },
230
+ {
231
+ "begin": "(\\w+)\\s*\\(",
232
+ "beginCaptures": {
233
+ "1": {
234
+ "name": "entity.name.function.ballerina"
235
+ }
236
+ },
237
+ "end": "\\)",
238
+ "name": "meta.method.identifier.ballerina",
239
+ "patterns": [
240
+ {
241
+ "include": "#parameters"
242
+ }
243
+ ]
244
+ }
245
+ ]
246
+ },
247
+ "anonymous-create": {
248
+ "begin": "\\bcreate\\b",
249
+ "beginCaptures": {
250
+ "0": {
251
+ "name": "keyword.control.new.ballerina"
252
+ }
253
+ },
254
+ "end": "(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)",
255
+ "patterns": [
256
+ {
257
+ "begin": "(\\w+)\\s*(?=\\[)",
258
+ "beginCaptures": {
259
+ "1": {
260
+ "name": "storage.type.ballerina"
261
+ }
262
+ },
263
+ "end": "}|(?=;|\\))",
264
+ "patterns": [
265
+ {
266
+ "begin": "\\[",
267
+ "end": "\\]",
268
+ "patterns": [
269
+ {
270
+ "include": "#code"
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ "begin": "{",
276
+ "end": "(?=})",
277
+ "patterns": [
278
+ {
279
+ "include": "#code"
280
+ }
281
+ ]
282
+ }
283
+ ]
284
+ },
285
+ {
286
+ "begin": "(?=\\w.*\\()",
287
+ "end": "(?<=\\))",
288
+ "patterns": [
289
+ {
290
+ "begin": "\\(",
291
+ "beginCaptures": {
292
+ "1": {
293
+ "name": "storage.type.ballerina"
294
+ }
295
+ },
296
+ "end": "\\)",
297
+ "patterns": [
298
+ {
299
+ "include": "#code"
300
+ }
301
+ ]
302
+ }
303
+ ]
304
+ },
305
+ {
306
+ "begin": "{",
307
+ "end": "}",
308
+ "name": "meta.inner-service.ballerina",
309
+ "patterns": [
310
+ {
311
+ "include": "#service-declaration"
312
+ }
313
+ ]
314
+ }
315
+ ]
316
+ },
317
+ "service": {
318
+ "begin": "(?=\\w?[\\w\\s]*(?:service|(?:@)?resource|function|connector|action|worker)\\s+\\w+)",
319
+ "end": "}",
320
+ "endCaptures": {
321
+ "0": {
322
+ "name": "punctuation.section.service.end.ballerina"
323
+ }
324
+ },
325
+ "name": "meta.service.ballerina",
326
+ "patterns": [
327
+ {
328
+ "include": "#storage-modifiers"
329
+ },
330
+ {
331
+ "include": "#comments-inline"
332
+ },
333
+ {
334
+ "captures": {
335
+ "1": {
336
+ "name": "storage.modifier.ballerina"
337
+ },
338
+ "2": {
339
+ "name": "entity.name.type.service.ballerina"
340
+ }
341
+ },
342
+ "match": "(\\bservice|(?:@)?\\bresource|\\bfunction|\\bconnector|\\baction|\\bworker)\\s+(\\w+)",
343
+ "name": "meta.service.identifier.ballerina"
344
+ },
345
+ {
346
+ "begin": "{",
347
+ "end": "(?=})",
348
+ "name": "meta.service.body.ballerina",
349
+ "patterns": [
350
+ {
351
+ "include": "#service-declaration"
352
+ }
353
+ ]
354
+ }
355
+ ]
356
+ },
357
+ "service-declaration": {
358
+ "patterns": [
359
+ {
360
+ "include": "#comments-inline"
361
+ },
362
+ {
363
+ "include": "#service"
364
+ },
365
+ {
366
+ "include": "#methods"
367
+ },
368
+ {
369
+ "include": "#annotations"
370
+ },
371
+ {
372
+ "include": "#storage-modifiers"
373
+ },
374
+ {
375
+ "include": "#code"
376
+ }
377
+ ]
378
+ },
379
+ "code": {
380
+ "patterns": [
381
+ {
382
+ "include": "#comments-inline"
383
+ },
384
+ {
385
+ "include": "#service"
386
+ },
387
+ {
388
+ "include": "#anonymous-create"
389
+ },
390
+ {
391
+ "include": "#keywords"
392
+ },
393
+ {
394
+ "include": "#strings"
395
+ },
396
+ {
397
+ "include": "#annotations"
398
+ },
399
+ {
400
+ "include": "#all-types"
401
+ },
402
+ {
403
+ "include": "#methods"
404
+ }
405
+ ]
406
+ },
407
+ "primitive-arrays": {
408
+ "patterns": [
409
+ {
410
+ "match": "\\b(?:string|int)(\\[\\])*\\b",
411
+ "name": "storage.type.primitive.array.ballerina"
412
+ }
413
+ ]
414
+ },
415
+ "primitive-types": {
416
+ "patterns": [
417
+ {
418
+ "match": "\\b(?:boolean|int|float|long|double|string)\\b",
419
+ "name": "storage.type.primitive.ballerina"
420
+ }
421
+ ]
422
+ },
423
+ "reference-types": {
424
+ "patterns": [
425
+ {
426
+ "match": "\\b(?:message|map|exception|xml|xmldocument|json|struct|array)\\b",
427
+ "name": "storage.type.primitive.ballerina"
428
+ }
429
+ ]
430
+ }
431
+ },
432
+ "scopeName": "source.ballerina",
433
+ "uuid": "c01f5512-489a-41bd-ba5d-caf4b55ae3b3"
434
+ }