| 1 |
{ |
| 2 |
"fileTypes": ["as"], |
| 3 |
"name": "actionscript-3", |
| 4 |
"patterns": [ |
| 5 |
{ |
| 6 |
"include": "#comments" |
| 7 |
}, |
| 8 |
{ |
| 9 |
"include": "#package" |
| 10 |
}, |
| 11 |
{ |
| 12 |
"include": "#class" |
| 13 |
}, |
| 14 |
{ |
| 15 |
"include": "#interface" |
| 16 |
}, |
| 17 |
{ |
| 18 |
"include": "#namespace_declaration" |
| 19 |
}, |
| 20 |
{ |
| 21 |
"include": "#import" |
| 22 |
}, |
| 23 |
{ |
| 24 |
"include": "#mxml" |
| 25 |
}, |
| 26 |
{ |
| 27 |
"include": "#strings" |
| 28 |
}, |
| 29 |
{ |
| 30 |
"include": "#regexp" |
| 31 |
}, |
| 32 |
{ |
| 33 |
"include": "#variable_declaration" |
| 34 |
}, |
| 35 |
{ |
| 36 |
"include": "#numbers" |
| 37 |
}, |
| 38 |
{ |
| 39 |
"include": "#primitive_types" |
| 40 |
}, |
| 41 |
{ |
| 42 |
"include": "#primitive_error_types" |
| 43 |
}, |
| 44 |
{ |
| 45 |
"include": "#dynamic_type" |
| 46 |
}, |
| 47 |
{ |
| 48 |
"include": "#primitive_functions" |
| 49 |
}, |
| 50 |
{ |
| 51 |
"include": "#language_constants" |
| 52 |
}, |
| 53 |
{ |
| 54 |
"include": "#language_variables" |
| 55 |
}, |
| 56 |
{ |
| 57 |
"include": "#guess_type" |
| 58 |
}, |
| 59 |
{ |
| 60 |
"include": "#guess_constant" |
| 61 |
}, |
| 62 |
{ |
| 63 |
"include": "#other_operators" |
| 64 |
}, |
| 65 |
{ |
| 66 |
"include": "#arithmetic_operators" |
| 67 |
}, |
| 68 |
{ |
| 69 |
"include": "#logical_operators" |
| 70 |
}, |
| 71 |
{ |
| 72 |
"include": "#array_access_operators" |
| 73 |
}, |
| 74 |
{ |
| 75 |
"include": "#vector_creation_operators" |
| 76 |
}, |
| 77 |
{ |
| 78 |
"include": "#control_keywords" |
| 79 |
}, |
| 80 |
{ |
| 81 |
"include": "#other_keywords" |
| 82 |
}, |
| 83 |
{ |
| 84 |
"include": "#use_namespace" |
| 85 |
}, |
| 86 |
{ |
| 87 |
"include": "#functions" |
| 88 |
} |
| 89 |
], |
| 90 |
"repository": { |
| 91 |
"arithmetic_operators": { |
| 92 |
"match": "(\\+|\\-|/|%|(?<!:)\\*)", |
| 93 |
"name": "keyword.operator.actionscript.3" |
| 94 |
}, |
| 95 |
"array_access_operators": { |
| 96 |
"match": "(\\[|\\])", |
| 97 |
"name": "keyword.operator.actionscript.3" |
| 98 |
}, |
| 99 |
"class": { |
| 100 |
"begin": "(?x) (^|\\s+|;) (\\b(dynamic|final|abstract)\\b\\s+)? (\\b(internal|public)\\b\\s+)? (\\b(dynamic|final|abstract)\\b\\s+)? (?=\\bclass\\b)", |
| 101 |
"beginCaptures": { |
| 102 |
"3": { |
| 103 |
"name": "storage.modifier.actionscript.3" |
| 104 |
}, |
| 105 |
"5": { |
| 106 |
"name": "storage.modifier.actionscript.3" |
| 107 |
}, |
| 108 |
"7": { |
| 109 |
"name": "storage.modifier.actionscript.3" |
| 110 |
} |
| 111 |
}, |
| 112 |
"end": "\\}", |
| 113 |
"name": "meta.class.actionscript.3", |
| 114 |
"patterns": [ |
| 115 |
{ |
| 116 |
"include": "#class_declaration" |
| 117 |
}, |
| 118 |
{ |
| 119 |
"include": "#metadata" |
| 120 |
}, |
| 121 |
{ |
| 122 |
"include": "#method" |
| 123 |
}, |
| 124 |
{ |
| 125 |
"include": "#comments" |
| 126 |
}, |
| 127 |
{ |
| 128 |
"include": "#strings" |
| 129 |
}, |
| 130 |
{ |
| 131 |
"include": "#regexp" |
| 132 |
}, |
| 133 |
{ |
| 134 |
"include": "#numbers" |
| 135 |
}, |
| 136 |
{ |
| 137 |
"include": "#primitive_types" |
| 138 |
}, |
| 139 |
{ |
| 140 |
"include": "#primitive_error_types" |
| 141 |
}, |
| 142 |
{ |
| 143 |
"include": "#dynamic_type" |
| 144 |
}, |
| 145 |
{ |
| 146 |
"include": "#primitive_functions" |
| 147 |
}, |
| 148 |
{ |
| 149 |
"include": "#language_constants" |
| 150 |
}, |
| 151 |
{ |
| 152 |
"include": "#language_variables" |
| 153 |
}, |
| 154 |
{ |
| 155 |
"include": "#other_operators" |
| 156 |
}, |
| 157 |
{ |
| 158 |
"include": "#other_keywords" |
| 159 |
}, |
| 160 |
{ |
| 161 |
"include": "#use_namespace" |
| 162 |
}, |
| 163 |
{ |
| 164 |
"include": "#guess_type" |
| 165 |
}, |
| 166 |
{ |
| 167 |
"include": "#guess_constant" |
| 168 |
}, |
| 169 |
{ |
| 170 |
"include": "#arithmetic_operators" |
| 171 |
}, |
| 172 |
{ |
| 173 |
"include": "#array_access_operators" |
| 174 |
}, |
| 175 |
{ |
| 176 |
"include": "#vector_creation_operators" |
| 177 |
}, |
| 178 |
{ |
| 179 |
"include": "#variable_declaration" |
| 180 |
}, |
| 181 |
{ |
| 182 |
"include": "#object_literal" |
| 183 |
} |
| 184 |
] |
| 185 |
}, |
| 186 |
"namespace_declaration": { |
| 187 |
"captures": { |
| 188 |
"2": { |
| 189 |
"name": "storage.modifier.actionscript.3" |
| 190 |
}, |
| 191 |
"3": { |
| 192 |
"name": "storage.modifier.actionscript.3" |
| 193 |
} |
| 194 |
}, |
| 195 |
"match": "(?x) ((\\w+)\\s+)? (namespace) \\s+ (?:[A-Za-z0-9_\\$]+)", |
| 196 |
"name": "meta.namespace_declaration.actionscript.3" |
| 197 |
}, |
| 198 |
"class_declaration": { |
| 199 |
"begin": "(?x) \\b(class)\\b \\s+ ([\\.\\w]+|\\*)", |
| 200 |
"beginCaptures": { |
| 201 |
"1": { |
| 202 |
"name": "storage.type.class.actionscript.3" |
| 203 |
}, |
| 204 |
"2": { |
| 205 |
"name": "entity.name.class.actionscript.3" |
| 206 |
} |
| 207 |
}, |
| 208 |
"end": "\\{", |
| 209 |
"name": "meta.class_declaration.actionscript.3", |
| 210 |
"patterns": [ |
| 211 |
{ |
| 212 |
"include": "#extends" |
| 213 |
}, |
| 214 |
{ |
| 215 |
"include": "#implements" |
| 216 |
}, |
| 217 |
{ |
| 218 |
"include": "#comments" |
| 219 |
} |
| 220 |
] |
| 221 |
}, |
| 222 |
"code_block": { |
| 223 |
"begin": "\\{", |
| 224 |
"end": "\\}", |
| 225 |
"name": "meta.code_block.actionscript.3", |
| 226 |
"patterns": [ |
| 227 |
{ |
| 228 |
"include": "#code_block" |
| 229 |
}, |
| 230 |
{ |
| 231 |
"include": "#comments" |
| 232 |
}, |
| 233 |
{ |
| 234 |
"include": "#strings" |
| 235 |
}, |
| 236 |
{ |
| 237 |
"include": "#regexp" |
| 238 |
}, |
| 239 |
{ |
| 240 |
"include": "#variable_declaration" |
| 241 |
}, |
| 242 |
{ |
| 243 |
"include": "#numbers" |
| 244 |
}, |
| 245 |
{ |
| 246 |
"include": "#primitive_types" |
| 247 |
}, |
| 248 |
{ |
| 249 |
"include": "#primitive_error_types" |
| 250 |
}, |
| 251 |
{ |
| 252 |
"include": "#dynamic_type" |
| 253 |
}, |
| 254 |
{ |
| 255 |
"include": "#primitive_functions" |
| 256 |
}, |
| 257 |
{ |
| 258 |
"include": "#language_constants" |
| 259 |
}, |
| 260 |
{ |
| 261 |
"include": "#language_variables" |
| 262 |
}, |
| 263 |
{ |
| 264 |
"include": "#guess_type" |
| 265 |
}, |
| 266 |
{ |
| 267 |
"include": "#guess_constant" |
| 268 |
}, |
| 269 |
{ |
| 270 |
"include": "#other_operators" |
| 271 |
}, |
| 272 |
{ |
| 273 |
"include": "#arithmetic_operators" |
| 274 |
}, |
| 275 |
{ |
| 276 |
"include": "#logical_operators" |
| 277 |
}, |
| 278 |
{ |
| 279 |
"include": "#array_access_operators" |
| 280 |
}, |
| 281 |
{ |
| 282 |
"include": "#vector_creation_operators" |
| 283 |
}, |
| 284 |
{ |
| 285 |
"include": "#control_keywords" |
| 286 |
}, |
| 287 |
{ |
| 288 |
"include": "#other_keywords" |
| 289 |
}, |
| 290 |
{ |
| 291 |
"include": "#use_namespace" |
| 292 |
}, |
| 293 |
{ |
| 294 |
"include": "#functions" |
| 295 |
}, |
| 296 |
{ |
| 297 |
"include": "#import" |
| 298 |
} |
| 299 |
] |
| 300 |
}, |
| 301 |
"comments": { |
| 302 |
"patterns": [ |
| 303 |
{ |
| 304 |
"begin": "/\\*\\*(?!/)", |
| 305 |
"end": "\\*/", |
| 306 |
"name": "comment.block.documentation.actionscript.3", |
| 307 |
"patterns": [ |
| 308 |
{ |
| 309 |
"match": "@(copy|default|eventType|example|exampleText|includeExample|inheritDoc|internal|param|private|return|see|since|throws)\\b", |
| 310 |
"name": "keyword.other.documentation.actionscript.3.asdoc" |
| 311 |
} |
| 312 |
] |
| 313 |
}, |
| 314 |
{ |
| 315 |
"begin": "/\\*", |
| 316 |
"end": "\\*/", |
| 317 |
"name": "comment.block.actionscript.3" |
| 318 |
}, |
| 319 |
{ |
| 320 |
"match": "//.*", |
| 321 |
"name": "comment.line.actionscript.3" |
| 322 |
} |
| 323 |
] |
| 324 |
}, |
| 325 |
"control_keywords": { |
| 326 |
"match": "\\b(if|else|do|while|for|each|continue|return|switch|case|default|break|try|catch|finally|throw)\\b", |
| 327 |
"name": "keyword.control.actionscript.3" |
| 328 |
}, |
| 329 |
"dynamic_type": { |
| 330 |
"captures": { |
| 331 |
"1": { |
| 332 |
"name": "support.type.actionscript.3" |
| 333 |
} |
| 334 |
}, |
| 335 |
"match": "(?<=:)\\s*(\\*)" |
| 336 |
}, |
| 337 |
"escapes": { |
| 338 |
"match": "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)", |
| 339 |
"name": "constant.character.escape.actionscript.3" |
| 340 |
}, |
| 341 |
"extends": { |
| 342 |
"captures": { |
| 343 |
"1": { |
| 344 |
"name": "keyword.other.actionscript.3" |
| 345 |
}, |
| 346 |
"2": { |
| 347 |
"name": "entity.other.inherited-class.actionscript.3" |
| 348 |
}, |
| 349 |
"3": { |
| 350 |
"name": "entity.other.inherited-class.actionscript.3" |
| 351 |
} |
| 352 |
}, |
| 353 |
"match": "(?x) \\b(extends)\\b \\s+ ([\\.\\w]+) \\s* (?:, \\s* ([\\.\\w]+))* \\s*", |
| 354 |
"name": "meta.extends.actionscript.3" |
| 355 |
}, |
| 356 |
"function_arguments": { |
| 357 |
"begin": "\\(", |
| 358 |
"end": "\\)", |
| 359 |
"name": "meta.function_arguments.actionscript.3", |
| 360 |
"patterns": [ |
| 361 |
{ |
| 362 |
"include": "#parameters" |
| 363 |
}, |
| 364 |
{ |
| 365 |
"include": "#comments" |
| 366 |
} |
| 367 |
] |
| 368 |
}, |
| 369 |
"parameters": { |
| 370 |
"begin": "(\\.\\.\\.)?\\s*([A-Za-z\\_\\$][A-Za-z0-9_\\$]*)(?:\\s*(\\:)\\s*(?:(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)))?(?:\\s*(=))?", |
| 371 |
"end": ",|(?=\\))", |
| 372 |
"beginCaptures": { |
| 373 |
"1": { |
| 374 |
"name": "keyword.operator.actionscript.3" |
| 375 |
}, |
| 376 |
"2": { |
| 377 |
"name": "variable.parameter.actionscript.3" |
| 378 |
}, |
| 379 |
"3": { |
| 380 |
"name": "keyword.operator.actionscript.3" |
| 381 |
}, |
| 382 |
"4": { |
| 383 |
"name": "support.type.actionscript.3" |
| 384 |
}, |
| 385 |
"5": { |
| 386 |
"name": "support.type.actionscript.3" |
| 387 |
}, |
| 388 |
"6": { |
| 389 |
"name": "support.type.actionscript.3" |
| 390 |
}, |
| 391 |
"7": { |
| 392 |
"name": "keyword.operator.actionscript.3" |
| 393 |
} |
| 394 |
}, |
| 395 |
"patterns": [ |
| 396 |
{ |
| 397 |
"include": "#strings" |
| 398 |
}, |
| 399 |
{ |
| 400 |
"include": "#numbers" |
| 401 |
}, |
| 402 |
{ |
| 403 |
"include": "#language_constants" |
| 404 |
}, |
| 405 |
{ |
| 406 |
"include": "#comments" |
| 407 |
}, |
| 408 |
{ |
| 409 |
"include": "#primitive_types" |
| 410 |
}, |
| 411 |
{ |
| 412 |
"include": "#primitive_error_types" |
| 413 |
}, |
| 414 |
{ |
| 415 |
"include": "#dynamic_type" |
| 416 |
}, |
| 417 |
{ |
| 418 |
"include": "#guess_type" |
| 419 |
}, |
| 420 |
{ |
| 421 |
"include": "#guess_constant" |
| 422 |
} |
| 423 |
] |
| 424 |
}, |
| 425 |
"functions": { |
| 426 |
"begin": "(?x) \\b(function)\\b (?:\\s+\\b(get|set)\\b\\s+)? \\s* ([a-zA-Z0-9_\\$]+\\b)?", |
| 427 |
"beginCaptures": { |
| 428 |
"1": { |
| 429 |
"name": "storage.type.function.actionscript.3" |
| 430 |
}, |
| 431 |
"2": { |
| 432 |
"name": "storage.modifier.actionscript.3" |
| 433 |
}, |
| 434 |
"3": { |
| 435 |
"name": "entity.name.function.actionscript.3" |
| 436 |
} |
| 437 |
}, |
| 438 |
"end": "($|;|(?=\\{))", |
| 439 |
"name": "meta.function.actionscript.3", |
| 440 |
"patterns": [ |
| 441 |
{ |
| 442 |
"include": "#function_arguments" |
| 443 |
}, |
| 444 |
{ |
| 445 |
"include": "#return_type" |
| 446 |
}, |
| 447 |
{ |
| 448 |
"include": "#comments" |
| 449 |
} |
| 450 |
] |
| 451 |
}, |
| 452 |
"guess_constant": { |
| 453 |
"captures": { |
| 454 |
"1": { |
| 455 |
"name": "constant.other.actionscript.3" |
| 456 |
} |
| 457 |
}, |
| 458 |
"comment": "Following convention, let's guess that anything in all caps/digits (possible underscores) is a constant.", |
| 459 |
"match": "\\b([A-Z\\$][A-Z0-9_]+)\\b" |
| 460 |
}, |
| 461 |
"guess_type": { |
| 462 |
"captures": { |
| 463 |
"1": { |
| 464 |
"name": "support.type.actionscript.3" |
| 465 |
} |
| 466 |
}, |
| 467 |
"comment": "Following convention, let's guess that any word starting with one or more capital letters (that contains at least some lower-case letters so that constants aren't detected) refers to a class/type. May be fully-qualified.", |
| 468 |
"match": "\\b((?:[A-Za-z0-9_\\$]+\\.)*[A-Z][A-Z0-9]*[a-z]+[A-Za-z0-9_\\$]*)\\b" |
| 469 |
}, |
| 470 |
"implements": { |
| 471 |
"captures": { |
| 472 |
"1": { |
| 473 |
"name": "keyword.other.actionscript.3" |
| 474 |
}, |
| 475 |
"2": { |
| 476 |
"name": "entity.other.inherited-class.actionscript.3" |
| 477 |
}, |
| 478 |
"3": { |
| 479 |
"name": "entity.other.inherited-class.actionscript.3" |
| 480 |
} |
| 481 |
}, |
| 482 |
"match": "(?x) \\b(implements)\\b \\s+ ([\\.\\w]+) \\s* (?:, \\s* ([\\.\\w]+))* \\s*", |
| 483 |
"name": "meta.implements.actionscript.3" |
| 484 |
}, |
| 485 |
"import": { |
| 486 |
"captures": { |
| 487 |
"2": { |
| 488 |
"name": "keyword.control.import.actionscript.3" |
| 489 |
}, |
| 490 |
"3": { |
| 491 |
"name": "support.type.actionscript.3" |
| 492 |
} |
| 493 |
}, |
| 494 |
"match": "(?x) (^|\\s+|;) \\b(import)\\b \\s+ ([A-Za-z0-9\\$_\\.]+(?:\\.\\*)?) \\s* (?=;|$)", |
| 495 |
"name": "meta.import.actionscript.3" |
| 496 |
}, |
| 497 |
"interface": { |
| 498 |
"begin": "(?x) (^|\\s+|;) (\\b(internal|public)\\b\\s+)? (?=\\binterface\\b)", |
| 499 |
"beginCaptures": { |
| 500 |
"3": { |
| 501 |
"name": "storage.modifier.actionscript.3" |
| 502 |
} |
| 503 |
}, |
| 504 |
"end": "\\}", |
| 505 |
"name": "meta.interface.actionscript.3", |
| 506 |
"patterns": [ |
| 507 |
{ |
| 508 |
"include": "#interface_declaration" |
| 509 |
}, |
| 510 |
{ |
| 511 |
"include": "#metadata" |
| 512 |
}, |
| 513 |
{ |
| 514 |
"include": "#functions" |
| 515 |
}, |
| 516 |
{ |
| 517 |
"include": "#comments" |
| 518 |
} |
| 519 |
] |
| 520 |
}, |
| 521 |
"interface_declaration": { |
| 522 |
"begin": "(?x) \\b(interface)\\b \\s+ ([\\.\\w]+)", |
| 523 |
"beginCaptures": { |
| 524 |
"1": { |
| 525 |
"name": "storage.type.interface.actionscript.3" |
| 526 |
}, |
| 527 |
"2": { |
| 528 |
"name": "entity.name.class.actionscript.3" |
| 529 |
} |
| 530 |
}, |
| 531 |
"end": "\\{", |
| 532 |
"name": "meta.class_declaration.actionscript.3", |
| 533 |
"patterns": [ |
| 534 |
{ |
| 535 |
"include": "#extends" |
| 536 |
}, |
| 537 |
{ |
| 538 |
"include": "#comments" |
| 539 |
} |
| 540 |
] |
| 541 |
}, |
| 542 |
"language_constants": { |
| 543 |
"match": "\\b(true|false|null|Infinity|-Infinity|NaN|undefined)\\b", |
| 544 |
"name": "constant.language.actionscript.3" |
| 545 |
}, |
| 546 |
"language_variables": { |
| 547 |
"match": "\\b(super|this|arguments)\\b", |
| 548 |
"name": "variable.language.actionscript.3" |
| 549 |
}, |
| 550 |
"logical_operators": { |
| 551 |
"match": "(&|<|~|\\||>|\\^|!|\\?)", |
| 552 |
"name": "keyword.operator.actionscript.3" |
| 553 |
}, |
| 554 |
"metadata_info": { |
| 555 |
"begin": "\\(", |
| 556 |
"end": "\\)", |
| 557 |
"patterns": [ |
| 558 |
{ |
| 559 |
"include": "#strings" |
| 560 |
}, |
| 561 |
{ |
| 562 |
"captures": { |
| 563 |
"1": { |
| 564 |
"name": "variable.parameter.actionscript.3" |
| 565 |
}, |
| 566 |
"2": { |
| 567 |
"name": "keyword.operator.actionscript.3" |
| 568 |
} |
| 569 |
}, |
| 570 |
"match": "(\\w+)\\s*(=)" |
| 571 |
} |
| 572 |
] |
| 573 |
}, |
| 574 |
"method": { |
| 575 |
"begin": "(?x) (^|\\s+) ((\\w+)\\s+)? ((\\w+)\\s+)? ((\\w+)\\s+)? ((\\w+)\\s+)? (?=\\bfunction\\b)", |
| 576 |
"beginCaptures": { |
| 577 |
"3": { |
| 578 |
"name": "storage.modifier.actionscript.3" |
| 579 |
}, |
| 580 |
"5": { |
| 581 |
"name": "storage.modifier.actionscript.3" |
| 582 |
}, |
| 583 |
"7": { |
| 584 |
"name": "storage.modifier.actionscript.3" |
| 585 |
}, |
| 586 |
"8": { |
| 587 |
"name": "storage.modifier.actionscript.3" |
| 588 |
} |
| 589 |
}, |
| 590 |
"end": "(?<=(;|\\}))", |
| 591 |
"name": "meta.method.actionscript.3", |
| 592 |
"patterns": [ |
| 593 |
{ |
| 594 |
"include": "#functions" |
| 595 |
}, |
| 596 |
{ |
| 597 |
"include": "#code_block" |
| 598 |
} |
| 599 |
] |
| 600 |
}, |
| 601 |
"mxml": { |
| 602 |
"begin": "<!\\[CDATA\\[", |
| 603 |
"end": "\\]\\]>", |
| 604 |
"name": "meta.cdata.actionscript.3", |
| 605 |
"patterns": [ |
| 606 |
{ |
| 607 |
"include": "#comments" |
| 608 |
}, |
| 609 |
{ |
| 610 |
"include": "#import" |
| 611 |
}, |
| 612 |
{ |
| 613 |
"include": "#metadata" |
| 614 |
}, |
| 615 |
{ |
| 616 |
"include": "#class" |
| 617 |
}, |
| 618 |
{ |
| 619 |
"include": "#namespace_declaration" |
| 620 |
}, |
| 621 |
{ |
| 622 |
"include": "#use_namespace" |
| 623 |
}, |
| 624 |
{ |
| 625 |
"include": "#class_declaration" |
| 626 |
}, |
| 627 |
{ |
| 628 |
"include": "#method" |
| 629 |
}, |
| 630 |
{ |
| 631 |
"include": "#comments" |
| 632 |
}, |
| 633 |
{ |
| 634 |
"include": "#strings" |
| 635 |
}, |
| 636 |
{ |
| 637 |
"include": "#regexp" |
| 638 |
}, |
| 639 |
{ |
| 640 |
"include": "#numbers" |
| 641 |
}, |
| 642 |
{ |
| 643 |
"include": "#primitive_types" |
| 644 |
}, |
| 645 |
{ |
| 646 |
"include": "#primitive_error_types" |
| 647 |
}, |
| 648 |
{ |
| 649 |
"include": "#dynamic_type" |
| 650 |
}, |
| 651 |
{ |
| 652 |
"include": "#primitive_functions" |
| 653 |
}, |
| 654 |
{ |
| 655 |
"include": "#language_constants" |
| 656 |
}, |
| 657 |
{ |
| 658 |
"include": "#language_variables" |
| 659 |
}, |
| 660 |
{ |
| 661 |
"include": "#other_keywords" |
| 662 |
}, |
| 663 |
{ |
| 664 |
"include": "#guess_type" |
| 665 |
}, |
| 666 |
{ |
| 667 |
"include": "#guess_constant" |
| 668 |
}, |
| 669 |
{ |
| 670 |
"include": "#other_operators" |
| 671 |
}, |
| 672 |
{ |
| 673 |
"include": "#arithmetic_operators" |
| 674 |
}, |
| 675 |
{ |
| 676 |
"include": "#array_access_operators" |
| 677 |
}, |
| 678 |
{ |
| 679 |
"include": "#vector_creation_operators" |
| 680 |
}, |
| 681 |
{ |
| 682 |
"include": "#variable_declaration" |
| 683 |
} |
| 684 |
] |
| 685 |
}, |
| 686 |
"numbers": { |
| 687 |
"match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b", |
| 688 |
"name": "constant.numeric.actionscript.3" |
| 689 |
}, |
| 690 |
"object_literal": { |
| 691 |
"begin": "\\{", |
| 692 |
"end": "\\}", |
| 693 |
"name": "meta.object_literal.actionscript.3", |
| 694 |
"patterns": [ |
| 695 |
{ |
| 696 |
"include": "#object_literal" |
| 697 |
}, |
| 698 |
{ |
| 699 |
"include": "#comments" |
| 700 |
}, |
| 701 |
{ |
| 702 |
"include": "#strings" |
| 703 |
}, |
| 704 |
{ |
| 705 |
"include": "#regexp" |
| 706 |
}, |
| 707 |
{ |
| 708 |
"include": "#numbers" |
| 709 |
}, |
| 710 |
{ |
| 711 |
"include": "#primitive_types" |
| 712 |
}, |
| 713 |
{ |
| 714 |
"include": "#primitive_error_types" |
| 715 |
}, |
| 716 |
{ |
| 717 |
"include": "#dynamic_type" |
| 718 |
}, |
| 719 |
{ |
| 720 |
"include": "#primitive_functions" |
| 721 |
}, |
| 722 |
{ |
| 723 |
"include": "#language_constants" |
| 724 |
}, |
| 725 |
{ |
| 726 |
"include": "#language_variables" |
| 727 |
}, |
| 728 |
{ |
| 729 |
"include": "#guess_type" |
| 730 |
}, |
| 731 |
{ |
| 732 |
"include": "#guess_constant" |
| 733 |
}, |
| 734 |
{ |
| 735 |
"include": "#array_access_operators" |
| 736 |
}, |
| 737 |
{ |
| 738 |
"include": "#vector_creation_operators" |
| 739 |
}, |
| 740 |
{ |
| 741 |
"include": "#functions" |
| 742 |
} |
| 743 |
] |
| 744 |
}, |
| 745 |
"other_keywords": { |
| 746 |
"match": "\\b(as|delete|in|instanceof|is|native|new|to|typeof)\\b", |
| 747 |
"name": "keyword.other.actionscript.3" |
| 748 |
}, |
| 749 |
"other_operators": { |
| 750 |
"match": "(\\.|=)", |
| 751 |
"name": "keyword.operator.actionscript.3" |
| 752 |
}, |
| 753 |
"package": { |
| 754 |
"begin": "(^|\\s+)(package)\\b", |
| 755 |
"beginCaptures": { |
| 756 |
"2": { |
| 757 |
"name": "keyword.other.actionscript.3" |
| 758 |
} |
| 759 |
}, |
| 760 |
"end": "\\}", |
| 761 |
"name": "meta.package.actionscript.3", |
| 762 |
"patterns": [ |
| 763 |
{ |
| 764 |
"include": "#package_name" |
| 765 |
}, |
| 766 |
{ |
| 767 |
"include": "#variable_declaration" |
| 768 |
}, |
| 769 |
{ |
| 770 |
"include": "#method" |
| 771 |
}, |
| 772 |
{ |
| 773 |
"include": "#comments" |
| 774 |
}, |
| 775 |
{ |
| 776 |
"include": "#return_type" |
| 777 |
}, |
| 778 |
{ |
| 779 |
"include": "#import" |
| 780 |
}, |
| 781 |
{ |
| 782 |
"include": "#use_namespace" |
| 783 |
}, |
| 784 |
{ |
| 785 |
"include": "#strings" |
| 786 |
}, |
| 787 |
{ |
| 788 |
"include": "#numbers" |
| 789 |
}, |
| 790 |
{ |
| 791 |
"include": "#language_constants" |
| 792 |
}, |
| 793 |
{ |
| 794 |
"include": "#metadata" |
| 795 |
}, |
| 796 |
{ |
| 797 |
"include": "#class" |
| 798 |
}, |
| 799 |
{ |
| 800 |
"include": "#interface" |
| 801 |
}, |
| 802 |
{ |
| 803 |
"include": "#namespace_declaration" |
| 804 |
} |
| 805 |
] |
| 806 |
}, |
| 807 |
"package_name": { |
| 808 |
"begin": "(?<=package)\\s+([\\w\\._]*)\\b", |
| 809 |
"end": "\\{", |
| 810 |
"name": "meta.package_name.actionscript.3" |
| 811 |
}, |
| 812 |
"primitive_types": { |
| 813 |
"captures": { |
| 814 |
"1": { |
| 815 |
"name": "support.class.builtin.actionscript.3" |
| 816 |
} |
| 817 |
}, |
| 818 |
"match": "\\b(Array|Boolean|Class|Date|Function|int|JSON|Math|Namespace|Number|Object|QName|RegExp|String|uint|Vector|XML|XMLList|\\*(?<=a))\\b" |
| 819 |
}, |
| 820 |
"primitive_error_types": { |
| 821 |
"captures": { |
| 822 |
"1": { |
| 823 |
"name": "support.class.error.actionscript.3" |
| 824 |
} |
| 825 |
}, |
| 826 |
"match": "\\b((Argument|Definition|Eval|Internal|Range|Reference|Security|Syntax|Type|URI|Verify)?Error)\\b" |
| 827 |
}, |
| 828 |
"primitive_functions": { |
| 829 |
"captures": { |
| 830 |
"1": { |
| 831 |
"name": "support.function.actionscript.3" |
| 832 |
} |
| 833 |
}, |
| 834 |
"match": "\\b(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|isFinite|isNaN|isXMLName|parseFloat|parseInt|trace|unescape)(?=\\s*\\()" |
| 835 |
}, |
| 836 |
"regexp": { |
| 837 |
"begin": "(?<=[=(:,\\[]|^|return|&&|\\|\\||!)\\s*(/)(?![/*+{}?])", |
| 838 |
"end": "$|(/)[igm]*", |
| 839 |
"name": "string.regex.actionscript.3", |
| 840 |
"patterns": [ |
| 841 |
{ |
| 842 |
"match": "\\\\.", |
| 843 |
"name": "constant.character.escape.actionscript.3" |
| 844 |
}, |
| 845 |
{ |
| 846 |
"match": "\\[(\\\\\\]|[^\\]])*\\]", |
| 847 |
"name": "constant.character.class.actionscript.3" |
| 848 |
} |
| 849 |
] |
| 850 |
}, |
| 851 |
"return_type": { |
| 852 |
"captures": { |
| 853 |
"1": { |
| 854 |
"name": "keyword.operator.actionscript.3" |
| 855 |
}, |
| 856 |
"2": { |
| 857 |
"name": "support.type.actionscript.3" |
| 858 |
}, |
| 859 |
"3": { |
| 860 |
"name": "support.type.actionscript.3" |
| 861 |
}, |
| 862 |
"4": { |
| 863 |
"name": "support.type.actionscript.3" |
| 864 |
} |
| 865 |
}, |
| 866 |
"match": "(\\:)\\s*(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)" |
| 867 |
}, |
| 868 |
"strings": { |
| 869 |
"patterns": [ |
| 870 |
{ |
| 871 |
"begin": "\"", |
| 872 |
"end": "\"", |
| 873 |
"name": "string.quoted.double.actionscript.3", |
| 874 |
"patterns": [ |
| 875 |
{ |
| 876 |
"include": "#escapes" |
| 877 |
} |
| 878 |
] |
| 879 |
}, |
| 880 |
{ |
| 881 |
"begin": "'", |
| 882 |
"end": "'", |
| 883 |
"name": "string.quoted.single.actionscript.3", |
| 884 |
"patterns": [ |
| 885 |
{ |
| 886 |
"include": "#escapes" |
| 887 |
} |
| 888 |
] |
| 889 |
} |
| 890 |
] |
| 891 |
}, |
| 892 |
"metadata": { |
| 893 |
"begin": "\\[\\s*\\b(\\w+)\\b", |
| 894 |
"beginCaptures": { |
| 895 |
"1": { |
| 896 |
"name": "keyword.other.actionscript.3" |
| 897 |
} |
| 898 |
}, |
| 899 |
"end": "\\]", |
| 900 |
"name": "meta.metadata_info.actionscript.3", |
| 901 |
"patterns": [ |
| 902 |
{ |
| 903 |
"include": "#metadata_info" |
| 904 |
} |
| 905 |
] |
| 906 |
}, |
| 907 |
"use_namespace": { |
| 908 |
"captures": { |
| 909 |
"2": { |
| 910 |
"name": "keyword.other.actionscript.3" |
| 911 |
}, |
| 912 |
"3": { |
| 913 |
"name": "keyword.other.actionscript.3" |
| 914 |
}, |
| 915 |
"4": { |
| 916 |
"name": "storage.modifier.actionscript.3" |
| 917 |
} |
| 918 |
}, |
| 919 |
"match": "(?x) (^|\\s+|;) (use\\s+)? (namespace) \\s+ (\\w+) \\s* (;|$)" |
| 920 |
}, |
| 921 |
"variable_declaration": { |
| 922 |
"captures": { |
| 923 |
"2": { |
| 924 |
"name": "storage.modifier.actionscript.3" |
| 925 |
}, |
| 926 |
"4": { |
| 927 |
"name": "storage.modifier.actionscript.3" |
| 928 |
}, |
| 929 |
"6": { |
| 930 |
"name": "storage.modifier.actionscript.3" |
| 931 |
}, |
| 932 |
"7": { |
| 933 |
"name": "storage.modifier.actionscript.3" |
| 934 |
}, |
| 935 |
"8": { |
| 936 |
"name": "keyword.operator.actionscript.3" |
| 937 |
} |
| 938 |
}, |
| 939 |
"match": "(?x) ((static)\\s+)? ((\\w+)\\s+)? ((static)\\s+)? (const|var) \\s+ (?:[A-Za-z0-9_\\$]+)(?:\\s*(:))?", |
| 940 |
"name": "meta.variable_declaration.actionscript.3" |
| 941 |
}, |
| 942 |
"vector_creation_operators": { |
| 943 |
"match": "(<|>)", |
| 944 |
"name": "keyword.operator.actionscript.3" |
| 945 |
} |
| 946 |
}, |
| 947 |
"scopeName": "source.actionscript.3", |
| 948 |
"uuid": "aa6f75ba-ab10-466e-8c6f-28c69aca1e9d" |
| 949 |
} |
| 950 |
|