| 1 |
{ |
| 2 |
"name": "ballerina", |
| 3 |
"scopeName": "source.ballerina", |
| 4 |
"fileTypes": ["bal"], |
| 5 |
"uuid": "c01f5512-489a-41bd-ba5d-caf4b55ae3b3", |
| 6 |
"monarchVariables": { |
| 7 |
"typeScope": "type", |
| 8 |
"annotationScope": "type", |
| 9 |
"numberScope": "number", |
| 10 |
"xmlTagAngle": "tag", |
| 11 |
"xmlAttribute": "variable.parameter", |
| 12 |
"xmlTag": "tag", |
| 13 |
"primitiveScope": "type" |
| 14 |
}, |
| 15 |
"tmlVariables": { |
| 16 |
"typeScope": "storage.type.ballerina", |
| 17 |
"annotationScope": "support.type.ballerina", |
| 18 |
"numberScope": "constant.numeric.decimal.ballerina", |
| 19 |
"xmlTagAngle": "punctuation.definition.tag.begin.xml.ballerina", |
| 20 |
"xmlAttribute": "entity.other.attribute-name.xml.ballerina", |
| 21 |
"xmlTag": "entity.name.tag.xml.ballerina", |
| 22 |
"primitiveScope": "support.type.primitive.ballerina" |
| 23 |
}, |
| 24 |
"patterns": [ |
| 25 |
{ |
| 26 |
"include": "#statements" |
| 27 |
} |
| 28 |
], |
| 29 |
"repository": { |
| 30 |
"statements": { |
| 31 |
"patterns": [ |
| 32 |
{ |
| 33 |
"include": "#stringTemplate" |
| 34 |
}, |
| 35 |
{ |
| 36 |
"include": "#declaration" |
| 37 |
}, |
| 38 |
{ |
| 39 |
"include": "#control-statement" |
| 40 |
}, |
| 41 |
{ |
| 42 |
"include": "#decl-block" |
| 43 |
}, |
| 44 |
{ |
| 45 |
"include": "#expression" |
| 46 |
}, |
| 47 |
{ |
| 48 |
"include": "#punctuation-semicolon" |
| 49 |
}, |
| 50 |
{ |
| 51 |
"include": "#string" |
| 52 |
}, |
| 53 |
{ |
| 54 |
"include": "#comment" |
| 55 |
}, |
| 56 |
{ |
| 57 |
"include": "#mdDocumentation" |
| 58 |
}, |
| 59 |
{ |
| 60 |
"include": "#keywords" |
| 61 |
}, |
| 62 |
{ |
| 63 |
"include": "#annotationAttachment" |
| 64 |
}, |
| 65 |
{ |
| 66 |
"include": "#regex" |
| 67 |
} |
| 68 |
] |
| 69 |
}, |
| 70 |
"declaration": { |
| 71 |
"patterns": [ |
| 72 |
{ |
| 73 |
"include": "#import-declaration" |
| 74 |
}, |
| 75 |
{ |
| 76 |
"include": "#var-expr" |
| 77 |
}, |
| 78 |
{ |
| 79 |
"include": "#typeDefinition" |
| 80 |
}, |
| 81 |
{ |
| 82 |
"include": "#function-defn" |
| 83 |
}, |
| 84 |
{ |
| 85 |
"include": "#service-decl" |
| 86 |
}, |
| 87 |
{ |
| 88 |
"include": "#class-defn" |
| 89 |
}, |
| 90 |
{ |
| 91 |
"include": "#enum-decl" |
| 92 |
}, |
| 93 |
{ |
| 94 |
"include": "#source" |
| 95 |
}, |
| 96 |
{ |
| 97 |
"include": "#keywords" |
| 98 |
} |
| 99 |
] |
| 100 |
}, |
| 101 |
"control-statement": { |
| 102 |
"patterns": [ |
| 103 |
{ |
| 104 |
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(return)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", |
| 105 |
"beginCaptures": { |
| 106 |
"0": { |
| 107 |
"name": "keyword.control.flow.ballerina" |
| 108 |
} |
| 109 |
}, |
| 110 |
"end": "(?=[;}]|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|service|type|var)\\b))", |
| 111 |
"patterns": [ |
| 112 |
{ |
| 113 |
"include": "#expression" |
| 114 |
} |
| 115 |
] |
| 116 |
}, |
| 117 |
{ |
| 118 |
"include": "#for-loop" |
| 119 |
}, |
| 120 |
{ |
| 121 |
"include": "#if-statement" |
| 122 |
}, |
| 123 |
{ |
| 124 |
"name": "keyword.control.conditional.ballerina", |
| 125 |
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(else|if)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" |
| 126 |
} |
| 127 |
] |
| 128 |
}, |
| 129 |
"expression": { |
| 130 |
"patterns": [ |
| 131 |
{ |
| 132 |
"include": "#keywords" |
| 133 |
}, |
| 134 |
{ |
| 135 |
"include": "#expressionWithoutIdentifiers" |
| 136 |
}, |
| 137 |
{ |
| 138 |
"include": "#identifiers" |
| 139 |
}, |
| 140 |
{ |
| 141 |
"include": "#regex" |
| 142 |
} |
| 143 |
] |
| 144 |
}, |
| 145 |
"expressionWithoutIdentifiers": { |
| 146 |
"patterns": [ |
| 147 |
{ |
| 148 |
"include": "#xml" |
| 149 |
}, |
| 150 |
{ |
| 151 |
"include": "#string" |
| 152 |
}, |
| 153 |
{ |
| 154 |
"include": "#stringTemplate" |
| 155 |
}, |
| 156 |
{ |
| 157 |
"include": "#comment" |
| 158 |
}, |
| 159 |
{ |
| 160 |
"include": "#object-literal" |
| 161 |
}, |
| 162 |
{ |
| 163 |
"include": "#ternary-expression" |
| 164 |
}, |
| 165 |
{ |
| 166 |
"include": "#expression-operators" |
| 167 |
}, |
| 168 |
{ |
| 169 |
"include": "#literal" |
| 170 |
}, |
| 171 |
{ |
| 172 |
"include": "#paranthesised" |
| 173 |
}, |
| 174 |
{ |
| 175 |
"include": "#regex" |
| 176 |
} |
| 177 |
] |
| 178 |
}, |
| 179 |
"object-literal": { |
| 180 |
"name": "meta.objectliteral.ballerina", |
| 181 |
"begin": "\\{", |
| 182 |
"beginCaptures": { |
| 183 |
"0": { |
| 184 |
"name": "punctuation.definition.block.ballerina" |
| 185 |
} |
| 186 |
}, |
| 187 |
"end": "\\}", |
| 188 |
"endCaptures": { |
| 189 |
"0": { |
| 190 |
"name": "punctuation.definition.block.ballerina" |
| 191 |
} |
| 192 |
}, |
| 193 |
"patterns": [ |
| 194 |
{ |
| 195 |
"include": "#object-member" |
| 196 |
}, |
| 197 |
{ |
| 198 |
"include": "#punctuation-comma" |
| 199 |
} |
| 200 |
] |
| 201 |
}, |
| 202 |
"import-declaration": { |
| 203 |
"name": "meta.import.ballerina", |
| 204 |
"begin": "\\bimport\\b", |
| 205 |
"beginCaptures": { |
| 206 |
"0": { |
| 207 |
"name": "keyword.control.import.ballerina" |
| 208 |
} |
| 209 |
}, |
| 210 |
"end": "\\;", |
| 211 |
"endCaptures": { |
| 212 |
"0": { |
| 213 |
"name": "punctuation.terminator.statement.ballerina" |
| 214 |
} |
| 215 |
}, |
| 216 |
"patterns": [ |
| 217 |
{ |
| 218 |
"match": "(\\')([_$[:alpha:]][_$[:alnum:]]*)", |
| 219 |
"name": "variable.other.property.ballerina" |
| 220 |
}, |
| 221 |
{ |
| 222 |
"include": "#keywords" |
| 223 |
}, |
| 224 |
{ |
| 225 |
"include": "#comment" |
| 226 |
}, |
| 227 |
{ |
| 228 |
"include": "#import-clause" |
| 229 |
}, |
| 230 |
{ |
| 231 |
"include": "#punctuation-accessor" |
| 232 |
} |
| 233 |
] |
| 234 |
}, |
| 235 |
"identifiers": { |
| 236 |
"patterns": [ |
| 237 |
{ |
| 238 |
"match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", |
| 239 |
"captures": { |
| 240 |
"1": { |
| 241 |
"name": "punctuation.accessor.ballerina" |
| 242 |
}, |
| 243 |
"2": { |
| 244 |
"name": "punctuation.accessor.optional.ballerina" |
| 245 |
}, |
| 246 |
"3": { |
| 247 |
"name": "entity.name.function.ballerina" |
| 248 |
} |
| 249 |
} |
| 250 |
}, |
| 251 |
{ |
| 252 |
"match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=\\()", |
| 253 |
"captures": { |
| 254 |
"1": { |
| 255 |
"name": "punctuation.accessor.ballerina" |
| 256 |
}, |
| 257 |
"2": { |
| 258 |
"name": "punctuation.accessor.optional.ballerina" |
| 259 |
}, |
| 260 |
"3": { |
| 261 |
"name": "entity.name.function.ballerina" |
| 262 |
} |
| 263 |
} |
| 264 |
}, |
| 265 |
{ |
| 266 |
"match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)", |
| 267 |
"captures": { |
| 268 |
"1": { |
| 269 |
"name": "punctuation.accessor.ballerina" |
| 270 |
}, |
| 271 |
"2": { |
| 272 |
"name": "punctuation.accessor.optional.ballerina" |
| 273 |
}, |
| 274 |
"3": { |
| 275 |
"name": "variable.other.property.ballerina" |
| 276 |
} |
| 277 |
} |
| 278 |
}, |
| 279 |
{ |
| 280 |
"include": "#type-primitive" |
| 281 |
}, |
| 282 |
{ |
| 283 |
"include": "#self-literal" |
| 284 |
}, |
| 285 |
{ |
| 286 |
"name": "keyword.control.ballerina", |
| 287 |
"match": "\\b(check|foreach|if|checkpanic)\\b" |
| 288 |
}, |
| 289 |
{ |
| 290 |
"include": "#call" |
| 291 |
}, |
| 292 |
{ |
| 293 |
"name": "support.type.primitive.ballerina", |
| 294 |
"match": "\\b(var)\\b" |
| 295 |
}, |
| 296 |
{ |
| 297 |
"match": "([_$[:alpha:]][_$[:alnum:]]*)((\\.)([_$[:alpha:]][_$[:alnum:]]*)(\\()(\\)))?", |
| 298 |
"captures": { |
| 299 |
"1": { |
| 300 |
"name": "variable.other.readwrite.ballerina" |
| 301 |
}, |
| 302 |
"3": { |
| 303 |
"name": "punctuation.accessor.ballerina" |
| 304 |
}, |
| 305 |
"4": { |
| 306 |
"name": "entity.name.function.ballerina" |
| 307 |
}, |
| 308 |
"5": { |
| 309 |
"name": "punctuation.definition.parameters.begin.ballerina" |
| 310 |
}, |
| 311 |
"6": { |
| 312 |
"name": "punctuation.definition.parameters.end.ballerina" |
| 313 |
} |
| 314 |
} |
| 315 |
}, |
| 316 |
{ |
| 317 |
"match": "(\\')([_$[:alpha:]][_$[:alnum:]]*)", |
| 318 |
"name": "variable.other.property.ballerina" |
| 319 |
}, |
| 320 |
{ |
| 321 |
"include": "#type-annotation" |
| 322 |
} |
| 323 |
] |
| 324 |
}, |
| 325 |
"object-member": { |
| 326 |
"patterns": [ |
| 327 |
{ |
| 328 |
"include": "#comment" |
| 329 |
}, |
| 330 |
{ |
| 331 |
"include": "#function-defn" |
| 332 |
}, |
| 333 |
{ |
| 334 |
"include": "#literal" |
| 335 |
}, |
| 336 |
{ |
| 337 |
"include": "#keywords" |
| 338 |
}, |
| 339 |
{ |
| 340 |
"include": "#expression" |
| 341 |
}, |
| 342 |
{ |
| 343 |
"name": "meta.object.member.ballerina meta.object-literal.key.ballerina", |
| 344 |
"begin": "(?=\\[)", |
| 345 |
"end": "(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))", |
| 346 |
"patterns": [ |
| 347 |
{ |
| 348 |
"include": "#comment" |
| 349 |
} |
| 350 |
] |
| 351 |
}, |
| 352 |
{ |
| 353 |
"name": "meta.object.member.ballerina meta.object-literal.key.ballerina", |
| 354 |
"begin": "(?=[\\'\\\"\\`])", |
| 355 |
"end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\n*})|(\\s+(as)\\s+))))", |
| 356 |
"patterns": [ |
| 357 |
{ |
| 358 |
"include": "#comment" |
| 359 |
}, |
| 360 |
{ |
| 361 |
"include": "#string" |
| 362 |
} |
| 363 |
] |
| 364 |
}, |
| 365 |
{ |
| 366 |
"name": "meta.object.member.ballerina meta.object-literal.key.ballerina", |
| 367 |
"begin": "(?x)(?=(\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$)))", |
| 368 |
"end": "(?=:)|(?=\\s*([\\(\\<,}])|(\\s+as\\s+))", |
| 369 |
"patterns": [ |
| 370 |
{ |
| 371 |
"include": "#comment" |
| 372 |
}, |
| 373 |
{ |
| 374 |
"include": "#numbers" |
| 375 |
} |
| 376 |
] |
| 377 |
}, |
| 378 |
{ |
| 379 |
"name": "meta.method.declaration.ballerina", |
| 380 |
"begin": "(?<=[\\]\\'\\\"\\`])(?=\\s*[\\(\\<])", |
| 381 |
"end": "(?=\\}|;|,)|(?<=\\})", |
| 382 |
"patterns": [ |
| 383 |
{ |
| 384 |
"include": "#function-body" |
| 385 |
} |
| 386 |
] |
| 387 |
}, |
| 388 |
{ |
| 389 |
"name": "meta.object.member.ballerina", |
| 390 |
"match": "(?![_$[:alpha:]])([[:digit:]]+)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", |
| 391 |
"captures": { |
| 392 |
"0": { |
| 393 |
"name": "meta.object-literal.key.ballerina" |
| 394 |
}, |
| 395 |
"1": { |
| 396 |
"name": "constant.numeric.decimal.ballerina" |
| 397 |
} |
| 398 |
} |
| 399 |
}, |
| 400 |
{ |
| 401 |
"name": "meta.object.member.ballerina", |
| 402 |
"match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", |
| 403 |
"captures": { |
| 404 |
"0": { |
| 405 |
"name": "meta.object-literal.key.ballerina" |
| 406 |
}, |
| 407 |
"1": { |
| 408 |
"name": "entity.name.function.ballerina" |
| 409 |
} |
| 410 |
} |
| 411 |
}, |
| 412 |
{ |
| 413 |
"name": "meta.object.member.ballerina", |
| 414 |
"match": "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", |
| 415 |
"captures": { |
| 416 |
"0": { |
| 417 |
"name": "meta.object-literal.key.ballerina" |
| 418 |
} |
| 419 |
} |
| 420 |
}, |
| 421 |
{ |
| 422 |
"name": "meta.object.member.ballerina", |
| 423 |
"begin": "\\.\\.\\.", |
| 424 |
"beginCaptures": { |
| 425 |
"0": { |
| 426 |
"name": "keyword.operator.spread.ballerina" |
| 427 |
} |
| 428 |
}, |
| 429 |
"end": "(?=,|\\})", |
| 430 |
"patterns": [ |
| 431 |
{ |
| 432 |
"include": "#expression" |
| 433 |
} |
| 434 |
] |
| 435 |
}, |
| 436 |
{ |
| 437 |
"name": "meta.object.member.ballerina", |
| 438 |
"match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)", |
| 439 |
"captures": { |
| 440 |
"1": { |
| 441 |
"name": "variable.other.readwrite.ballerina" |
| 442 |
} |
| 443 |
} |
| 444 |
}, |
| 445 |
{ |
| 446 |
"name": "meta.object.member.ballerina", |
| 447 |
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*([,}]|$))", |
| 448 |
"captures": { |
| 449 |
"1": { |
| 450 |
"name": "keyword.control.as.ballerina" |
| 451 |
}, |
| 452 |
"2": { |
| 453 |
"name": "storage.modifier.ballerina" |
| 454 |
} |
| 455 |
} |
| 456 |
}, |
| 457 |
{ |
| 458 |
"name": "meta.object.member.ballerina", |
| 459 |
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+", |
| 460 |
"beginCaptures": { |
| 461 |
"1": { |
| 462 |
"name": "keyword.control.as.ballerina" |
| 463 |
} |
| 464 |
}, |
| 465 |
"end": "(?=[;),}\\]:?\\-\\+\\>]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+))" |
| 466 |
}, |
| 467 |
{ |
| 468 |
"name": "meta.object.member.ballerina", |
| 469 |
"begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)", |
| 470 |
"end": "(?=,|\\}|$|\\/\\/|\\/\\*)", |
| 471 |
"patterns": [ |
| 472 |
{ |
| 473 |
"include": "#expression" |
| 474 |
} |
| 475 |
] |
| 476 |
} |
| 477 |
] |
| 478 |
}, |
| 479 |
"expression-operators": { |
| 480 |
"patterns": [ |
| 481 |
{ |
| 482 |
"name": "keyword.operator.assignment.compound.ballerina", |
| 483 |
"match": "\\*=|(?<!\\()/=|%=|\\+=|\\-=" |
| 484 |
}, |
| 485 |
{ |
| 486 |
"name": "keyword.operator.assignment.compound.bitwise.ballerina", |
| 487 |
"match": "\\&=|\\^=|<<=|>>=|>>>=|\\|=" |
| 488 |
}, |
| 489 |
{ |
| 490 |
"name": "keyword.operator.bitwise.shift.ballerina", |
| 491 |
"match": "<<|>>>|>>" |
| 492 |
}, |
| 493 |
{ |
| 494 |
"name": "keyword.operator.comparison.ballerina", |
| 495 |
"match": "===|!==|==|!=" |
| 496 |
}, |
| 497 |
{ |
| 498 |
"name": "keyword.operator.relational.ballerina", |
| 499 |
"match": "<=|>=|<>|<|>" |
| 500 |
}, |
| 501 |
{ |
| 502 |
"match": "(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))", |
| 503 |
"captures": { |
| 504 |
"1": { |
| 505 |
"name": "keyword.operator.logical.ballerina" |
| 506 |
}, |
| 507 |
"2": { |
| 508 |
"name": "keyword.operator.assignment.compound.ballerina" |
| 509 |
}, |
| 510 |
"3": { |
| 511 |
"name": "keyword.operator.arithmetic.ballerina" |
| 512 |
} |
| 513 |
} |
| 514 |
}, |
| 515 |
{ |
| 516 |
"name": "keyword.operator.logical.ballerina", |
| 517 |
"match": "\\!|&&|\\|\\||\\?\\?" |
| 518 |
}, |
| 519 |
{ |
| 520 |
"name": "keyword.operator.bitwise.ballerina", |
| 521 |
"match": "\\&|~|\\^|\\|" |
| 522 |
}, |
| 523 |
{ |
| 524 |
"name": "keyword.operator.assignment.ballerina", |
| 525 |
"match": "\\=" |
| 526 |
}, |
| 527 |
{ |
| 528 |
"name": "keyword.operator.decrement.ballerina", |
| 529 |
"match": "--" |
| 530 |
}, |
| 531 |
{ |
| 532 |
"name": "keyword.operator.increment.ballerina", |
| 533 |
"match": "\\+\\+" |
| 534 |
}, |
| 535 |
{ |
| 536 |
"name": "keyword.operator.arithmetic.ballerina", |
| 537 |
"match": "%|\\*|/|-|\\+" |
| 538 |
} |
| 539 |
] |
| 540 |
}, |
| 541 |
"punctuation-comma": { |
| 542 |
"patterns": [ |
| 543 |
{ |
| 544 |
"name": "punctuation.separator.comma.ballerina", |
| 545 |
"match": "," |
| 546 |
} |
| 547 |
] |
| 548 |
}, |
| 549 |
"punctuation-semicolon": { |
| 550 |
"patterns": [ |
| 551 |
{ |
| 552 |
"match": ";", |
| 553 |
"name": "punctuation.terminator.statement.ballerina" |
| 554 |
} |
| 555 |
] |
| 556 |
}, |
| 557 |
"punctuation-accessor": { |
| 558 |
"patterns": [ |
| 559 |
{ |
| 560 |
"match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))", |
| 561 |
"captures": { |
| 562 |
"1": { |
| 563 |
"name": "punctuation.accessor.ballerina" |
| 564 |
}, |
| 565 |
"2": { |
| 566 |
"name": "punctuation.accessor.optional.ballerina" |
| 567 |
} |
| 568 |
} |
| 569 |
} |
| 570 |
] |
| 571 |
}, |
| 572 |
"annotationAttachment": { |
| 573 |
"patterns": [ |
| 574 |
{ |
| 575 |
"match": "(@)((?:[_$[:alpha:]][_$[:alnum:]]*))\\s*(:?)\\s*((?:[_$[:alpha:]][_$[:alnum:]]*)?)", |
| 576 |
"captures": { |
| 577 |
"1": { |
| 578 |
"name": "punctuation.decorator.ballerina" |
| 579 |
}, |
| 580 |
"2": { |
| 581 |
"name": "support.type.ballerina" |
| 582 |
}, |
| 583 |
"3": { |
| 584 |
"name": "punctuation.decorator.ballerina" |
| 585 |
}, |
| 586 |
"4": { |
| 587 |
"name": "support.type.ballerina" |
| 588 |
} |
| 589 |
} |
| 590 |
} |
| 591 |
] |
| 592 |
}, |
| 593 |
"annotationDefinition": { |
| 594 |
"patterns": [ |
| 595 |
{ |
| 596 |
"begin": "\\bannotation\\b", |
| 597 |
"beginCaptures": { |
| 598 |
"0": { |
| 599 |
"name": "keyword.ballerina" |
| 600 |
} |
| 601 |
}, |
| 602 |
"end": ";", |
| 603 |
"patterns": [ |
| 604 |
{ |
| 605 |
"include": "#code" |
| 606 |
} |
| 607 |
] |
| 608 |
} |
| 609 |
] |
| 610 |
}, |
| 611 |
"booleans": { |
| 612 |
"patterns": [ |
| 613 |
{ |
| 614 |
"match": "\\b(true|false)\\b", |
| 615 |
"name": "constant.language.boolean.ballerina" |
| 616 |
} |
| 617 |
] |
| 618 |
}, |
| 619 |
"butExp": { |
| 620 |
"patterns": [ |
| 621 |
{ |
| 622 |
"begin": "\\bbut\\b", |
| 623 |
"beginCaptures": { |
| 624 |
"0": { |
| 625 |
"name": "keyword.ballerina" |
| 626 |
} |
| 627 |
}, |
| 628 |
"end": "\\}", |
| 629 |
"endCaptures": { |
| 630 |
"0": { |
| 631 |
"name": "punctuation.definition.block.ballerina.documentation" |
| 632 |
} |
| 633 |
}, |
| 634 |
"patterns": [ |
| 635 |
{ |
| 636 |
"include": "#butExpBody" |
| 637 |
}, |
| 638 |
{ |
| 639 |
"include": "#comment" |
| 640 |
} |
| 641 |
] |
| 642 |
} |
| 643 |
] |
| 644 |
}, |
| 645 |
"butExpBody": { |
| 646 |
"patterns": [ |
| 647 |
{ |
| 648 |
"begin": "\\{", |
| 649 |
"beginCaptures": { |
| 650 |
"0": { |
| 651 |
"name": "punctuation.definition.block.ballerina.documentation" |
| 652 |
} |
| 653 |
}, |
| 654 |
"end": "(?=\\})", |
| 655 |
"endCaptures": { |
| 656 |
"0": { |
| 657 |
"name": "punctuation.definition.block.ballerina.documentation" |
| 658 |
} |
| 659 |
}, |
| 660 |
"patterns": [ |
| 661 |
{ |
| 662 |
"include": "#parameter" |
| 663 |
}, |
| 664 |
{ |
| 665 |
"include": "#butClause" |
| 666 |
}, |
| 667 |
{ |
| 668 |
"include": "#comment" |
| 669 |
} |
| 670 |
] |
| 671 |
} |
| 672 |
] |
| 673 |
}, |
| 674 |
"butClause": { |
| 675 |
"patterns": [ |
| 676 |
{ |
| 677 |
"begin": "=>", |
| 678 |
"beginCaptures": { |
| 679 |
"0": { |
| 680 |
"name": "meta.arrow.ballerina storage.type.function.arrow.ballerina" |
| 681 |
} |
| 682 |
}, |
| 683 |
"end": ",|(?=\\})", |
| 684 |
"patterns": [ |
| 685 |
{ |
| 686 |
"include": "#code" |
| 687 |
} |
| 688 |
] |
| 689 |
} |
| 690 |
] |
| 691 |
}, |
| 692 |
"call": { |
| 693 |
"patterns": [ |
| 694 |
{ |
| 695 |
"match": "(?:\\')?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=\\()", |
| 696 |
"name": "entity.name.function.ballerina" |
| 697 |
} |
| 698 |
] |
| 699 |
}, |
| 700 |
"comment": { |
| 701 |
"patterns": [ |
| 702 |
{ |
| 703 |
"name": "comment.ballerina", |
| 704 |
"match": "\\/\\/.*" |
| 705 |
} |
| 706 |
] |
| 707 |
}, |
| 708 |
"constrainType": { |
| 709 |
"patterns": [ |
| 710 |
{ |
| 711 |
"begin": "<", |
| 712 |
"end": ">", |
| 713 |
"beginCaptures": { |
| 714 |
"0": { |
| 715 |
"name": "punctuation.definition.parameters.begin.ballerina" |
| 716 |
} |
| 717 |
}, |
| 718 |
"endCaptures": { |
| 719 |
"0": { |
| 720 |
"name": "punctuation.definition.parameters.end.ballerina" |
| 721 |
} |
| 722 |
}, |
| 723 |
"patterns": [ |
| 724 |
{ |
| 725 |
"include": "#comment" |
| 726 |
}, |
| 727 |
{ |
| 728 |
"include": "#constrainType" |
| 729 |
}, |
| 730 |
{ |
| 731 |
"name": "storage.type.ballerina", |
| 732 |
"match": "\\b([_$[:alpha:]][_$[:alnum:]]*)\\b" |
| 733 |
} |
| 734 |
] |
| 735 |
} |
| 736 |
] |
| 737 |
}, |
| 738 |
"tupleType": { |
| 739 |
"patterns": [ |
| 740 |
{ |
| 741 |
"begin": "\\[", |
| 742 |
"end": "(?=\\]|;)", |
| 743 |
"patterns": [ |
| 744 |
{ |
| 745 |
"include": "#comment" |
| 746 |
}, |
| 747 |
{ |
| 748 |
"include": "#constrainType" |
| 749 |
}, |
| 750 |
{ |
| 751 |
"include": "#paranthesisedBracket" |
| 752 |
}, |
| 753 |
{ |
| 754 |
"name": "storage.type.ballerina", |
| 755 |
"match": "\\b([_$[:alpha:]][_$[:alnum:]]*)\\b" |
| 756 |
} |
| 757 |
] |
| 758 |
} |
| 759 |
] |
| 760 |
}, |
| 761 |
"decl-block": { |
| 762 |
"name": "meta.block.ballerina", |
| 763 |
"begin": "\\{", |
| 764 |
"beginCaptures": { |
| 765 |
"0": { |
| 766 |
"name": "punctuation.definition.block.ballerina" |
| 767 |
} |
| 768 |
}, |
| 769 |
"end": "(?=\\} external;)|(\\})", |
| 770 |
"endCaptures": { |
| 771 |
"0": { |
| 772 |
"name": "punctuation.definition.block.ballerina" |
| 773 |
} |
| 774 |
}, |
| 775 |
"patterns": [ |
| 776 |
{ |
| 777 |
"include": "#statements" |
| 778 |
}, |
| 779 |
{ |
| 780 |
"include": "#mdDocumentation" |
| 781 |
} |
| 782 |
] |
| 783 |
}, |
| 784 |
"defaultValue": { |
| 785 |
"patterns": [ |
| 786 |
{ |
| 787 |
"begin": "[=:]", |
| 788 |
"beginCaptures": { |
| 789 |
"0": { |
| 790 |
"name": "keyword.operator.ballerina" |
| 791 |
} |
| 792 |
}, |
| 793 |
"end": "(?=[,)])", |
| 794 |
"patterns": [ |
| 795 |
{ |
| 796 |
"include": "#code" |
| 797 |
} |
| 798 |
] |
| 799 |
} |
| 800 |
] |
| 801 |
}, |
| 802 |
"documentationDef": { |
| 803 |
"patterns": [ |
| 804 |
{ |
| 805 |
"begin": "\\b(?:documentation|deprecated)\\b", |
| 806 |
"beginCaptures": { |
| 807 |
"0": { |
| 808 |
"name": "keyword.ballerina" |
| 809 |
} |
| 810 |
}, |
| 811 |
"end": "\\}", |
| 812 |
"endCaptures": { |
| 813 |
"0": { |
| 814 |
"name": "delimiter.curly" |
| 815 |
} |
| 816 |
}, |
| 817 |
"patterns": [ |
| 818 |
{ |
| 819 |
"include": "#documentationBody" |
| 820 |
}, |
| 821 |
{ |
| 822 |
"include": "#comment" |
| 823 |
} |
| 824 |
] |
| 825 |
} |
| 826 |
] |
| 827 |
}, |
| 828 |
"documentationBody": { |
| 829 |
"patterns": [ |
| 830 |
{ |
| 831 |
"begin": "\\{", |
| 832 |
"beginCaptures": { |
| 833 |
"0": { |
| 834 |
"name": "punctuation.definition.block.ballerina.documentation" |
| 835 |
} |
| 836 |
}, |
| 837 |
"end": "(?=\\})", |
| 838 |
"endCaptures": { |
| 839 |
"0": { |
| 840 |
"name": "punctuation.definition.block.ballerina.documentation" |
| 841 |
} |
| 842 |
}, |
| 843 |
"patterns": [ |
| 844 |
{ |
| 845 |
"match": "(P|R|T|F|V)({{)(.*)(}})", |
| 846 |
"captures": { |
| 847 |
"1": { |
| 848 |
"name": "keyword.other.ballerina.documentation" |
| 849 |
}, |
| 850 |
"2": { |
| 851 |
"name": "keyword.other.ballerina.documentation" |
| 852 |
}, |
| 853 |
"3": { |
| 854 |
"name": "variable.parameter.ballerina.documentation" |
| 855 |
}, |
| 856 |
"4": { |
| 857 |
"name": "keyword.other.ballerina.documentation" |
| 858 |
} |
| 859 |
} |
| 860 |
}, |
| 861 |
{ |
| 862 |
"name": "comment.block.code.ballerina.documentation", |
| 863 |
"begin": "\\```", |
| 864 |
"end": "\\```" |
| 865 |
}, |
| 866 |
{ |
| 867 |
"name": "comment.block.code.ballerina.documentation", |
| 868 |
"begin": "\\``", |
| 869 |
"end": "\\``" |
| 870 |
}, |
| 871 |
{ |
| 872 |
"name": "comment.block.code.ballerina.documentation", |
| 873 |
"begin": "\\`", |
| 874 |
"end": "\\`" |
| 875 |
}, |
| 876 |
{ |
| 877 |
"name": "comment.block.ballerina.documentation", |
| 878 |
"match": "." |
| 879 |
} |
| 880 |
] |
| 881 |
} |
| 882 |
] |
| 883 |
}, |
| 884 |
"enum-decl": { |
| 885 |
"name": "meta.enum.declaration.ballerina", |
| 886 |
"begin": "(?:\\b(const)\\s+)?\\b(enum)\\s+([_$[:alpha:]][_$[:alnum:]]*)", |
| 887 |
"beginCaptures": { |
| 888 |
"1": { |
| 889 |
"name": "storage.modifier.ballerina" |
| 890 |
}, |
| 891 |
"2": { |
| 892 |
"name": "keyword.other.ballerina" |
| 893 |
}, |
| 894 |
"3": { |
| 895 |
"name": "entity.name.type.enum.ballerina" |
| 896 |
} |
| 897 |
}, |
| 898 |
"end": "(?<=\\})", |
| 899 |
"patterns": [ |
| 900 |
{ |
| 901 |
"include": "#comment" |
| 902 |
}, |
| 903 |
{ |
| 904 |
"include": "#mdDocumentation" |
| 905 |
}, |
| 906 |
{ |
| 907 |
"begin": "\\{", |
| 908 |
"beginCaptures": { |
| 909 |
"0": { |
| 910 |
"name": "punctuation.definition.block.ballerina" |
| 911 |
} |
| 912 |
}, |
| 913 |
"end": "\\}", |
| 914 |
"endCaptures": { |
| 915 |
"0": { |
| 916 |
"name": "punctuation.definition.block.ballerina" |
| 917 |
} |
| 918 |
}, |
| 919 |
"patterns": [ |
| 920 |
{ |
| 921 |
"include": "#comment" |
| 922 |
}, |
| 923 |
{ |
| 924 |
"include": "#mdDocumentation" |
| 925 |
}, |
| 926 |
{ |
| 927 |
"begin": "([_$[:alpha:]][_$[:alnum:]]*)", |
| 928 |
"beginCaptures": { |
| 929 |
"0": { |
| 930 |
"name": "variable.other.enummember.ballerina" |
| 931 |
} |
| 932 |
}, |
| 933 |
"end": "(?=,|\\}|$)", |
| 934 |
"patterns": [ |
| 935 |
{ |
| 936 |
"include": "#comment" |
| 937 |
}, |
| 938 |
{ |
| 939 |
"include": "#variable-initializer" |
| 940 |
} |
| 941 |
] |
| 942 |
}, |
| 943 |
{ |
| 944 |
"begin": "(?=((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\])))", |
| 945 |
"end": "(?=,|\\}|$)", |
| 946 |
"patterns": [ |
| 947 |
{ |
| 948 |
"include": "#string" |
| 949 |
}, |
| 950 |
{ |
| 951 |
"include": "#array-literal" |
| 952 |
}, |
| 953 |
{ |
| 954 |
"include": "#comment" |
| 955 |
}, |
| 956 |
{ |
| 957 |
"include": "#variable-initializer" |
| 958 |
} |
| 959 |
] |
| 960 |
}, |
| 961 |
{ |
| 962 |
"include": "#punctuation-comma" |
| 963 |
} |
| 964 |
] |
| 965 |
} |
| 966 |
] |
| 967 |
}, |
| 968 |
"errorDestructure": { |
| 969 |
"patterns": [ |
| 970 |
{ |
| 971 |
"begin": "error", |
| 972 |
"end": "(?==>)", |
| 973 |
"beginCaptures": { |
| 974 |
"0": { |
| 975 |
"name": "storage.type.ballerina" |
| 976 |
} |
| 977 |
}, |
| 978 |
"patterns": [ |
| 979 |
{ |
| 980 |
"include": "#code" |
| 981 |
} |
| 982 |
] |
| 983 |
} |
| 984 |
] |
| 985 |
}, |
| 986 |
"callableUnitBody": { |
| 987 |
"patterns": [ |
| 988 |
{ |
| 989 |
"begin": "\\{", |
| 990 |
"end": "(?=\\})", |
| 991 |
"beginCaptures": { |
| 992 |
"0": { |
| 993 |
"name": "punctuation.definition.block.ballerina" |
| 994 |
} |
| 995 |
}, |
| 996 |
"endCaptures": { |
| 997 |
"0": { |
| 998 |
"name": "punctuation.definition.block.ballerina" |
| 999 |
} |
| 1000 |
}, |
| 1001 |
"patterns": [ |
| 1002 |
{ |
| 1003 |
"include": "#workerDef" |
| 1004 |
}, |
| 1005 |
{ |
| 1006 |
"include": "#service-decl" |
| 1007 |
}, |
| 1008 |
{ |
| 1009 |
"include": "#objectDec" |
| 1010 |
}, |
| 1011 |
{ |
| 1012 |
"include": "#function-defn" |
| 1013 |
}, |
| 1014 |
{ |
| 1015 |
"include": "#forkStatement" |
| 1016 |
}, |
| 1017 |
{ |
| 1018 |
"include": "#code" |
| 1019 |
} |
| 1020 |
] |
| 1021 |
} |
| 1022 |
] |
| 1023 |
}, |
| 1024 |
"for-loop": { |
| 1025 |
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))foreach\\s*", |
| 1026 |
"beginCaptures": { |
| 1027 |
"0": { |
| 1028 |
"name": "keyword.control.loop.ballerina" |
| 1029 |
}, |
| 1030 |
"1": { |
| 1031 |
"name": "support.type.primitive.ballerina" |
| 1032 |
} |
| 1033 |
}, |
| 1034 |
"end": "(?=\\{)", |
| 1035 |
"patterns": [ |
| 1036 |
{ |
| 1037 |
"name": "keyword.other.ballerina", |
| 1038 |
"match": "\\bin\\b" |
| 1039 |
}, |
| 1040 |
{ |
| 1041 |
"include": "#identifiers" |
| 1042 |
}, |
| 1043 |
{ |
| 1044 |
"include": "#comment" |
| 1045 |
}, |
| 1046 |
{ |
| 1047 |
"include": "#var-expr" |
| 1048 |
}, |
| 1049 |
{ |
| 1050 |
"include": "#expression" |
| 1051 |
} |
| 1052 |
] |
| 1053 |
}, |
| 1054 |
"forkBody": { |
| 1055 |
"patterns": [ |
| 1056 |
{ |
| 1057 |
"begin": "\\{", |
| 1058 |
"end": "(?=\\})", |
| 1059 |
"beginCaptures": { |
| 1060 |
"0": { |
| 1061 |
"name": "punctuation.definition.block.ballerina" |
| 1062 |
} |
| 1063 |
}, |
| 1064 |
"patterns": [ |
| 1065 |
{ |
| 1066 |
"include": "#workerDef" |
| 1067 |
} |
| 1068 |
] |
| 1069 |
} |
| 1070 |
] |
| 1071 |
}, |
| 1072 |
"forkStatement": { |
| 1073 |
"patterns": [ |
| 1074 |
{ |
| 1075 |
"begin": "\\bfork\\b", |
| 1076 |
"end": "\\}", |
| 1077 |
"beginCaptures": { |
| 1078 |
"0": { |
| 1079 |
"name": "keyword.control.ballerina" |
| 1080 |
} |
| 1081 |
}, |
| 1082 |
"endCaptures": { |
| 1083 |
"0": { |
| 1084 |
"name": "punctuation.definition.block.ballerina" |
| 1085 |
} |
| 1086 |
}, |
| 1087 |
"patterns": [ |
| 1088 |
{ |
| 1089 |
"include": "#forkBody" |
| 1090 |
} |
| 1091 |
] |
| 1092 |
} |
| 1093 |
] |
| 1094 |
}, |
| 1095 |
"function-body": { |
| 1096 |
"patterns": [ |
| 1097 |
{ |
| 1098 |
"include": "#comment" |
| 1099 |
}, |
| 1100 |
{ |
| 1101 |
"include": "#functionParameters" |
| 1102 |
}, |
| 1103 |
{ |
| 1104 |
"include": "#decl-block" |
| 1105 |
}, |
| 1106 |
{ |
| 1107 |
"begin": "\\=>", |
| 1108 |
"name": "meta.block.ballerina", |
| 1109 |
"beginCaptures": { |
| 1110 |
"0": { |
| 1111 |
"name": "meta.arrow.ballerina storage.type.function.arrow.ballerina" |
| 1112 |
} |
| 1113 |
}, |
| 1114 |
"end": "(?=\\;)|(?=\\,)|(?=)(?=\\);)", |
| 1115 |
"patterns": [ |
| 1116 |
{ |
| 1117 |
"include": "#statements" |
| 1118 |
}, |
| 1119 |
{ |
| 1120 |
"include": "#punctuation-comma" |
| 1121 |
} |
| 1122 |
] |
| 1123 |
}, |
| 1124 |
{ |
| 1125 |
"name": "keyword.generator.asterisk.ballerina", |
| 1126 |
"match": "\\*" |
| 1127 |
} |
| 1128 |
] |
| 1129 |
}, |
| 1130 |
"function-defn": { |
| 1131 |
"name": "meta.function.ballerina", |
| 1132 |
"begin": "(?:(public|private)\\s+)?(function\\b)", |
| 1133 |
"beginCaptures": { |
| 1134 |
"1": { |
| 1135 |
"name": "keyword.other.ballerina" |
| 1136 |
}, |
| 1137 |
"2": { |
| 1138 |
"name": "keyword.other.ballerina" |
| 1139 |
} |
| 1140 |
}, |
| 1141 |
"end": "(?<=\\;)|(?<=\\})|(?<=\\,)|(?=)(?=\\);)", |
| 1142 |
"patterns": [ |
| 1143 |
{ |
| 1144 |
"match": "\\bexternal\\b", |
| 1145 |
"name": "keyword.ballerina" |
| 1146 |
}, |
| 1147 |
{ |
| 1148 |
"include": "#stringTemplate" |
| 1149 |
}, |
| 1150 |
{ |
| 1151 |
"include": "#annotationAttachment" |
| 1152 |
}, |
| 1153 |
{ |
| 1154 |
"include": "#functionReturns" |
| 1155 |
}, |
| 1156 |
{ |
| 1157 |
"include": "#functionName" |
| 1158 |
}, |
| 1159 |
{ |
| 1160 |
"include": "#functionParameters" |
| 1161 |
}, |
| 1162 |
{ |
| 1163 |
"include": "#punctuation-semicolon" |
| 1164 |
}, |
| 1165 |
{ |
| 1166 |
"include": "#function-body" |
| 1167 |
}, |
| 1168 |
{ |
| 1169 |
"include": "#regex" |
| 1170 |
} |
| 1171 |
] |
| 1172 |
}, |
| 1173 |
"functionName": { |
| 1174 |
"patterns": [ |
| 1175 |
{ |
| 1176 |
"name": "keyword.other.ballerina", |
| 1177 |
"match": "\\bfunction\\b" |
| 1178 |
}, |
| 1179 |
{ |
| 1180 |
"include": "#type-primitive" |
| 1181 |
}, |
| 1182 |
{ |
| 1183 |
"include": "#self-literal" |
| 1184 |
}, |
| 1185 |
{ |
| 1186 |
"include": "#string" |
| 1187 |
}, |
| 1188 |
{ |
| 1189 |
"match": "\\s+(\\b(self)|\\b(is|new|isolated|null|function|in)\\b|(string|int|boolean|float|byte|decimal|json|xml|anydata)\\b|\\b(readonly|error|map)\\b|([_$[:alpha:]][_$[:alnum:]]*))", |
| 1190 |
"captures": { |
| 1191 |
"2": { |
| 1192 |
"name": "variable.language.this.ballerina" |
| 1193 |
}, |
| 1194 |
"3": { |
| 1195 |
"name": "keyword.other.ballerina" |
| 1196 |
}, |
| 1197 |
"4": { |
| 1198 |
"name": "support.type.primitive.ballerina" |
| 1199 |
}, |
| 1200 |
"5": { |
| 1201 |
"name": "storage.type.ballerina" |
| 1202 |
}, |
| 1203 |
"6": { |
| 1204 |
"name": "meta.definition.function.ballerina entity.name.function.ballerina" |
| 1205 |
} |
| 1206 |
} |
| 1207 |
} |
| 1208 |
] |
| 1209 |
}, |
| 1210 |
"functionParameters": { |
| 1211 |
"name": "meta.parameters.ballerina", |
| 1212 |
"begin": "\\(|\\[", |
| 1213 |
"end": "\\)|\\]", |
| 1214 |
"beginCaptures": { |
| 1215 |
"0": { |
| 1216 |
"name": "punctuation.definition.parameters.begin.ballerina" |
| 1217 |
} |
| 1218 |
}, |
| 1219 |
"endCaptures": { |
| 1220 |
"0": { |
| 1221 |
"name": "punctuation.definition.parameters.end.ballerina" |
| 1222 |
} |
| 1223 |
}, |
| 1224 |
"patterns": [ |
| 1225 |
{ |
| 1226 |
"include": "#function-parameters-body" |
| 1227 |
} |
| 1228 |
] |
| 1229 |
}, |
| 1230 |
"function-parameters-body": { |
| 1231 |
"patterns": [ |
| 1232 |
{ |
| 1233 |
"include": "#comment" |
| 1234 |
}, |
| 1235 |
{ |
| 1236 |
"include": "#numbers" |
| 1237 |
}, |
| 1238 |
{ |
| 1239 |
"include": "#string" |
| 1240 |
}, |
| 1241 |
{ |
| 1242 |
"include": "#annotationAttachment" |
| 1243 |
}, |
| 1244 |
{ |
| 1245 |
"include": "#recordLiteral" |
| 1246 |
}, |
| 1247 |
{ |
| 1248 |
"include": "#keywords" |
| 1249 |
}, |
| 1250 |
{ |
| 1251 |
"include": "#parameter-name" |
| 1252 |
}, |
| 1253 |
{ |
| 1254 |
"include": "#array-literal" |
| 1255 |
}, |
| 1256 |
{ |
| 1257 |
"include": "#variable-initializer" |
| 1258 |
}, |
| 1259 |
{ |
| 1260 |
"include": "#identifiers" |
| 1261 |
}, |
| 1262 |
{ |
| 1263 |
"include": "#regex" |
| 1264 |
}, |
| 1265 |
{ |
| 1266 |
"name": "punctuation.separator.parameter.ballerina", |
| 1267 |
"match": "\\," |
| 1268 |
} |
| 1269 |
] |
| 1270 |
}, |
| 1271 |
"parameter-name": { |
| 1272 |
"patterns": [ |
| 1273 |
{ |
| 1274 |
"match": "\\s*\\b(var)\\s+", |
| 1275 |
"captures": { |
| 1276 |
"1": { |
| 1277 |
"name": "support.type.primitive.ballerina" |
| 1278 |
} |
| 1279 |
} |
| 1280 |
}, |
| 1281 |
{ |
| 1282 |
"match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|(string|int|boolean|float|byte|decimal|json|xml|anydata)|\\b(is|new|isolated|null|function|in)\\b|\\b(true|false)\\b|\\b(check|foreach|if|checkpanic)\\b|\\b(readonly|error|map)\\b|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)", |
| 1283 |
"captures": { |
| 1284 |
"2": { |
| 1285 |
"name": "keyword.operator.rest.ballerina" |
| 1286 |
}, |
| 1287 |
"3": { |
| 1288 |
"name": "support.type.primitive.ballerina" |
| 1289 |
}, |
| 1290 |
"4": { |
| 1291 |
"name": "keyword.other.ballerina" |
| 1292 |
}, |
| 1293 |
"5": { |
| 1294 |
"name": "constant.language.boolean.ballerina" |
| 1295 |
}, |
| 1296 |
"6": { |
| 1297 |
"name": "keyword.control.flow.ballerina" |
| 1298 |
}, |
| 1299 |
"7": { |
| 1300 |
"name": "storage.type.ballerina" |
| 1301 |
}, |
| 1302 |
"8": { |
| 1303 |
"name": "variable.parameter.ballerina" |
| 1304 |
}, |
| 1305 |
"9": { |
| 1306 |
"name": "variable.parameter.ballerina" |
| 1307 |
}, |
| 1308 |
"10": { |
| 1309 |
"name": "keyword.operator.optional.ballerina" |
| 1310 |
} |
| 1311 |
} |
| 1312 |
} |
| 1313 |
] |
| 1314 |
}, |
| 1315 |
"functionReturns": { |
| 1316 |
"name": "meta.type.function.return.ballerina", |
| 1317 |
"begin": "\\s*(returns)\\s*", |
| 1318 |
"beginCaptures": { |
| 1319 |
"1": { |
| 1320 |
"name": "keyword.other.ballerina" |
| 1321 |
} |
| 1322 |
}, |
| 1323 |
"end": "(?==>)|(\\=)|(?=\\{)|(\\))|(?=\\;)", |
| 1324 |
"endCaptures": { |
| 1325 |
"1": { |
| 1326 |
"name": "keyword.operator.ballerina" |
| 1327 |
} |
| 1328 |
}, |
| 1329 |
"patterns": [ |
| 1330 |
{ |
| 1331 |
"include": "#comment" |
| 1332 |
}, |
| 1333 |
{ |
| 1334 |
"include": "#string" |
| 1335 |
}, |
| 1336 |
{ |
| 1337 |
"include": "#numbers" |
| 1338 |
}, |
| 1339 |
{ |
| 1340 |
"include": "#keywords" |
| 1341 |
}, |
| 1342 |
{ |
| 1343 |
"include": "#type-primitive" |
| 1344 |
}, |
| 1345 |
{ |
| 1346 |
"match": "\\s*\\b(var)(?=\\s+|\\[|\\?)", |
| 1347 |
"captures": { |
| 1348 |
"1": { |
| 1349 |
"name": "support.type.primitive.ballerina" |
| 1350 |
} |
| 1351 |
} |
| 1352 |
}, |
| 1353 |
{ |
| 1354 |
"match": "\\|", |
| 1355 |
"name": "keyword.operator.ballerina" |
| 1356 |
}, |
| 1357 |
{ |
| 1358 |
"match": "\\?", |
| 1359 |
"name": "keyword.operator.optional.ballerina" |
| 1360 |
}, |
| 1361 |
{ |
| 1362 |
"include": "#type-annotation" |
| 1363 |
}, |
| 1364 |
{ |
| 1365 |
"include": "#type-tuple" |
| 1366 |
}, |
| 1367 |
{ |
| 1368 |
"include": "#keywords" |
| 1369 |
}, |
| 1370 |
{ |
| 1371 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 1372 |
"name": "variable.other.readwrite.ballerina" |
| 1373 |
} |
| 1374 |
] |
| 1375 |
}, |
| 1376 |
"functionType": { |
| 1377 |
"patterns": [ |
| 1378 |
{ |
| 1379 |
"begin": "\\bfunction\\b", |
| 1380 |
"beginCaptures": { |
| 1381 |
"0": { |
| 1382 |
"name": "keyword.ballerina" |
| 1383 |
} |
| 1384 |
}, |
| 1385 |
"end": "(?=\\,)|(?=\\|)|(?=\\:)|(?==>)|(?=\\))|(?=\\])", |
| 1386 |
"patterns": [ |
| 1387 |
{ |
| 1388 |
"include": "#comment" |
| 1389 |
}, |
| 1390 |
{ |
| 1391 |
"include": "#functionTypeParamList" |
| 1392 |
}, |
| 1393 |
{ |
| 1394 |
"include": "#functionTypeReturns" |
| 1395 |
} |
| 1396 |
] |
| 1397 |
} |
| 1398 |
] |
| 1399 |
}, |
| 1400 |
"functionTypeParamList": { |
| 1401 |
"patterns": [ |
| 1402 |
{ |
| 1403 |
"begin": "\\(", |
| 1404 |
"end": "\\)", |
| 1405 |
"beginCaptures": { |
| 1406 |
"0": { |
| 1407 |
"name": "delimiter.parenthesis" |
| 1408 |
} |
| 1409 |
}, |
| 1410 |
"endCaptures": { |
| 1411 |
"0": { |
| 1412 |
"name": "delimiter.parenthesis" |
| 1413 |
} |
| 1414 |
}, |
| 1415 |
"patterns": [ |
| 1416 |
{ |
| 1417 |
"match": "public", |
| 1418 |
"name": "keyword" |
| 1419 |
}, |
| 1420 |
{ |
| 1421 |
"include": "#annotationAttachment" |
| 1422 |
}, |
| 1423 |
{ |
| 1424 |
"include": "#recordLiteral" |
| 1425 |
}, |
| 1426 |
{ |
| 1427 |
"include": "#record" |
| 1428 |
}, |
| 1429 |
{ |
| 1430 |
"include": "#objectDec" |
| 1431 |
}, |
| 1432 |
{ |
| 1433 |
"include": "#functionType" |
| 1434 |
}, |
| 1435 |
{ |
| 1436 |
"include": "#constrainType" |
| 1437 |
}, |
| 1438 |
{ |
| 1439 |
"include": "#parameterTuple" |
| 1440 |
}, |
| 1441 |
{ |
| 1442 |
"include": "#functionTypeType" |
| 1443 |
}, |
| 1444 |
{ |
| 1445 |
"include": "#comment" |
| 1446 |
} |
| 1447 |
] |
| 1448 |
} |
| 1449 |
] |
| 1450 |
}, |
| 1451 |
"functionTypeType": { |
| 1452 |
"patterns": [ |
| 1453 |
{ |
| 1454 |
"begin": "[_$[:alpha:]][_$[:alnum:]]*", |
| 1455 |
"beginCaptures": { |
| 1456 |
"0": { |
| 1457 |
"name": "storage.type.ballerina" |
| 1458 |
} |
| 1459 |
}, |
| 1460 |
"end": "(?=\\,)|(?:\\|)|(?=\\])|(?=\\))" |
| 1461 |
} |
| 1462 |
] |
| 1463 |
}, |
| 1464 |
"functionTypeReturns": { |
| 1465 |
"patterns": [ |
| 1466 |
{ |
| 1467 |
"begin": "\\breturns\\b", |
| 1468 |
"beginCaptures": { |
| 1469 |
"0": { |
| 1470 |
"name": "keyword" |
| 1471 |
} |
| 1472 |
}, |
| 1473 |
"end": "(?=\\,)|(?:\\|)|(?=\\])|(?=\\))", |
| 1474 |
"patterns": [ |
| 1475 |
{ |
| 1476 |
"include": "#functionTypeReturnsParameter" |
| 1477 |
}, |
| 1478 |
{ |
| 1479 |
"include": "#comment" |
| 1480 |
} |
| 1481 |
] |
| 1482 |
} |
| 1483 |
] |
| 1484 |
}, |
| 1485 |
"functionTypeReturnsParameter": { |
| 1486 |
"patterns": [ |
| 1487 |
{ |
| 1488 |
"begin": "((?=record|object|function)|(?:[_$[:alpha:]][_$[:alnum:]]*))", |
| 1489 |
"beginCaptures": { |
| 1490 |
"0": { |
| 1491 |
"name": "storage.type.ballerina" |
| 1492 |
} |
| 1493 |
}, |
| 1494 |
"end": "(?=\\,)|(?:\\|)|(?:\\:)|(?==>)|(?=\\))|(?=\\])", |
| 1495 |
"patterns": [ |
| 1496 |
{ |
| 1497 |
"include": "#record" |
| 1498 |
}, |
| 1499 |
{ |
| 1500 |
"include": "#objectDec" |
| 1501 |
}, |
| 1502 |
{ |
| 1503 |
"include": "#functionType" |
| 1504 |
}, |
| 1505 |
{ |
| 1506 |
"include": "#constrainType" |
| 1507 |
}, |
| 1508 |
{ |
| 1509 |
"include": "#defaultValue" |
| 1510 |
}, |
| 1511 |
{ |
| 1512 |
"include": "#comment" |
| 1513 |
}, |
| 1514 |
{ |
| 1515 |
"include": "#parameterTuple" |
| 1516 |
}, |
| 1517 |
{ |
| 1518 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 1519 |
"name": "default.variable.parameter.ballerina" |
| 1520 |
} |
| 1521 |
] |
| 1522 |
} |
| 1523 |
] |
| 1524 |
}, |
| 1525 |
"if-statement": { |
| 1526 |
"patterns": [ |
| 1527 |
{ |
| 1528 |
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?=\\bif\\b\\s*(?!\\{))", |
| 1529 |
"end": "(?<=\\})", |
| 1530 |
"patterns": [ |
| 1531 |
{ |
| 1532 |
"include": "#comment" |
| 1533 |
}, |
| 1534 |
{ |
| 1535 |
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(if)\\s*(\\()?", |
| 1536 |
"beginCaptures": { |
| 1537 |
"1": { |
| 1538 |
"name": "keyword.control.conditional.ballerina" |
| 1539 |
}, |
| 1540 |
"2": { |
| 1541 |
"name": "meta.brace.round.ballerina" |
| 1542 |
} |
| 1543 |
}, |
| 1544 |
"end": "(\\))|(?=\\{)", |
| 1545 |
"endCaptures": { |
| 1546 |
"1": { |
| 1547 |
"name": "meta.brace.round.ballerina" |
| 1548 |
} |
| 1549 |
}, |
| 1550 |
"patterns": [ |
| 1551 |
{ |
| 1552 |
"include": "#decl-block" |
| 1553 |
}, |
| 1554 |
{ |
| 1555 |
"include": "#keywords" |
| 1556 |
}, |
| 1557 |
{ |
| 1558 |
"include": "#identifiers" |
| 1559 |
}, |
| 1560 |
{ |
| 1561 |
"include": "#type-primitive" |
| 1562 |
}, |
| 1563 |
{ |
| 1564 |
"include": "#xml" |
| 1565 |
}, |
| 1566 |
{ |
| 1567 |
"include": "#string" |
| 1568 |
}, |
| 1569 |
{ |
| 1570 |
"include": "#stringTemplate" |
| 1571 |
}, |
| 1572 |
{ |
| 1573 |
"include": "#comment" |
| 1574 |
}, |
| 1575 |
{ |
| 1576 |
"include": "#ternary-expression" |
| 1577 |
}, |
| 1578 |
{ |
| 1579 |
"include": "#expression-operators" |
| 1580 |
}, |
| 1581 |
{ |
| 1582 |
"include": "#literal" |
| 1583 |
}, |
| 1584 |
{ |
| 1585 |
"include": "#paranthesised" |
| 1586 |
}, |
| 1587 |
{ |
| 1588 |
"include": "#regex" |
| 1589 |
} |
| 1590 |
] |
| 1591 |
}, |
| 1592 |
{ |
| 1593 |
"begin": "(?<=\\))(?=\\s|\\=)", |
| 1594 |
"end": "(?=\\{)", |
| 1595 |
"patterns": [ |
| 1596 |
{ |
| 1597 |
"include": "#literal" |
| 1598 |
}, |
| 1599 |
{ |
| 1600 |
"include": "#keywords" |
| 1601 |
} |
| 1602 |
] |
| 1603 |
}, |
| 1604 |
{ |
| 1605 |
"include": "#decl-block" |
| 1606 |
} |
| 1607 |
] |
| 1608 |
} |
| 1609 |
] |
| 1610 |
}, |
| 1611 |
"import-clause": { |
| 1612 |
"patterns": [ |
| 1613 |
{ |
| 1614 |
"include": "#comment" |
| 1615 |
}, |
| 1616 |
{ |
| 1617 |
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bdefault)|(\\*)|(\\b[_$[:alpha:]][_$[:alnum:]]*))", |
| 1618 |
"captures": { |
| 1619 |
"1": { |
| 1620 |
"name": "keyword.control.default.ballerina" |
| 1621 |
}, |
| 1622 |
"3": { |
| 1623 |
"name": "variable.other.readwrite.ballerina meta.import.module.ballerina" |
| 1624 |
}, |
| 1625 |
"5": { |
| 1626 |
"name": "keyword.control.default.ballerina" |
| 1627 |
}, |
| 1628 |
"6": { |
| 1629 |
"name": "variable.other.readwrite.alias.ballerina" |
| 1630 |
} |
| 1631 |
} |
| 1632 |
}, |
| 1633 |
{ |
| 1634 |
"name": "variable.other.readwrite.alias.ballerina", |
| 1635 |
"match": "([_$[:alpha:]][_$[:alnum:]]*)" |
| 1636 |
} |
| 1637 |
] |
| 1638 |
}, |
| 1639 |
"maps": { |
| 1640 |
"patterns": [ |
| 1641 |
{ |
| 1642 |
"begin": "\\{", |
| 1643 |
"end": "\\}", |
| 1644 |
"patterns": [ |
| 1645 |
{ |
| 1646 |
"include": "#code" |
| 1647 |
} |
| 1648 |
] |
| 1649 |
} |
| 1650 |
] |
| 1651 |
}, |
| 1652 |
"matchStatementPatternClause": { |
| 1653 |
"patterns": [ |
| 1654 |
{ |
| 1655 |
"begin": "=>", |
| 1656 |
"beginCaptures": { |
| 1657 |
"0": { |
| 1658 |
"name": "keyword.ballerina" |
| 1659 |
} |
| 1660 |
}, |
| 1661 |
"end": "((\\})|;|,)", |
| 1662 |
"patterns": [ |
| 1663 |
{ |
| 1664 |
"include": "#callableUnitBody" |
| 1665 |
}, |
| 1666 |
{ |
| 1667 |
"include": "#code" |
| 1668 |
} |
| 1669 |
] |
| 1670 |
} |
| 1671 |
] |
| 1672 |
}, |
| 1673 |
"matchStatement": { |
| 1674 |
"patterns": [ |
| 1675 |
{ |
| 1676 |
"begin": "\\bmatch\\b", |
| 1677 |
"beginCaptures": { |
| 1678 |
"0": { |
| 1679 |
"name": "keyword.control.ballerina" |
| 1680 |
} |
| 1681 |
}, |
| 1682 |
"end": "\\}", |
| 1683 |
"patterns": [ |
| 1684 |
{ |
| 1685 |
"include": "#matchStatementBody" |
| 1686 |
}, |
| 1687 |
{ |
| 1688 |
"include": "#comment" |
| 1689 |
}, |
| 1690 |
{ |
| 1691 |
"include": "#code" |
| 1692 |
} |
| 1693 |
] |
| 1694 |
} |
| 1695 |
] |
| 1696 |
}, |
| 1697 |
"matchStatementBody": { |
| 1698 |
"patterns": [ |
| 1699 |
{ |
| 1700 |
"begin": "\\{", |
| 1701 |
"beginCaptures": { |
| 1702 |
"0": { |
| 1703 |
"name": "punctuation.definition.block.ballerina.documentation" |
| 1704 |
} |
| 1705 |
}, |
| 1706 |
"end": "(?=\\})", |
| 1707 |
"endCaptures": { |
| 1708 |
"0": { |
| 1709 |
"name": "punctuation.definition.block.ballerina.documentation" |
| 1710 |
} |
| 1711 |
}, |
| 1712 |
"patterns": [ |
| 1713 |
{ |
| 1714 |
"include": "#literal" |
| 1715 |
}, |
| 1716 |
{ |
| 1717 |
"include": "#matchBindingPattern" |
| 1718 |
}, |
| 1719 |
{ |
| 1720 |
"include": "#matchStatementPatternClause" |
| 1721 |
}, |
| 1722 |
{ |
| 1723 |
"include": "#comment" |
| 1724 |
}, |
| 1725 |
{ |
| 1726 |
"include": "#code" |
| 1727 |
} |
| 1728 |
] |
| 1729 |
} |
| 1730 |
] |
| 1731 |
}, |
| 1732 |
"matchBindingPattern": { |
| 1733 |
"patterns": [ |
| 1734 |
{ |
| 1735 |
"begin": "var", |
| 1736 |
"beginCaptures": { |
| 1737 |
"0": { |
| 1738 |
"name": "storage.type.ballerina" |
| 1739 |
} |
| 1740 |
}, |
| 1741 |
"end": "(?==>)|,", |
| 1742 |
"patterns": [ |
| 1743 |
{ |
| 1744 |
"include": "#errorDestructure" |
| 1745 |
}, |
| 1746 |
{ |
| 1747 |
"include": "#code" |
| 1748 |
}, |
| 1749 |
{ |
| 1750 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 1751 |
"name": "variable.parameter.ballerina" |
| 1752 |
} |
| 1753 |
] |
| 1754 |
} |
| 1755 |
] |
| 1756 |
}, |
| 1757 |
"mdDocumentation": { |
| 1758 |
"name": "comment.mddocs.ballerina", |
| 1759 |
"begin": "\\#", |
| 1760 |
"end": "[\\r\\n]+", |
| 1761 |
"patterns": [ |
| 1762 |
{ |
| 1763 |
"include": "#mdDocumentationReturnParamDescription" |
| 1764 |
}, |
| 1765 |
{ |
| 1766 |
"include": "#mdDocumentationParamDescription" |
| 1767 |
} |
| 1768 |
] |
| 1769 |
}, |
| 1770 |
"mdDocumentationParamDescription": { |
| 1771 |
"patterns": [ |
| 1772 |
{ |
| 1773 |
"begin": "(\\+\\s+)(\\'?[_$[:alpha:]][_$[:alnum:]]*)(\\s*\\-\\s+)", |
| 1774 |
"beginCaptures": { |
| 1775 |
"1": { |
| 1776 |
"name": "keyword.operator.ballerina" |
| 1777 |
}, |
| 1778 |
"2": { |
| 1779 |
"name": "variable.other.readwrite.ballerina" |
| 1780 |
}, |
| 1781 |
"3": { |
| 1782 |
"name": "keyword.operator.ballerina" |
| 1783 |
} |
| 1784 |
}, |
| 1785 |
"end": "(?=[^#\\r\\n]|(?:# *?\\+))", |
| 1786 |
"patterns": [ |
| 1787 |
{ |
| 1788 |
"match": "#.*", |
| 1789 |
"name": "comment.mddocs.paramdesc.ballerina" |
| 1790 |
} |
| 1791 |
] |
| 1792 |
} |
| 1793 |
] |
| 1794 |
}, |
| 1795 |
"mdDocumentationReturnParamDescription": { |
| 1796 |
"patterns": [ |
| 1797 |
{ |
| 1798 |
"begin": "(#)(?: *?)(\\+)(?: *)(return)(?: *)(-)?(.*)", |
| 1799 |
"beginCaptures": { |
| 1800 |
"1": { |
| 1801 |
"name": "comment.mddocs.ballerina" |
| 1802 |
}, |
| 1803 |
"2": { |
| 1804 |
"name": "keyword.ballerina" |
| 1805 |
}, |
| 1806 |
"3": { |
| 1807 |
"name": "keyword.ballerina" |
| 1808 |
}, |
| 1809 |
"4": { |
| 1810 |
"name": "keyword.ballerina" |
| 1811 |
}, |
| 1812 |
"5": { |
| 1813 |
"name": "comment.mddocs.returnparamdesc.ballerina" |
| 1814 |
} |
| 1815 |
}, |
| 1816 |
"end": "(?=[^#\\r\\n]|(?:# *?\\+))", |
| 1817 |
"patterns": [ |
| 1818 |
{ |
| 1819 |
"match": "#.*", |
| 1820 |
"name": "comment.mddocs.returnparamdesc.ballerina" |
| 1821 |
} |
| 1822 |
] |
| 1823 |
} |
| 1824 |
] |
| 1825 |
}, |
| 1826 |
"multiType": { |
| 1827 |
"patterns": [ |
| 1828 |
{ |
| 1829 |
"match": "(?<=\\|)([_$[:alpha:]][_$[:alnum:]]*)|([_$[:alpha:]][_$[:alnum:]]*)(?=\\|)", |
| 1830 |
"name": "storage.type.ballerina" |
| 1831 |
}, |
| 1832 |
{ |
| 1833 |
"match": "\\|", |
| 1834 |
"name": "keyword.operator.ballerina" |
| 1835 |
} |
| 1836 |
] |
| 1837 |
}, |
| 1838 |
"numbers": { |
| 1839 |
"patterns": [ |
| 1840 |
{ |
| 1841 |
"match": "\\b0[xX][\\da-fA-F]+\\b|\\b\\d+(?:\\.(?:\\d+|$))?", |
| 1842 |
"name": "constant.numeric.decimal.ballerina" |
| 1843 |
} |
| 1844 |
] |
| 1845 |
}, |
| 1846 |
"class-body": { |
| 1847 |
"name": "meta.class.body.ballerina", |
| 1848 |
"begin": "\\{", |
| 1849 |
"beginCaptures": { |
| 1850 |
"0": { |
| 1851 |
"name": "punctuation.definition.block.ballerina" |
| 1852 |
} |
| 1853 |
}, |
| 1854 |
"end": "\\}", |
| 1855 |
"endCaptures": { |
| 1856 |
"0": { |
| 1857 |
"name": "punctuation.definition.block.ballerina" |
| 1858 |
} |
| 1859 |
}, |
| 1860 |
"patterns": [ |
| 1861 |
{ |
| 1862 |
"include": "#comment" |
| 1863 |
}, |
| 1864 |
{ |
| 1865 |
"include": "#mdDocumentation" |
| 1866 |
}, |
| 1867 |
{ |
| 1868 |
"include": "#function-defn" |
| 1869 |
}, |
| 1870 |
{ |
| 1871 |
"include": "#var-expr" |
| 1872 |
}, |
| 1873 |
{ |
| 1874 |
"include": "#variable-initializer" |
| 1875 |
}, |
| 1876 |
{ |
| 1877 |
"include": "#access-modifier" |
| 1878 |
}, |
| 1879 |
{ |
| 1880 |
"include": "#keywords" |
| 1881 |
}, |
| 1882 |
{ |
| 1883 |
"begin": "(?<=:)\\s*", |
| 1884 |
"end": "(?=\\s|[;),}\\]:\\-\\+]|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|service|type|var)\\b))" |
| 1885 |
}, |
| 1886 |
{ |
| 1887 |
"include": "#decl-block" |
| 1888 |
}, |
| 1889 |
{ |
| 1890 |
"include": "#expression" |
| 1891 |
}, |
| 1892 |
{ |
| 1893 |
"include": "#punctuation-comma" |
| 1894 |
}, |
| 1895 |
{ |
| 1896 |
"include": "#punctuation-semicolon" |
| 1897 |
} |
| 1898 |
] |
| 1899 |
}, |
| 1900 |
"access-modifier": { |
| 1901 |
"patterns": [ |
| 1902 |
{ |
| 1903 |
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", |
| 1904 |
"name": "storage.modifier.ballerina keyword.other.ballerina" |
| 1905 |
} |
| 1906 |
] |
| 1907 |
}, |
| 1908 |
"class-defn": { |
| 1909 |
"name": "meta.class.ballerina", |
| 1910 |
"begin": "(\\s+)(class\\b)|^class\\b(?=\\s+|/[/*])", |
| 1911 |
"beginCaptures": { |
| 1912 |
"0": { |
| 1913 |
"name": "storage.type.class.ballerina keyword.other.ballerina" |
| 1914 |
} |
| 1915 |
}, |
| 1916 |
"end": "(?<=\\})", |
| 1917 |
"patterns": [ |
| 1918 |
{ |
| 1919 |
"include": "#keywords" |
| 1920 |
}, |
| 1921 |
{ |
| 1922 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 1923 |
"captures": { |
| 1924 |
"0": { |
| 1925 |
"name": "entity.name.type.class.ballerina" |
| 1926 |
} |
| 1927 |
} |
| 1928 |
}, |
| 1929 |
{ |
| 1930 |
"include": "#class-body" |
| 1931 |
} |
| 1932 |
] |
| 1933 |
}, |
| 1934 |
"objectDec": { |
| 1935 |
"patterns": [ |
| 1936 |
{ |
| 1937 |
"begin": "\\bobject\\b(?!:)", |
| 1938 |
"beginCaptures": { |
| 1939 |
"0": { |
| 1940 |
"name": "keyword.other.ballerina" |
| 1941 |
} |
| 1942 |
}, |
| 1943 |
"end": "(?<=\\})", |
| 1944 |
"patterns": [ |
| 1945 |
{ |
| 1946 |
"include": "#decl-block" |
| 1947 |
} |
| 1948 |
] |
| 1949 |
} |
| 1950 |
] |
| 1951 |
}, |
| 1952 |
"objectInitBody": { |
| 1953 |
"patterns": [ |
| 1954 |
{ |
| 1955 |
"begin": "\\{", |
| 1956 |
"end": "(?=\\})", |
| 1957 |
"beginCaptures": { |
| 1958 |
"0": { |
| 1959 |
"name": "punctuation.definition.block.ballerina" |
| 1960 |
} |
| 1961 |
}, |
| 1962 |
"endCaptures": { |
| 1963 |
"0": { |
| 1964 |
"name": "punctuation.definition.block.ballerina" |
| 1965 |
} |
| 1966 |
}, |
| 1967 |
"patterns": [ |
| 1968 |
{ |
| 1969 |
"include": "#comment" |
| 1970 |
}, |
| 1971 |
{ |
| 1972 |
"include": "#code" |
| 1973 |
} |
| 1974 |
] |
| 1975 |
} |
| 1976 |
] |
| 1977 |
}, |
| 1978 |
"objectInitParameters": { |
| 1979 |
"patterns": [ |
| 1980 |
{ |
| 1981 |
"begin": "\\(", |
| 1982 |
"end": "\\)", |
| 1983 |
"beginCaptures": { |
| 1984 |
"0": { |
| 1985 |
"name": "punctuation.definition.parameters.begin.ballerina" |
| 1986 |
} |
| 1987 |
}, |
| 1988 |
"endCaptures": { |
| 1989 |
"0": { |
| 1990 |
"name": "punctuation.definition.parameters.end.ballerina" |
| 1991 |
} |
| 1992 |
}, |
| 1993 |
"patterns": [ |
| 1994 |
{ |
| 1995 |
"include": "#code" |
| 1996 |
}, |
| 1997 |
{ |
| 1998 |
"match": "\\b([_$[:alpha:]][_$[:alnum:]]*)\\b", |
| 1999 |
"name": "variable.parameter.ballerina" |
| 2000 |
} |
| 2001 |
] |
| 2002 |
} |
| 2003 |
] |
| 2004 |
}, |
| 2005 |
"objectMemberFunctionDec": { |
| 2006 |
"patterns": [ |
| 2007 |
{ |
| 2008 |
"begin": "\\bfunction\\b", |
| 2009 |
"beginCaptures": { |
| 2010 |
"0": { |
| 2011 |
"name": "keyword.ballerina" |
| 2012 |
} |
| 2013 |
}, |
| 2014 |
"end": ";", |
| 2015 |
"endCaptures": { |
| 2016 |
"0": { |
| 2017 |
"name": "punctuation.definition.block.ballerina" |
| 2018 |
} |
| 2019 |
}, |
| 2020 |
"patterns": [ |
| 2021 |
{ |
| 2022 |
"include": "#functionParameters" |
| 2023 |
}, |
| 2024 |
{ |
| 2025 |
"match": "\\breturns\\b", |
| 2026 |
"name": "keyword.ballerina" |
| 2027 |
}, |
| 2028 |
{ |
| 2029 |
"include": "#code" |
| 2030 |
} |
| 2031 |
] |
| 2032 |
} |
| 2033 |
] |
| 2034 |
}, |
| 2035 |
"paranthesised": { |
| 2036 |
"name": "meta.brace.round.block.ballerina", |
| 2037 |
"begin": "\\(", |
| 2038 |
"beginCaptures": { |
| 2039 |
"0": { |
| 2040 |
"name": "meta.brace.round.ballerina" |
| 2041 |
} |
| 2042 |
}, |
| 2043 |
"end": "\\)", |
| 2044 |
"endCaptures": { |
| 2045 |
"0": { |
| 2046 |
"name": "meta.brace.round.ballerina" |
| 2047 |
} |
| 2048 |
}, |
| 2049 |
"patterns": [ |
| 2050 |
{ |
| 2051 |
"include": "#self-literal" |
| 2052 |
}, |
| 2053 |
{ |
| 2054 |
"include": "#function-defn" |
| 2055 |
}, |
| 2056 |
{ |
| 2057 |
"include": "#decl-block" |
| 2058 |
}, |
| 2059 |
{ |
| 2060 |
"include": "#comment" |
| 2061 |
}, |
| 2062 |
{ |
| 2063 |
"include": "#string" |
| 2064 |
}, |
| 2065 |
{ |
| 2066 |
"include": "#parameters" |
| 2067 |
}, |
| 2068 |
{ |
| 2069 |
"include": "#annotationAttachment" |
| 2070 |
}, |
| 2071 |
{ |
| 2072 |
"include": "#recordLiteral" |
| 2073 |
}, |
| 2074 |
{ |
| 2075 |
"include": "#stringTemplate" |
| 2076 |
}, |
| 2077 |
{ |
| 2078 |
"include": "#parameter-name" |
| 2079 |
}, |
| 2080 |
{ |
| 2081 |
"include": "#variable-initializer" |
| 2082 |
}, |
| 2083 |
{ |
| 2084 |
"include": "#expression" |
| 2085 |
}, |
| 2086 |
{ |
| 2087 |
"include": "#regex" |
| 2088 |
} |
| 2089 |
] |
| 2090 |
}, |
| 2091 |
"paranthesisedBracket": { |
| 2092 |
"patterns": [ |
| 2093 |
{ |
| 2094 |
"begin": "\\[", |
| 2095 |
"end": "\\]", |
| 2096 |
"patterns": [ |
| 2097 |
{ |
| 2098 |
"include": "#comment" |
| 2099 |
}, |
| 2100 |
{ |
| 2101 |
"include": "#code" |
| 2102 |
} |
| 2103 |
] |
| 2104 |
} |
| 2105 |
] |
| 2106 |
}, |
| 2107 |
"parameters": { |
| 2108 |
"patterns": [ |
| 2109 |
{ |
| 2110 |
"name": "keyword.control.flow.ballerina", |
| 2111 |
"match": "\\s*(return|break|continue|check|checkpanic|panic|trap|from|where)\\b" |
| 2112 |
}, |
| 2113 |
{ |
| 2114 |
"name": "keyword.other.ballerina", |
| 2115 |
"match": "\\s*(let|select)\\b" |
| 2116 |
}, |
| 2117 |
{ |
| 2118 |
"name": "punctuation.separator.parameter.ballerina", |
| 2119 |
"match": "\\," |
| 2120 |
} |
| 2121 |
] |
| 2122 |
}, |
| 2123 |
"record": { |
| 2124 |
"name": "meta.record.ballerina", |
| 2125 |
"begin": "\\brecord\\b", |
| 2126 |
"beginCaptures": { |
| 2127 |
"0": { |
| 2128 |
"name": "keyword.other.ballerina" |
| 2129 |
} |
| 2130 |
}, |
| 2131 |
"end": "(?<=\\})", |
| 2132 |
"patterns": [ |
| 2133 |
{ |
| 2134 |
"include": "#recordBody" |
| 2135 |
} |
| 2136 |
] |
| 2137 |
}, |
| 2138 |
"recordBody": { |
| 2139 |
"patterns": [ |
| 2140 |
{ |
| 2141 |
"include": "#decl-block" |
| 2142 |
} |
| 2143 |
] |
| 2144 |
}, |
| 2145 |
"recordLiteral": { |
| 2146 |
"patterns": [ |
| 2147 |
{ |
| 2148 |
"begin": "\\{", |
| 2149 |
"end": "\\}", |
| 2150 |
"beginCaptures": { |
| 2151 |
"0": { |
| 2152 |
"name": "punctuation.definition.block.ballerina" |
| 2153 |
} |
| 2154 |
}, |
| 2155 |
"endCaptures": { |
| 2156 |
"0": { |
| 2157 |
"name": "punctuation.definition.block.ballerina" |
| 2158 |
} |
| 2159 |
}, |
| 2160 |
"patterns": [ |
| 2161 |
{ |
| 2162 |
"include": "#code" |
| 2163 |
} |
| 2164 |
] |
| 2165 |
} |
| 2166 |
] |
| 2167 |
}, |
| 2168 |
"serviceBody": { |
| 2169 |
"patterns": [ |
| 2170 |
{ |
| 2171 |
"include": "#comment" |
| 2172 |
}, |
| 2173 |
{ |
| 2174 |
"include": "#mdDocumentation" |
| 2175 |
}, |
| 2176 |
{ |
| 2177 |
"include": "#documentationDef" |
| 2178 |
}, |
| 2179 |
{ |
| 2180 |
"include": "#decl-block" |
| 2181 |
} |
| 2182 |
] |
| 2183 |
}, |
| 2184 |
"service-decl": { |
| 2185 |
"name": "meta.service.declaration.ballerina", |
| 2186 |
"begin": "\\bservice\\b", |
| 2187 |
"end": "(?=;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|service|type|var)\\b))|(?<=\\})|(?<=\\,)", |
| 2188 |
"beginCaptures": { |
| 2189 |
"0": { |
| 2190 |
"name": "keyword.ballerina" |
| 2191 |
} |
| 2192 |
}, |
| 2193 |
"patterns": [ |
| 2194 |
{ |
| 2195 |
"include": "#class-defn" |
| 2196 |
}, |
| 2197 |
{ |
| 2198 |
"include": "#serviceName" |
| 2199 |
}, |
| 2200 |
{ |
| 2201 |
"include": "#serviceOn" |
| 2202 |
}, |
| 2203 |
{ |
| 2204 |
"include": "#serviceBody" |
| 2205 |
}, |
| 2206 |
{ |
| 2207 |
"include": "#objectDec" |
| 2208 |
} |
| 2209 |
] |
| 2210 |
}, |
| 2211 |
"serviceName": { |
| 2212 |
"patterns": [ |
| 2213 |
{ |
| 2214 |
"include": "#string" |
| 2215 |
}, |
| 2216 |
{ |
| 2217 |
"name": "entity.service.path.ballerina", |
| 2218 |
"match": "(\\/([_$[:alpha:]][_$[:alnum:]]*)|\\\"[_$[:alpha:]][_$[:alnum:]]*\\\")" |
| 2219 |
} |
| 2220 |
] |
| 2221 |
}, |
| 2222 |
"serviceOn": { |
| 2223 |
"patterns": [ |
| 2224 |
{ |
| 2225 |
"begin": "on", |
| 2226 |
"end": "(?={)", |
| 2227 |
"beginCaptures": { |
| 2228 |
"0": { |
| 2229 |
"name": "keyword.other.ballerina" |
| 2230 |
} |
| 2231 |
}, |
| 2232 |
"patterns": [ |
| 2233 |
{ |
| 2234 |
"include": "#code" |
| 2235 |
} |
| 2236 |
] |
| 2237 |
} |
| 2238 |
] |
| 2239 |
}, |
| 2240 |
"strings": { |
| 2241 |
"patterns": [ |
| 2242 |
{ |
| 2243 |
"begin": "\\\"", |
| 2244 |
"end": "\\\"", |
| 2245 |
"beginCaptures": { |
| 2246 |
"0": { |
| 2247 |
"name": "string.begin.ballerina" |
| 2248 |
} |
| 2249 |
}, |
| 2250 |
"endCaptures": { |
| 2251 |
"0": { |
| 2252 |
"name": "string.end.ballerina" |
| 2253 |
} |
| 2254 |
}, |
| 2255 |
"patterns": [ |
| 2256 |
{ |
| 2257 |
"name": "constant.character.escape.ballerina", |
| 2258 |
"match": "\\\\." |
| 2259 |
}, |
| 2260 |
{ |
| 2261 |
"name": "string", |
| 2262 |
"match": "." |
| 2263 |
} |
| 2264 |
] |
| 2265 |
} |
| 2266 |
] |
| 2267 |
}, |
| 2268 |
"string-character-escape": { |
| 2269 |
"patterns": [ |
| 2270 |
{ |
| 2271 |
"name": "constant.character.escape.ballerina", |
| 2272 |
"match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" |
| 2273 |
} |
| 2274 |
] |
| 2275 |
}, |
| 2276 |
"stringTemplate": { |
| 2277 |
"patterns": [ |
| 2278 |
{ |
| 2279 |
"name": "string.template.ballerina", |
| 2280 |
"begin": "((string)|([_$[:alpha:]][_$[:alnum:]]*))?(`)", |
| 2281 |
"beginCaptures": { |
| 2282 |
"1": { |
| 2283 |
"name": "entity.name.function.tagged-template.ballerina" |
| 2284 |
}, |
| 2285 |
"2": { |
| 2286 |
"name": "support.type.primitive.ballerina" |
| 2287 |
}, |
| 2288 |
"4": { |
| 2289 |
"name": "punctuation.definition.string.template.begin.ballerina" |
| 2290 |
} |
| 2291 |
}, |
| 2292 |
"end": "\\\\?`", |
| 2293 |
"endCaptures": { |
| 2294 |
"0": { |
| 2295 |
"name": "punctuation.definition.string.template.end.ballerina" |
| 2296 |
} |
| 2297 |
}, |
| 2298 |
"patterns": [ |
| 2299 |
{ |
| 2300 |
"include": "#template-substitution-element" |
| 2301 |
}, |
| 2302 |
{ |
| 2303 |
"include": "#string-character-escape" |
| 2304 |
} |
| 2305 |
] |
| 2306 |
} |
| 2307 |
] |
| 2308 |
}, |
| 2309 |
"template-substitution-element": { |
| 2310 |
"patterns": [ |
| 2311 |
{ |
| 2312 |
"name": "meta.template.expression.ballerina", |
| 2313 |
"begin": "\\$\\{", |
| 2314 |
"beginCaptures": { |
| 2315 |
"0": { |
| 2316 |
"name": "punctuation.definition.template-expression.begin.ballerina" |
| 2317 |
} |
| 2318 |
}, |
| 2319 |
"end": "\\}", |
| 2320 |
"endCaptures": { |
| 2321 |
"0": { |
| 2322 |
"name": "punctuation.definition.template-expression.end.ballerina" |
| 2323 |
} |
| 2324 |
}, |
| 2325 |
"patterns": [ |
| 2326 |
{ |
| 2327 |
"include": "#expression" |
| 2328 |
} |
| 2329 |
], |
| 2330 |
"contentName": "meta.embedded.line.ballerina" |
| 2331 |
} |
| 2332 |
] |
| 2333 |
}, |
| 2334 |
"typeDefinition": { |
| 2335 |
"patterns": [ |
| 2336 |
{ |
| 2337 |
"begin": "(\\btype\\b)\\s+([_$[:alpha:]][_$[:alnum:]]*)", |
| 2338 |
"beginCaptures": { |
| 2339 |
"1": { |
| 2340 |
"name": "keyword.other.ballerina" |
| 2341 |
}, |
| 2342 |
"2": { |
| 2343 |
"name": "entity.name.type.ballerina" |
| 2344 |
} |
| 2345 |
}, |
| 2346 |
"end": "\\;", |
| 2347 |
"endCaptures": { |
| 2348 |
"0": { |
| 2349 |
"name": "punctuation.terminator.statement.ballerina" |
| 2350 |
} |
| 2351 |
}, |
| 2352 |
"patterns": [ |
| 2353 |
{ |
| 2354 |
"include": "#functionParameters" |
| 2355 |
}, |
| 2356 |
{ |
| 2357 |
"include": "#functionReturns" |
| 2358 |
}, |
| 2359 |
{ |
| 2360 |
"include": "#mdDocumentation" |
| 2361 |
}, |
| 2362 |
{ |
| 2363 |
"include": "#record" |
| 2364 |
}, |
| 2365 |
{ |
| 2366 |
"include": "#string" |
| 2367 |
}, |
| 2368 |
{ |
| 2369 |
"include": "#keywords" |
| 2370 |
}, |
| 2371 |
{ |
| 2372 |
"include": "#multiType" |
| 2373 |
}, |
| 2374 |
{ |
| 2375 |
"include": "#type-primitive" |
| 2376 |
}, |
| 2377 |
{ |
| 2378 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 2379 |
"name": "variable.other.readwrite.ballerina" |
| 2380 |
}, |
| 2381 |
{ |
| 2382 |
"include": "#type-annotation" |
| 2383 |
}, |
| 2384 |
{ |
| 2385 |
"include": "#typeDescription" |
| 2386 |
}, |
| 2387 |
{ |
| 2388 |
"include": "#decl-block" |
| 2389 |
} |
| 2390 |
] |
| 2391 |
} |
| 2392 |
] |
| 2393 |
}, |
| 2394 |
"typeDescription": { |
| 2395 |
"patterns": [ |
| 2396 |
{ |
| 2397 |
"begin": "[_$[:alpha:]][_$[:alnum:]]*", |
| 2398 |
"end": "(?=;)", |
| 2399 |
"patterns": [ |
| 2400 |
{ |
| 2401 |
"include": "#numbers" |
| 2402 |
}, |
| 2403 |
{ |
| 2404 |
"include": "#decl-block" |
| 2405 |
}, |
| 2406 |
{ |
| 2407 |
"include": "#type-primitive" |
| 2408 |
}, |
| 2409 |
{ |
| 2410 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 2411 |
"name": "storage.type.ballerina" |
| 2412 |
} |
| 2413 |
] |
| 2414 |
} |
| 2415 |
] |
| 2416 |
}, |
| 2417 |
"var-expr": { |
| 2418 |
"patterns": [ |
| 2419 |
{ |
| 2420 |
"name": "meta.var.expr.ballerina", |
| 2421 |
"begin": "(?=\\b(var))", |
| 2422 |
"beginCaptures": { |
| 2423 |
"0": { |
| 2424 |
"name": "storage.modifier.ballerina support.type.primitive.ballerina" |
| 2425 |
} |
| 2426 |
}, |
| 2427 |
"end": "(?!\\b(var))((?=;|}|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|service|type|var)\\b))|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?=(if)\\s+))|((?<!^string|[^\\._$[:alnum:]]string|^int|[^\\._$[:alnum:]]int)(?=\\s*$)))", |
| 2428 |
"patterns": [ |
| 2429 |
{ |
| 2430 |
"begin": "\\b(var)(?=\\s+|\\[|\\?|\\||\\:)", |
| 2431 |
"beginCaptures": { |
| 2432 |
"0": { |
| 2433 |
"name": "support.type.primitive.ballerina" |
| 2434 |
} |
| 2435 |
}, |
| 2436 |
"end": "(?=\\S)" |
| 2437 |
}, |
| 2438 |
{ |
| 2439 |
"match": "\\|", |
| 2440 |
"name": "keyword.operator.type.annotation.ballerina" |
| 2441 |
}, |
| 2442 |
{ |
| 2443 |
"name": "keyword.other.ballerina", |
| 2444 |
"match": "\\bin\\b" |
| 2445 |
}, |
| 2446 |
{ |
| 2447 |
"include": "#comment" |
| 2448 |
}, |
| 2449 |
{ |
| 2450 |
"include": "#string" |
| 2451 |
}, |
| 2452 |
{ |
| 2453 |
"include": "#stringTemplate" |
| 2454 |
}, |
| 2455 |
{ |
| 2456 |
"include": "#numbers" |
| 2457 |
}, |
| 2458 |
{ |
| 2459 |
"include": "#multiType" |
| 2460 |
}, |
| 2461 |
{ |
| 2462 |
"include": "#self-literal" |
| 2463 |
}, |
| 2464 |
{ |
| 2465 |
"include": "#var-single-variable" |
| 2466 |
}, |
| 2467 |
{ |
| 2468 |
"include": "#variable-initializer" |
| 2469 |
}, |
| 2470 |
{ |
| 2471 |
"include": "#punctuation-comma" |
| 2472 |
}, |
| 2473 |
{ |
| 2474 |
"include": "#type-annotation" |
| 2475 |
}, |
| 2476 |
{ |
| 2477 |
"include": "#keywords" |
| 2478 |
}, |
| 2479 |
{ |
| 2480 |
"include": "#type-tuple" |
| 2481 |
}, |
| 2482 |
{ |
| 2483 |
"include": "#regex" |
| 2484 |
} |
| 2485 |
] |
| 2486 |
}, |
| 2487 |
{ |
| 2488 |
"include": "#punctuation-comma" |
| 2489 |
}, |
| 2490 |
{ |
| 2491 |
"name": "meta.var.expr.ballerina", |
| 2492 |
"begin": "(?=\\b(const(?!\\s+enum\\b)))", |
| 2493 |
"end": "(?!\\b(const(?!\\s+enum\\b)))((?=\\bannotation\\b|;|}|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|service|type|var)\\b))|((?<!^string|[^\\._$[:alnum:]]string|^int|[^\\._$[:alnum:]]int)(?=\\s*$)))", |
| 2494 |
"patterns": [ |
| 2495 |
{ |
| 2496 |
"begin": "\\b(const(?!\\s+enum\\b))\\s+", |
| 2497 |
"beginCaptures": { |
| 2498 |
"0": { |
| 2499 |
"name": "keyword.other.ballerina" |
| 2500 |
} |
| 2501 |
}, |
| 2502 |
"end": "(?=\\S)" |
| 2503 |
}, |
| 2504 |
{ |
| 2505 |
"include": "#comment" |
| 2506 |
}, |
| 2507 |
{ |
| 2508 |
"include": "#string" |
| 2509 |
}, |
| 2510 |
{ |
| 2511 |
"include": "#stringTemplate" |
| 2512 |
}, |
| 2513 |
{ |
| 2514 |
"include": "#var-single-const" |
| 2515 |
}, |
| 2516 |
{ |
| 2517 |
"include": "#variable-initializer" |
| 2518 |
}, |
| 2519 |
{ |
| 2520 |
"include": "#punctuation-comma" |
| 2521 |
}, |
| 2522 |
{ |
| 2523 |
"include": "#type-annotation" |
| 2524 |
} |
| 2525 |
] |
| 2526 |
}, |
| 2527 |
{ |
| 2528 |
"include": "#punctuation-comma" |
| 2529 |
}, |
| 2530 |
{ |
| 2531 |
"name": "meta.var.expr.ballerina", |
| 2532 |
"begin": "(string|int|boolean|float|byte|decimal|json|xml|anydata)(?=\\s+|\\[|\\?|\\||\\:)", |
| 2533 |
"beginCaptures": { |
| 2534 |
"0": { |
| 2535 |
"name": "support.type.primitive.ballerina" |
| 2536 |
} |
| 2537 |
}, |
| 2538 |
"end": "(?!\\b(var))((?=;|}|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|service|type|var)\\b))|((?<!^string|[^\\._$[:alnum:]]string|^int|[^\\._$[:alnum:]]int)(?=\\s*$)))", |
| 2539 |
"patterns": [ |
| 2540 |
{ |
| 2541 |
"include": "#xml" |
| 2542 |
}, |
| 2543 |
{ |
| 2544 |
"begin": "(string|int|boolean|float|byte|decimal|json|xml|anydata)(?=\\s+|\\[|\\?|\\||\\:)", |
| 2545 |
"beginCaptures": { |
| 2546 |
"0": { |
| 2547 |
"name": "support.type.primitive.ballerina" |
| 2548 |
} |
| 2549 |
}, |
| 2550 |
"end": "(?=\\S)" |
| 2551 |
}, |
| 2552 |
{ |
| 2553 |
"match": "\\|", |
| 2554 |
"name": "keyword.operator.type.annotation.ballerina" |
| 2555 |
}, |
| 2556 |
{ |
| 2557 |
"include": "#string" |
| 2558 |
}, |
| 2559 |
{ |
| 2560 |
"include": "#stringTemplate" |
| 2561 |
}, |
| 2562 |
{ |
| 2563 |
"include": "#numbers" |
| 2564 |
}, |
| 2565 |
{ |
| 2566 |
"include": "#multiType" |
| 2567 |
}, |
| 2568 |
{ |
| 2569 |
"include": "#var-single-variable" |
| 2570 |
}, |
| 2571 |
{ |
| 2572 |
"include": "#variable-initializer" |
| 2573 |
}, |
| 2574 |
{ |
| 2575 |
"include": "#punctuation-comma" |
| 2576 |
}, |
| 2577 |
{ |
| 2578 |
"include": "#type-annotation" |
| 2579 |
}, |
| 2580 |
{ |
| 2581 |
"include": "#keywords" |
| 2582 |
}, |
| 2583 |
{ |
| 2584 |
"include": "#type-tuple" |
| 2585 |
}, |
| 2586 |
{ |
| 2587 |
"include": "#regex" |
| 2588 |
} |
| 2589 |
] |
| 2590 |
}, |
| 2591 |
{ |
| 2592 |
"include": "#punctuation-comma" |
| 2593 |
} |
| 2594 |
] |
| 2595 |
}, |
| 2596 |
"var-single-variable": { |
| 2597 |
"patterns": [ |
| 2598 |
{ |
| 2599 |
"name": "meta.var-single-variable.expr.ballerina", |
| 2600 |
"begin": "((string|int|boolean|float|byte|decimal|json|xml|anydata)|\\b(readonly|error|map)\\b|([_$[:alpha:]][_$[:alnum:]]*))(?=\\s+|\\;|\\>|\\|)", |
| 2601 |
"beginCaptures": { |
| 2602 |
"2": { |
| 2603 |
"name": "support.type.primitive.ballerina" |
| 2604 |
}, |
| 2605 |
"3": { |
| 2606 |
"name": "storage.type.ballerina" |
| 2607 |
}, |
| 2608 |
"4": { |
| 2609 |
"name": "meta.definition.variable.ballerina variable.other.readwrite.ballerina" |
| 2610 |
} |
| 2611 |
}, |
| 2612 |
"end": "(?=$|^|[;,=}])", |
| 2613 |
"endCaptures": { |
| 2614 |
"0": { |
| 2615 |
"name": "punctuation.terminator.statement.ballerina" |
| 2616 |
} |
| 2617 |
}, |
| 2618 |
"patterns": [ |
| 2619 |
{ |
| 2620 |
"include": "#call" |
| 2621 |
}, |
| 2622 |
{ |
| 2623 |
"include": "#self-literal" |
| 2624 |
}, |
| 2625 |
{ |
| 2626 |
"include": "#if-statement" |
| 2627 |
}, |
| 2628 |
{ |
| 2629 |
"include": "#string" |
| 2630 |
}, |
| 2631 |
{ |
| 2632 |
"include": "#numbers" |
| 2633 |
}, |
| 2634 |
{ |
| 2635 |
"include": "#keywords" |
| 2636 |
} |
| 2637 |
] |
| 2638 |
}, |
| 2639 |
{ |
| 2640 |
"name": "meta.var-single-variable.expr.ballerina", |
| 2641 |
"begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s+(\\!)?", |
| 2642 |
"beginCaptures": { |
| 2643 |
"1": { |
| 2644 |
"name": "meta.definition.variable.ballerina variable.other.readwrite.ballerina" |
| 2645 |
}, |
| 2646 |
"2": { |
| 2647 |
"name": "keyword.operator.definiteassignment.ballerina" |
| 2648 |
} |
| 2649 |
}, |
| 2650 |
"end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))\\s+))" |
| 2651 |
} |
| 2652 |
] |
| 2653 |
}, |
| 2654 |
"var-single-const": { |
| 2655 |
"patterns": [ |
| 2656 |
{ |
| 2657 |
"name": "meta.var-single-variable.expr.ballerina" |
| 2658 |
}, |
| 2659 |
{ |
| 2660 |
"begin": "\\b(var)\\s*", |
| 2661 |
"beginCaptures": { |
| 2662 |
"0": { |
| 2663 |
"name": "support.type.primitive.ballerina" |
| 2664 |
} |
| 2665 |
}, |
| 2666 |
"end": "(?=\\S)" |
| 2667 |
}, |
| 2668 |
{ |
| 2669 |
"include": "#types" |
| 2670 |
}, |
| 2671 |
{ |
| 2672 |
"begin": "([_$[:alpha:]][_$[:alnum:]]*)", |
| 2673 |
"beginCaptures": { |
| 2674 |
"1": { |
| 2675 |
"name": "meta.definition.variable.ballerina variable.other.constant.ballerina" |
| 2676 |
} |
| 2677 |
}, |
| 2678 |
"end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))\\s+))" |
| 2679 |
} |
| 2680 |
] |
| 2681 |
}, |
| 2682 |
"variable-initializer": { |
| 2683 |
"patterns": [ |
| 2684 |
{ |
| 2685 |
"begin": "(?<!=|!)(=)(?!=|>)(?=\\s*\\S)", |
| 2686 |
"beginCaptures": { |
| 2687 |
"1": { |
| 2688 |
"name": "keyword.operator.assignment.ballerina" |
| 2689 |
} |
| 2690 |
}, |
| 2691 |
"end": "(?=$|[,);}\\]])", |
| 2692 |
"patterns": [ |
| 2693 |
{ |
| 2694 |
"match": "(\\')([_$[:alpha:]][_$[:alnum:]]*)", |
| 2695 |
"name": "variable.other.property.ballerina" |
| 2696 |
}, |
| 2697 |
{ |
| 2698 |
"include": "#xml" |
| 2699 |
}, |
| 2700 |
{ |
| 2701 |
"include": "#function-defn" |
| 2702 |
}, |
| 2703 |
{ |
| 2704 |
"include": "#expression" |
| 2705 |
}, |
| 2706 |
{ |
| 2707 |
"include": "#punctuation-accessor" |
| 2708 |
}, |
| 2709 |
{ |
| 2710 |
"include": "#regex" |
| 2711 |
} |
| 2712 |
] |
| 2713 |
}, |
| 2714 |
{ |
| 2715 |
"begin": "(?<!=|!)(=)(?!=|>)", |
| 2716 |
"beginCaptures": { |
| 2717 |
"1": { |
| 2718 |
"name": "keyword.operator.assignment.ballerina" |
| 2719 |
} |
| 2720 |
}, |
| 2721 |
"end": "(?=[,);}\\]]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))\\s+))|(?=^\\s*$)|(?<=\\S)(?<!=)(?=\\s*$)", |
| 2722 |
"patterns": [ |
| 2723 |
{ |
| 2724 |
"include": "#expression" |
| 2725 |
} |
| 2726 |
] |
| 2727 |
} |
| 2728 |
] |
| 2729 |
}, |
| 2730 |
"variableDef": { |
| 2731 |
"patterns": [ |
| 2732 |
{ |
| 2733 |
"begin": "(?:(?!\\+)[_$[:alpha:]][_$[:alnum:]]*)(?: |\\t)|(?=\\()", |
| 2734 |
"beginCaptures": { |
| 2735 |
"0": { |
| 2736 |
"name": "storage.type.ballerina" |
| 2737 |
} |
| 2738 |
}, |
| 2739 |
"end": "(?:[_$[:alpha:]][_$[:alnum:]]*)|(?=\\,)|(?=;)|\\.\\.\\.", |
| 2740 |
"patterns": [ |
| 2741 |
{ |
| 2742 |
"include": "#tupleType" |
| 2743 |
}, |
| 2744 |
{ |
| 2745 |
"include": "#constrainType" |
| 2746 |
}, |
| 2747 |
{ |
| 2748 |
"include": "#comment" |
| 2749 |
} |
| 2750 |
] |
| 2751 |
} |
| 2752 |
] |
| 2753 |
}, |
| 2754 |
"variableDefInline": { |
| 2755 |
"patterns": [ |
| 2756 |
{ |
| 2757 |
"begin": "(?=record)|(?=object)", |
| 2758 |
"end": "(?=;)", |
| 2759 |
"patterns": [ |
| 2760 |
{ |
| 2761 |
"include": "#record" |
| 2762 |
}, |
| 2763 |
{ |
| 2764 |
"include": "#objectDec" |
| 2765 |
} |
| 2766 |
] |
| 2767 |
} |
| 2768 |
] |
| 2769 |
}, |
| 2770 |
"workerDef": { |
| 2771 |
"patterns": [ |
| 2772 |
{ |
| 2773 |
"begin": "\\bworker\\b", |
| 2774 |
"beginCaptures": { |
| 2775 |
"0": { |
| 2776 |
"name": "keyword.ballerina" |
| 2777 |
} |
| 2778 |
}, |
| 2779 |
"end": "\\}", |
| 2780 |
"patterns": [ |
| 2781 |
{ |
| 2782 |
"include": "#functionReturns" |
| 2783 |
}, |
| 2784 |
{ |
| 2785 |
"include": "#workerBody" |
| 2786 |
} |
| 2787 |
] |
| 2788 |
} |
| 2789 |
] |
| 2790 |
}, |
| 2791 |
"workerBody": { |
| 2792 |
"patterns": [ |
| 2793 |
{ |
| 2794 |
"begin": "\\{", |
| 2795 |
"end": "(?=\\})", |
| 2796 |
"patterns": [ |
| 2797 |
{ |
| 2798 |
"include": "#code" |
| 2799 |
} |
| 2800 |
] |
| 2801 |
} |
| 2802 |
] |
| 2803 |
}, |
| 2804 |
"parameter": { |
| 2805 |
"patterns": [ |
| 2806 |
{ |
| 2807 |
"begin": "((?=record|object|function)|([_$[:alpha:]][_$[:alnum:]]*)(?=\\|)|(?:[_$[:alpha:]][_$[:alnum:]]*))", |
| 2808 |
"beginCaptures": { |
| 2809 |
"0": { |
| 2810 |
"name": "storage.type.ballerina" |
| 2811 |
} |
| 2812 |
}, |
| 2813 |
"end": "(?:\\,)|(?:\\|)|(?:\\:)|(?==>)|(?=\\))|(?=\\])", |
| 2814 |
"patterns": [ |
| 2815 |
{ |
| 2816 |
"include": "#parameterWithDescriptor" |
| 2817 |
}, |
| 2818 |
{ |
| 2819 |
"include": "#record" |
| 2820 |
}, |
| 2821 |
{ |
| 2822 |
"include": "#objectDec" |
| 2823 |
}, |
| 2824 |
{ |
| 2825 |
"include": "#functionType" |
| 2826 |
}, |
| 2827 |
{ |
| 2828 |
"include": "#constrainType" |
| 2829 |
}, |
| 2830 |
{ |
| 2831 |
"include": "#defaultValue" |
| 2832 |
}, |
| 2833 |
{ |
| 2834 |
"include": "#comment" |
| 2835 |
}, |
| 2836 |
{ |
| 2837 |
"include": "#parameterTuple" |
| 2838 |
}, |
| 2839 |
{ |
| 2840 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 2841 |
"name": "default.variable.parameter.ballerina" |
| 2842 |
} |
| 2843 |
] |
| 2844 |
} |
| 2845 |
] |
| 2846 |
}, |
| 2847 |
"parameterTuple": { |
| 2848 |
"patterns": [ |
| 2849 |
{ |
| 2850 |
"begin": "\\[", |
| 2851 |
"end": "(?=\\,)|(?=\\|)|(?=\\:)|(?==>)|(?=\\))", |
| 2852 |
"patterns": [ |
| 2853 |
{ |
| 2854 |
"include": "#record" |
| 2855 |
}, |
| 2856 |
{ |
| 2857 |
"include": "#objectDec" |
| 2858 |
}, |
| 2859 |
{ |
| 2860 |
"include": "#parameterTupleType" |
| 2861 |
}, |
| 2862 |
{ |
| 2863 |
"include": "#parameterTupleEnd" |
| 2864 |
}, |
| 2865 |
{ |
| 2866 |
"include": "#comment" |
| 2867 |
} |
| 2868 |
] |
| 2869 |
} |
| 2870 |
] |
| 2871 |
}, |
| 2872 |
"parameterTupleType": { |
| 2873 |
"patterns": [ |
| 2874 |
{ |
| 2875 |
"begin": "[_$[:alpha:]][_$[:alnum:]]*", |
| 2876 |
"beginCaptures": { |
| 2877 |
"0": { |
| 2878 |
"name": "storage.type.ballerina" |
| 2879 |
} |
| 2880 |
}, |
| 2881 |
"end": "(?:\\,)|(?:\\|)|(?=\\])" |
| 2882 |
} |
| 2883 |
] |
| 2884 |
}, |
| 2885 |
"parameterTupleEnd": { |
| 2886 |
"patterns": [ |
| 2887 |
{ |
| 2888 |
"begin": "\\]", |
| 2889 |
"end": "(?=\\,)|(?=\\|)|(?=\\:)|(?==>)|(?=\\))", |
| 2890 |
"patterns": [ |
| 2891 |
{ |
| 2892 |
"include": "#defaultWithParentheses" |
| 2893 |
}, |
| 2894 |
{ |
| 2895 |
"match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 2896 |
"name": "default.variable.parameter.ballerina" |
| 2897 |
} |
| 2898 |
] |
| 2899 |
} |
| 2900 |
] |
| 2901 |
}, |
| 2902 |
"parameterWithDescriptor": { |
| 2903 |
"patterns": [ |
| 2904 |
{ |
| 2905 |
"begin": "\\&", |
| 2906 |
"beginCaptures": { |
| 2907 |
"0": { |
| 2908 |
"name": "keyword.operator.ballerina" |
| 2909 |
} |
| 2910 |
}, |
| 2911 |
"end": "(?=\\,)|(?=\\|)|(?=\\))", |
| 2912 |
"patterns": [ |
| 2913 |
{ |
| 2914 |
"include": "#parameter" |
| 2915 |
} |
| 2916 |
] |
| 2917 |
} |
| 2918 |
] |
| 2919 |
}, |
| 2920 |
"defaultWithParentheses": { |
| 2921 |
"patterns": [ |
| 2922 |
{ |
| 2923 |
"begin": "\\(", |
| 2924 |
"beginCaptures": { |
| 2925 |
"0": { |
| 2926 |
"name": "punctuation.definition.block.ballerina" |
| 2927 |
} |
| 2928 |
}, |
| 2929 |
"end": "\\)", |
| 2930 |
"endCaptures": { |
| 2931 |
"0": { |
| 2932 |
"name": "punctuation.definition.block.ballerina" |
| 2933 |
} |
| 2934 |
} |
| 2935 |
} |
| 2936 |
] |
| 2937 |
}, |
| 2938 |
"string": { |
| 2939 |
"patterns": [ |
| 2940 |
{ |
| 2941 |
"begin": "\"", |
| 2942 |
"name": "string.quoted.double.ballerina", |
| 2943 |
"beginCaptures": { |
| 2944 |
"0": { |
| 2945 |
"name": "punctuation.definition.string.begin.ballerina" |
| 2946 |
} |
| 2947 |
}, |
| 2948 |
"end": "(\")|((?:[^\\\\\\n])$)", |
| 2949 |
"endCaptures": { |
| 2950 |
"1": { |
| 2951 |
"name": "punctuation.definition.string.end.ballerina" |
| 2952 |
}, |
| 2953 |
"2": { |
| 2954 |
"name": "invalid.illegal.newline.ballerina" |
| 2955 |
} |
| 2956 |
}, |
| 2957 |
"patterns": [ |
| 2958 |
{ |
| 2959 |
"include": "#string-character-escape" |
| 2960 |
} |
| 2961 |
] |
| 2962 |
} |
| 2963 |
] |
| 2964 |
}, |
| 2965 |
"source": { |
| 2966 |
"patterns": [ |
| 2967 |
{ |
| 2968 |
"begin": "(\\bsource\\b)\\s+([_$[:alpha:]][_$[:alnum:]]*)", |
| 2969 |
"beginCaptures": { |
| 2970 |
"1": { |
| 2971 |
"name": "keyword.other.ballerina" |
| 2972 |
}, |
| 2973 |
"2": { |
| 2974 |
"name": "variable.other.readwrite.ballerina" |
| 2975 |
} |
| 2976 |
}, |
| 2977 |
"end": "(?=\\,)|(?=\\;)" |
| 2978 |
} |
| 2979 |
] |
| 2980 |
}, |
| 2981 |
"types": { |
| 2982 |
"patterns": [ |
| 2983 |
{ |
| 2984 |
"name": "storage.type.ballerina", |
| 2985 |
"match": "\\b(handle|any|future|typedesc)\\b" |
| 2986 |
}, |
| 2987 |
{ |
| 2988 |
"name": "support.type.primitive.ballerina", |
| 2989 |
"match": "\\b(boolean|int|string|float|decimal|byte|json|xml|anydata)\\b" |
| 2990 |
}, |
| 2991 |
{ |
| 2992 |
"name": "storage.type.ballerina", |
| 2993 |
"match": "\\b(map|error|never|readonly|distinct)\\b" |
| 2994 |
}, |
| 2995 |
{ |
| 2996 |
"name": "storage.type.ballerina", |
| 2997 |
"match": "\\b(stream)\\b" |
| 2998 |
} |
| 2999 |
] |
| 3000 |
}, |
| 3001 |
"xml": { |
| 3002 |
"patterns": [ |
| 3003 |
{ |
| 3004 |
"begin": "(\\bxml)(\\s*)(`)", |
| 3005 |
"name": "string.template.ballerina", |
| 3006 |
"beginCaptures": { |
| 3007 |
"1": { |
| 3008 |
"name": "support.type.primitive.ballerina" |
| 3009 |
}, |
| 3010 |
"3": { |
| 3011 |
"name": "punctuation.definition.string.template.begin.ballerina" |
| 3012 |
} |
| 3013 |
}, |
| 3014 |
"end": "`", |
| 3015 |
"endCaptures": { |
| 3016 |
"0": { |
| 3017 |
"name": "punctuation.definition.string.template.end.ballerina" |
| 3018 |
} |
| 3019 |
}, |
| 3020 |
"patterns": [ |
| 3021 |
{ |
| 3022 |
"include": "#xmlTag" |
| 3023 |
}, |
| 3024 |
{ |
| 3025 |
"include": "#xmlComment" |
| 3026 |
}, |
| 3027 |
{ |
| 3028 |
"include": "#templateVariable" |
| 3029 |
}, |
| 3030 |
{ |
| 3031 |
"name": "string", |
| 3032 |
"match": "." |
| 3033 |
} |
| 3034 |
] |
| 3035 |
} |
| 3036 |
] |
| 3037 |
}, |
| 3038 |
"xmlTag": { |
| 3039 |
"patterns": [ |
| 3040 |
{ |
| 3041 |
"begin": "(<\\/?\\??)\\s*([-_a-zA-Z0-9]+)", |
| 3042 |
"beginCaptures": { |
| 3043 |
"1": { |
| 3044 |
"name": "punctuation.definition.tag.begin.xml.ballerina" |
| 3045 |
}, |
| 3046 |
"2": { |
| 3047 |
"name": "entity.name.tag.xml.ballerina" |
| 3048 |
} |
| 3049 |
}, |
| 3050 |
"end": "\\??\\/?>", |
| 3051 |
"endCaptures": { |
| 3052 |
"0": { |
| 3053 |
"name": "punctuation.definition.tag.end.xml.ballerina" |
| 3054 |
} |
| 3055 |
}, |
| 3056 |
"patterns": [ |
| 3057 |
{ |
| 3058 |
"include": "#xmlSingleQuotedString" |
| 3059 |
}, |
| 3060 |
{ |
| 3061 |
"include": "#xmlDoubleQuotedString" |
| 3062 |
}, |
| 3063 |
{ |
| 3064 |
"name": "keyword.other.ballerina", |
| 3065 |
"match": "xmlns" |
| 3066 |
}, |
| 3067 |
{ |
| 3068 |
"name": "entity.other.attribute-name.xml.ballerina", |
| 3069 |
"match": "([a-zA-Z0-9-]+)" |
| 3070 |
} |
| 3071 |
] |
| 3072 |
} |
| 3073 |
] |
| 3074 |
}, |
| 3075 |
"xmlComment": { |
| 3076 |
"patterns": [ |
| 3077 |
{ |
| 3078 |
"begin": "<!--", |
| 3079 |
"beginCaptures": { |
| 3080 |
"0": { |
| 3081 |
"name": "comment.block.xml.ballerina" |
| 3082 |
} |
| 3083 |
}, |
| 3084 |
"end": "-->", |
| 3085 |
"endCaptures": { |
| 3086 |
"0": { |
| 3087 |
"name": "comment.block.xml.ballerina" |
| 3088 |
} |
| 3089 |
}, |
| 3090 |
"name": "comment.block.xml.ballerina" |
| 3091 |
} |
| 3092 |
] |
| 3093 |
}, |
| 3094 |
"xmlSingleQuotedString": { |
| 3095 |
"patterns": [ |
| 3096 |
{ |
| 3097 |
"begin": "\\'", |
| 3098 |
"end": "\\'", |
| 3099 |
"beginCaptures": { |
| 3100 |
"0": { |
| 3101 |
"name": "string.begin.ballerina" |
| 3102 |
} |
| 3103 |
}, |
| 3104 |
"endCaptures": { |
| 3105 |
"0": { |
| 3106 |
"name": "string.end.ballerina" |
| 3107 |
} |
| 3108 |
}, |
| 3109 |
"patterns": [ |
| 3110 |
{ |
| 3111 |
"name": "constant.character.escape.ballerina", |
| 3112 |
"match": "\\\\." |
| 3113 |
}, |
| 3114 |
{ |
| 3115 |
"name": "string", |
| 3116 |
"match": "." |
| 3117 |
} |
| 3118 |
] |
| 3119 |
} |
| 3120 |
] |
| 3121 |
}, |
| 3122 |
"xmlDoubleQuotedString": { |
| 3123 |
"patterns": [ |
| 3124 |
{ |
| 3125 |
"begin": "\\\"", |
| 3126 |
"end": "\\\"", |
| 3127 |
"beginCaptures": { |
| 3128 |
"0": { |
| 3129 |
"name": "string.begin.ballerina" |
| 3130 |
} |
| 3131 |
}, |
| 3132 |
"endCaptures": { |
| 3133 |
"0": { |
| 3134 |
"name": "string.end.ballerina" |
| 3135 |
} |
| 3136 |
}, |
| 3137 |
"patterns": [ |
| 3138 |
{ |
| 3139 |
"name": "constant.character.escape.ballerina", |
| 3140 |
"match": "\\\\." |
| 3141 |
}, |
| 3142 |
{ |
| 3143 |
"name": "string", |
| 3144 |
"match": "." |
| 3145 |
} |
| 3146 |
] |
| 3147 |
} |
| 3148 |
] |
| 3149 |
}, |
| 3150 |
"templateVariable": { |
| 3151 |
"patterns": [ |
| 3152 |
{ |
| 3153 |
"begin": "\\${", |
| 3154 |
"beginCaptures": { |
| 3155 |
"0": { |
| 3156 |
"name": "constant.character.escape.ballerina" |
| 3157 |
} |
| 3158 |
}, |
| 3159 |
"end": "}", |
| 3160 |
"endCaptures": { |
| 3161 |
"0": { |
| 3162 |
"name": "constant.character.escape.ballerina" |
| 3163 |
} |
| 3164 |
}, |
| 3165 |
"patterns": [ |
| 3166 |
{ |
| 3167 |
"include": "#code" |
| 3168 |
} |
| 3169 |
] |
| 3170 |
} |
| 3171 |
] |
| 3172 |
}, |
| 3173 |
"ternary-expression": { |
| 3174 |
"begin": "(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)", |
| 3175 |
"beginCaptures": { |
| 3176 |
"1": { |
| 3177 |
"name": "keyword.operator.ternary.ballerina" |
| 3178 |
} |
| 3179 |
}, |
| 3180 |
"end": "\\s*", |
| 3181 |
"endCaptures": { |
| 3182 |
"1": { |
| 3183 |
"name": "keyword.operator.ternary.ballerina" |
| 3184 |
} |
| 3185 |
}, |
| 3186 |
"patterns": [ |
| 3187 |
{ |
| 3188 |
"include": "#expression" |
| 3189 |
} |
| 3190 |
] |
| 3191 |
}, |
| 3192 |
"type": { |
| 3193 |
"patterns": [ |
| 3194 |
{ |
| 3195 |
"include": "#comment" |
| 3196 |
}, |
| 3197 |
{ |
| 3198 |
"include": "#string" |
| 3199 |
}, |
| 3200 |
{ |
| 3201 |
"include": "#numbers" |
| 3202 |
}, |
| 3203 |
{ |
| 3204 |
"include": "#type-primitive" |
| 3205 |
}, |
| 3206 |
{ |
| 3207 |
"include": "#type-tuple" |
| 3208 |
} |
| 3209 |
] |
| 3210 |
}, |
| 3211 |
"type-annotation": { |
| 3212 |
"patterns": [ |
| 3213 |
{ |
| 3214 |
"name": "meta.type.annotation.ballerina", |
| 3215 |
"begin": "(\\:)", |
| 3216 |
"beginCaptures": { |
| 3217 |
"1": { |
| 3218 |
"name": "keyword.operator.type.annotation.ballerina" |
| 3219 |
} |
| 3220 |
}, |
| 3221 |
"end": "(?<![:|&])((?=$|^|[,);\\}\\]\\?\\>\\=>]|//)|(?==[^>])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))(\\?)?", |
| 3222 |
"patterns": [ |
| 3223 |
{ |
| 3224 |
"include": "#booleans" |
| 3225 |
}, |
| 3226 |
{ |
| 3227 |
"include": "#stringTemplate" |
| 3228 |
}, |
| 3229 |
{ |
| 3230 |
"include": "#regex" |
| 3231 |
}, |
| 3232 |
{ |
| 3233 |
"include": "#self-literal" |
| 3234 |
}, |
| 3235 |
{ |
| 3236 |
"include": "#xml" |
| 3237 |
}, |
| 3238 |
{ |
| 3239 |
"include": "#call" |
| 3240 |
}, |
| 3241 |
{ |
| 3242 |
"match": "\\b(is|new|isolated|null|function|in)\\b|\\b(true|false)\\b|\\b(check|foreach|if|checkpanic)\\b|\\b(readonly|error|map)\\b|\\b(var)\\b|([_$[:alpha:]][_$[:alnum:]]*)((\\.)([_$[:alpha:]][_$[:alnum:]]*)(\\()(\\)))?", |
| 3243 |
"captures": { |
| 3244 |
"1": { |
| 3245 |
"name": "keyword.other.ballerina" |
| 3246 |
}, |
| 3247 |
"2": { |
| 3248 |
"name": "constant.language.boolean.ballerina" |
| 3249 |
}, |
| 3250 |
"3": { |
| 3251 |
"name": "keyword.control.ballerina" |
| 3252 |
}, |
| 3253 |
"4": { |
| 3254 |
"name": "storage.type.ballerina" |
| 3255 |
}, |
| 3256 |
"5": { |
| 3257 |
"name": "support.type.primitive.ballerina" |
| 3258 |
}, |
| 3259 |
"6": { |
| 3260 |
"name": "variable.other.readwrite.ballerina" |
| 3261 |
}, |
| 3262 |
"8": { |
| 3263 |
"name": "punctuation.accessor.ballerina" |
| 3264 |
}, |
| 3265 |
"9": { |
| 3266 |
"name": "entity.name.function.ballerina" |
| 3267 |
}, |
| 3268 |
"10": { |
| 3269 |
"name": "punctuation.definition.parameters.begin.ballerina" |
| 3270 |
}, |
| 3271 |
"11": { |
| 3272 |
"name": "punctuation.definition.parameters.end.ballerina" |
| 3273 |
} |
| 3274 |
} |
| 3275 |
}, |
| 3276 |
{ |
| 3277 |
"name": "keyword.operator.optional.ballerina", |
| 3278 |
"match": "\\?" |
| 3279 |
}, |
| 3280 |
{ |
| 3281 |
"include": "#multiType" |
| 3282 |
}, |
| 3283 |
{ |
| 3284 |
"include": "#type" |
| 3285 |
}, |
| 3286 |
{ |
| 3287 |
"include": "#paranthesised" |
| 3288 |
} |
| 3289 |
] |
| 3290 |
} |
| 3291 |
] |
| 3292 |
}, |
| 3293 |
"type-tuple": { |
| 3294 |
"name": "meta.type.tuple.ballerina", |
| 3295 |
"begin": "\\[", |
| 3296 |
"beginCaptures": { |
| 3297 |
"0": { |
| 3298 |
"name": "meta.brace.square.ballerina" |
| 3299 |
} |
| 3300 |
}, |
| 3301 |
"end": "\\]", |
| 3302 |
"endCaptures": { |
| 3303 |
"0": { |
| 3304 |
"name": "meta.brace.square.ballerina" |
| 3305 |
} |
| 3306 |
}, |
| 3307 |
"patterns": [ |
| 3308 |
{ |
| 3309 |
"include": "#self-literal" |
| 3310 |
}, |
| 3311 |
{ |
| 3312 |
"include": "#booleans" |
| 3313 |
}, |
| 3314 |
{ |
| 3315 |
"name": "keyword.operator.rest.ballerina", |
| 3316 |
"match": "\\.\\.\\." |
| 3317 |
}, |
| 3318 |
{ |
| 3319 |
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\?)?\\s*(:)", |
| 3320 |
"captures": { |
| 3321 |
"1": { |
| 3322 |
"name": "entity.name.label.ballerina" |
| 3323 |
}, |
| 3324 |
"2": { |
| 3325 |
"name": "keyword.operator.optional.ballerina" |
| 3326 |
}, |
| 3327 |
"3": { |
| 3328 |
"name": "punctuation.separator.label.ballerina" |
| 3329 |
} |
| 3330 |
} |
| 3331 |
}, |
| 3332 |
{ |
| 3333 |
"include": "#identifiers" |
| 3334 |
}, |
| 3335 |
{ |
| 3336 |
"include": "#type" |
| 3337 |
}, |
| 3338 |
{ |
| 3339 |
"include": "#punctuation-comma" |
| 3340 |
} |
| 3341 |
] |
| 3342 |
}, |
| 3343 |
"keywords": { |
| 3344 |
"patterns": [ |
| 3345 |
{ |
| 3346 |
"name": "keyword.control.ballerina", |
| 3347 |
"match": "\\b(fork|join|while|returns|transaction|transactional|retry|commit|rollback|typeof|enum|wait|match)\\b" |
| 3348 |
}, |
| 3349 |
{ |
| 3350 |
"name": "keyword.control.flow.ballerina", |
| 3351 |
"match": "\\b(return|break|continue|check|checkpanic|panic|trap|from|where)\\b" |
| 3352 |
}, |
| 3353 |
{ |
| 3354 |
"name": "keyword.other.ballerina", |
| 3355 |
"match": "\\b(public|private|external|return|record|object|remote|abstract|client|true|false|fail|import|version)\\b" |
| 3356 |
}, |
| 3357 |
{ |
| 3358 |
"name": "keyword.other.ballerina", |
| 3359 |
"match": "\\b(as|on|function|resource|listener|const|final|is|null|lock|annotation|source|worker|parameter|field|isolated|in)\\b" |
| 3360 |
}, |
| 3361 |
{ |
| 3362 |
"name": "keyword.other.ballerina", |
| 3363 |
"match": "\\b(xmlns|table|key|let|new|select|start|flush|default|do|base16|base64|conflict)\\b" |
| 3364 |
}, |
| 3365 |
{ |
| 3366 |
"name": "keyword.other.ballerina", |
| 3367 |
"match": "\\b(limit|outer|equals|order|by|ascending|descending|class|configurable|variable|module|service|group|collect)\\b" |
| 3368 |
}, |
| 3369 |
{ |
| 3370 |
"name": "meta.arrow.ballerina storage.type.function.arrow.ballerina", |
| 3371 |
"match": "(=>)" |
| 3372 |
}, |
| 3373 |
{ |
| 3374 |
"name": "keyword.operator.ballerina", |
| 3375 |
"match": "(!|%|\\+|\\-|~=|===|==|=|!=|!==|<|>|&|\\||\\?:|\\.\\.\\.|<=|>=|&&|\\|\\||~|>>|>>>)" |
| 3376 |
}, |
| 3377 |
{ |
| 3378 |
"include": "#types" |
| 3379 |
}, |
| 3380 |
{ |
| 3381 |
"include": "#self-literal" |
| 3382 |
}, |
| 3383 |
{ |
| 3384 |
"include": "#type-primitive" |
| 3385 |
} |
| 3386 |
] |
| 3387 |
}, |
| 3388 |
"literal": { |
| 3389 |
"patterns": [ |
| 3390 |
{ |
| 3391 |
"include": "#booleans" |
| 3392 |
}, |
| 3393 |
{ |
| 3394 |
"include": "#numbers" |
| 3395 |
}, |
| 3396 |
{ |
| 3397 |
"include": "#strings" |
| 3398 |
}, |
| 3399 |
{ |
| 3400 |
"include": "#maps" |
| 3401 |
}, |
| 3402 |
{ |
| 3403 |
"include": "#self-literal" |
| 3404 |
}, |
| 3405 |
{ |
| 3406 |
"include": "#array-literal" |
| 3407 |
} |
| 3408 |
] |
| 3409 |
}, |
| 3410 |
"array-literal": { |
| 3411 |
"name": "meta.array.literal.ballerina", |
| 3412 |
"begin": "\\s*(\\[)", |
| 3413 |
"beginCaptures": { |
| 3414 |
"1": { |
| 3415 |
"name": "meta.brace.square.ballerina" |
| 3416 |
} |
| 3417 |
}, |
| 3418 |
"end": "\\]", |
| 3419 |
"endCaptures": { |
| 3420 |
"0": { |
| 3421 |
"name": "meta.brace.square.ballerina" |
| 3422 |
} |
| 3423 |
}, |
| 3424 |
"patterns": [ |
| 3425 |
{ |
| 3426 |
"include": "#expression" |
| 3427 |
}, |
| 3428 |
{ |
| 3429 |
"include": "#punctuation-comma" |
| 3430 |
} |
| 3431 |
] |
| 3432 |
}, |
| 3433 |
"self-literal": { |
| 3434 |
"patterns": [ |
| 3435 |
{ |
| 3436 |
"match": "(\\bself\\b)\\s*(.)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=\\()", |
| 3437 |
"captures": { |
| 3438 |
"1": { |
| 3439 |
"name": "variable.language.this.ballerina" |
| 3440 |
}, |
| 3441 |
"2": { |
| 3442 |
"name": "punctuation.accessor.ballerina" |
| 3443 |
}, |
| 3444 |
"3": { |
| 3445 |
"name": "entity.name.function.ballerina" |
| 3446 |
} |
| 3447 |
} |
| 3448 |
}, |
| 3449 |
{ |
| 3450 |
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))self\\b(?!\\$)", |
| 3451 |
"name": "variable.language.this.ballerina" |
| 3452 |
} |
| 3453 |
] |
| 3454 |
}, |
| 3455 |
"code": { |
| 3456 |
"patterns": [ |
| 3457 |
{ |
| 3458 |
"include": "#booleans" |
| 3459 |
}, |
| 3460 |
{ |
| 3461 |
"include": "#matchStatement" |
| 3462 |
}, |
| 3463 |
{ |
| 3464 |
"include": "#butExp" |
| 3465 |
}, |
| 3466 |
{ |
| 3467 |
"include": "#xml" |
| 3468 |
}, |
| 3469 |
{ |
| 3470 |
"include": "#stringTemplate" |
| 3471 |
}, |
| 3472 |
{ |
| 3473 |
"include": "#keywords" |
| 3474 |
}, |
| 3475 |
{ |
| 3476 |
"include": "#strings" |
| 3477 |
}, |
| 3478 |
{ |
| 3479 |
"include": "#comment" |
| 3480 |
}, |
| 3481 |
{ |
| 3482 |
"include": "#mdDocumentation" |
| 3483 |
}, |
| 3484 |
{ |
| 3485 |
"include": "#annotationAttachment" |
| 3486 |
}, |
| 3487 |
{ |
| 3488 |
"include": "#numbers" |
| 3489 |
}, |
| 3490 |
{ |
| 3491 |
"include": "#maps" |
| 3492 |
}, |
| 3493 |
{ |
| 3494 |
"include": "#paranthesised" |
| 3495 |
}, |
| 3496 |
{ |
| 3497 |
"include": "#paranthesisedBracket" |
| 3498 |
}, |
| 3499 |
{ |
| 3500 |
"include": "#regex" |
| 3501 |
} |
| 3502 |
] |
| 3503 |
}, |
| 3504 |
"type-primitive": { |
| 3505 |
"patterns": [ |
| 3506 |
{ |
| 3507 |
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(string|int|boolean|float|byte|decimal|json|xml|anydata)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", |
| 3508 |
"name": "support.type.primitive.ballerina" |
| 3509 |
} |
| 3510 |
] |
| 3511 |
}, |
| 3512 |
"regex": { |
| 3513 |
"patterns": [ |
| 3514 |
{ |
| 3515 |
"begin": "(\\bre)(\\s*)(`)", |
| 3516 |
"name": "regexp.template.ballerina", |
| 3517 |
"beginCaptures": { |
| 3518 |
"1": { |
| 3519 |
"name": "support.type.primitive.ballerina" |
| 3520 |
}, |
| 3521 |
"3": { |
| 3522 |
"name": "punctuation.definition.regexp.template.begin.ballerina" |
| 3523 |
} |
| 3524 |
}, |
| 3525 |
"end": "`", |
| 3526 |
"endCaptures": { |
| 3527 |
"1": { |
| 3528 |
"name": "punctuation.definition.regexp.template.end.ballerina" |
| 3529 |
} |
| 3530 |
}, |
| 3531 |
"patterns": [ |
| 3532 |
{ |
| 3533 |
"include": "#template-substitution-element" |
| 3534 |
}, |
| 3535 |
{ |
| 3536 |
"include": "#regexp" |
| 3537 |
} |
| 3538 |
] |
| 3539 |
} |
| 3540 |
] |
| 3541 |
}, |
| 3542 |
"regexp": { |
| 3543 |
"patterns": [ |
| 3544 |
{ |
| 3545 |
"name": "keyword.control.assertion.regexp.ballerina", |
| 3546 |
"match": "\\^|\\$" |
| 3547 |
}, |
| 3548 |
{ |
| 3549 |
"name": "keyword.operator.quantifier.regexp.ballerina", |
| 3550 |
"match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??" |
| 3551 |
}, |
| 3552 |
{ |
| 3553 |
"name": "keyword.operator.or.regexp.ballerina", |
| 3554 |
"match": "\\|" |
| 3555 |
}, |
| 3556 |
{ |
| 3557 |
"name": "meta.group.assertion.regexp.ballerina", |
| 3558 |
"begin": "(\\()", |
| 3559 |
"beginCaptures": { |
| 3560 |
"1": { |
| 3561 |
"name": "punctuation.definition.group.regexp.ballerina" |
| 3562 |
} |
| 3563 |
}, |
| 3564 |
"end": "(\\))", |
| 3565 |
"endCaptures": { |
| 3566 |
"1": { |
| 3567 |
"name": "punctuation.definition.group.regexp.ballerina" |
| 3568 |
} |
| 3569 |
}, |
| 3570 |
"patterns": [ |
| 3571 |
{ |
| 3572 |
"include": "#template-substitution-element" |
| 3573 |
}, |
| 3574 |
{ |
| 3575 |
"include": "#regexp" |
| 3576 |
}, |
| 3577 |
{ |
| 3578 |
"include": "#flags-on-off" |
| 3579 |
}, |
| 3580 |
{ |
| 3581 |
"include": "#unicode-property-escape" |
| 3582 |
} |
| 3583 |
] |
| 3584 |
}, |
| 3585 |
{ |
| 3586 |
"name": "constant.other.character-class.set.regexp.ballerina", |
| 3587 |
"begin": "(\\[)(\\^)?", |
| 3588 |
"beginCaptures": { |
| 3589 |
"1": { |
| 3590 |
"name": "punctuation.definition.character-class.start.regexp.ballerina" |
| 3591 |
}, |
| 3592 |
"2": { |
| 3593 |
"name": "keyword.operator.negation.regexp.ballerina" |
| 3594 |
} |
| 3595 |
}, |
| 3596 |
"end": "(\\])", |
| 3597 |
"endCaptures": { |
| 3598 |
"1": { |
| 3599 |
"name": "punctuation.definition.character-class.end.regexp.ballerina" |
| 3600 |
} |
| 3601 |
}, |
| 3602 |
"patterns": [ |
| 3603 |
{ |
| 3604 |
"name": "constant.other.character-class.range.regexp.ballerina", |
| 3605 |
"match": "(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\[^pPu]))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\[^pPu]))", |
| 3606 |
"captures": { |
| 3607 |
"1": { |
| 3608 |
"name": "constant.character.numeric.regexp" |
| 3609 |
}, |
| 3610 |
"2": { |
| 3611 |
"name": "constant.character.escape.backslash.regexp" |
| 3612 |
}, |
| 3613 |
"3": { |
| 3614 |
"name": "constant.character.numeric.regexp" |
| 3615 |
}, |
| 3616 |
"4": { |
| 3617 |
"name": "constant.character.escape.backslash.regexp" |
| 3618 |
} |
| 3619 |
} |
| 3620 |
}, |
| 3621 |
{ |
| 3622 |
"include": "#regex-character-class" |
| 3623 |
}, |
| 3624 |
{ |
| 3625 |
"include": "#unicode-values" |
| 3626 |
}, |
| 3627 |
{ |
| 3628 |
"include": "#unicode-property-escape" |
| 3629 |
} |
| 3630 |
] |
| 3631 |
}, |
| 3632 |
{ |
| 3633 |
"include": "#template-substitution-element" |
| 3634 |
}, |
| 3635 |
{ |
| 3636 |
"include": "#regex-character-class" |
| 3637 |
}, |
| 3638 |
{ |
| 3639 |
"include": "#unicode-values" |
| 3640 |
}, |
| 3641 |
{ |
| 3642 |
"include": "#unicode-property-escape" |
| 3643 |
} |
| 3644 |
] |
| 3645 |
}, |
| 3646 |
"regex-character-class": { |
| 3647 |
"patterns": [ |
| 3648 |
{ |
| 3649 |
"name": "keyword.other.character-class.regexp.ballerina", |
| 3650 |
"match": "\\\\[wWsSdDtrn]|\\." |
| 3651 |
}, |
| 3652 |
{ |
| 3653 |
"name": "constant.character.escape.backslash.regexp", |
| 3654 |
"match": "\\\\[^pPu]" |
| 3655 |
} |
| 3656 |
] |
| 3657 |
}, |
| 3658 |
"unicode-property-escape": { |
| 3659 |
"patterns": [ |
| 3660 |
{ |
| 3661 |
"name": "keyword.other.unicode-property.regexp.ballerina", |
| 3662 |
"begin": "(\\\\p|\\\\P)(\\{)", |
| 3663 |
"beginCaptures": { |
| 3664 |
"1": { |
| 3665 |
"name": "keyword.other.unicode-property.regexp.ballerina" |
| 3666 |
}, |
| 3667 |
"2": { |
| 3668 |
"name": "punctuation.other.unicode-property.begin.regexp.ballerina" |
| 3669 |
} |
| 3670 |
}, |
| 3671 |
"end": "(\\})", |
| 3672 |
"endCaptures": { |
| 3673 |
"1": { |
| 3674 |
"name": "punctuation.other.unicode-property.end.regexp.ballerina" |
| 3675 |
} |
| 3676 |
}, |
| 3677 |
"patterns": [ |
| 3678 |
{ |
| 3679 |
"include": "#regex-unicode-properties-general-category" |
| 3680 |
}, |
| 3681 |
{ |
| 3682 |
"include": "#regex-unicode-property-key" |
| 3683 |
} |
| 3684 |
] |
| 3685 |
} |
| 3686 |
] |
| 3687 |
}, |
| 3688 |
"regex-unicode-property-key": { |
| 3689 |
"patterns": [ |
| 3690 |
{ |
| 3691 |
"name": "keyword.other.unicode-property-key.regexp.ballerina", |
| 3692 |
"begin": "(sc=|gc=)", |
| 3693 |
"beginCaptures": { |
| 3694 |
"1": { |
| 3695 |
"name": "keyword.other.unicode-property-key.regexp.ballerina" |
| 3696 |
} |
| 3697 |
}, |
| 3698 |
"end": "()", |
| 3699 |
"endCaptures": { |
| 3700 |
"1": { |
| 3701 |
"name": "punctuation.other.unicode-property.end.regexp.ballerina" |
| 3702 |
} |
| 3703 |
}, |
| 3704 |
"patterns": [ |
| 3705 |
{ |
| 3706 |
"include": "#regex-unicode-properties-general-category" |
| 3707 |
} |
| 3708 |
] |
| 3709 |
} |
| 3710 |
] |
| 3711 |
}, |
| 3712 |
"regex-unicode-properties-general-category": { |
| 3713 |
"patterns": [ |
| 3714 |
{ |
| 3715 |
"match": "(Lu|Ll|Lt|Lm|Lo|L|Mn|Mc|Me|M|Nd|Nl|No|N|Pc|Pd|Ps|Pe|Pi|Pf|Po|P|Sm|Sc|Sk|So|S|Zs|Zl|Zp|Z|Cf|Cc|Cn|Co|C)", |
| 3716 |
"name": "constant.other.unicode-property-general-category.regexp.ballerina" |
| 3717 |
} |
| 3718 |
] |
| 3719 |
}, |
| 3720 |
"unicode-values": { |
| 3721 |
"patterns": [ |
| 3722 |
{ |
| 3723 |
"name": "keyword.other.unicode-value.ballerina", |
| 3724 |
"begin": "(\\\\u)(\\{)", |
| 3725 |
"beginCaptures": { |
| 3726 |
"1": { |
| 3727 |
"name": "keyword.other.unicode-value.regexp.ballerina" |
| 3728 |
}, |
| 3729 |
"2": { |
| 3730 |
"name": "punctuation.other.unicode-value.begin.regexp.ballerina" |
| 3731 |
} |
| 3732 |
}, |
| 3733 |
"end": "(\\})", |
| 3734 |
"endCaptures": { |
| 3735 |
"1": { |
| 3736 |
"name": "punctuation.other.unicode-value.end.regexp.ballerina" |
| 3737 |
} |
| 3738 |
}, |
| 3739 |
"patterns": [ |
| 3740 |
{ |
| 3741 |
"match": "([0-9A-Fa-f]{1,6})", |
| 3742 |
"name": "constant.other.unicode-value.regexp.ballerina" |
| 3743 |
} |
| 3744 |
] |
| 3745 |
} |
| 3746 |
] |
| 3747 |
}, |
| 3748 |
"flags-on-off": { |
| 3749 |
"name": "meta.flags.regexp.ballerina", |
| 3750 |
"patterns": [ |
| 3751 |
{ |
| 3752 |
"begin": "(\\??)([imsx]*)(-?)([imsx]*)(:)", |
| 3753 |
"beginCaptures": { |
| 3754 |
"1": { |
| 3755 |
"name": "punctuation.other.non-capturing-group-begin.regexp.ballerina" |
| 3756 |
}, |
| 3757 |
"2": { |
| 3758 |
"name": "keyword.other.non-capturing-group.flags-on.regexp.ballerina" |
| 3759 |
}, |
| 3760 |
"3": { |
| 3761 |
"name": "punctuation.other.non-capturing-group.off.regexp.ballerina" |
| 3762 |
}, |
| 3763 |
"4": { |
| 3764 |
"name": "keyword.other.non-capturing-group.flags-off.regexp.ballerina" |
| 3765 |
}, |
| 3766 |
"5": { |
| 3767 |
"name": "punctuation.other.non-capturing-group-end.regexp.ballerina" |
| 3768 |
} |
| 3769 |
}, |
| 3770 |
"end": "()", |
| 3771 |
"name": "constant.other.flag.regexp.ballerina", |
| 3772 |
"patterns": [ |
| 3773 |
{ |
| 3774 |
"include": "#regexp" |
| 3775 |
}, |
| 3776 |
{ |
| 3777 |
"include": "#template-substitution-element" |
| 3778 |
} |
| 3779 |
] |
| 3780 |
} |
| 3781 |
] |
| 3782 |
} |
| 3783 |
} |
| 3784 |
} |
| 3785 |
|