View raw

1 { 2 "information_for_contributors": [ 3 "This file has been converted from https://github.com/sumneko/lua.tmbundle/blob/master/Syntaxes/Lua.plist", 4 "If you want to provide a fix or improvement, please create a pull request against the original repository.", 5 "Once accepted there, we are happy to receive an update request." 6 ], 7 "version": "https://github.com/sumneko/lua.tmbundle/commit/b295d83bf0e91b5d3a69eb097f9ed351623b95be", 8 "name": "Lua", 9 "scopeName": "source.lua", 10 "patterns": [ 11 { 12 "begin": "\\b(?:(local)\\s+)?(function)\\b(?![,:])", 13 "beginCaptures": { 14 "1": { 15 "name": "keyword.local.lua" 16 }, 17 "2": { 18 "name": "keyword.control.lua" 19 } 20 }, 21 "end": "(?<=[\\)\\-{}\\[\\]\"'])", 22 "name": "meta.function.lua", 23 "patterns": [ 24 { 25 "include": "#comment" 26 }, 27 { 28 "begin": "(\\()", 29 "beginCaptures": { 30 "1": { 31 "name": "punctuation.definition.parameters.begin.lua" 32 } 33 }, 34 "end": "(\\))|(?=[\\-{}\\[\\]\"'])|(?<!\\.)\\.(?!\\.)", 35 "endCaptures": { 36 "1": { 37 "name": "punctuation.definition.parameters.finish.lua" 38 } 39 }, 40 "name": "meta.parameter.lua", 41 "patterns": [ 42 { 43 "include": "#comment" 44 }, 45 { 46 "match": "(\\.{3})\\s*([a-zA-Z_][a-zA-Z0-9_]*)", 47 "captures": { 48 "1": { 49 "name": "constant.language.lua" 50 }, 51 "2": { 52 "name": "variable.parameter.function.lua" 53 } 54 } 55 }, 56 { 57 "match": "[a-zA-Z_][a-zA-Z0-9_]*", 58 "name": "variable.parameter.function.lua" 59 }, 60 { 61 "match": ",", 62 "name": "punctuation.separator.arguments.lua" 63 }, 64 { 65 "begin": ":", 66 "beginCaptures": { 67 "0": { 68 "name": "punctuation.separator.arguments.lua" 69 } 70 }, 71 "end": "(?=[\\),])", 72 "patterns": [ 73 { 74 "include": "#emmydoc.type" 75 } 76 ] 77 } 78 ] 79 }, 80 { 81 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s*(?=:)", 82 "name": "entity.name.class.lua" 83 }, 84 { 85 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b", 86 "name": "entity.name.function.lua" 87 } 88 ] 89 }, 90 { 91 "match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(\\.[0-9A-Fa-f]*)?([eE]-?\\d*)?([pP][-+]\\d+)?", 92 "name": "constant.numeric.float.hexadecimal.lua" 93 }, 94 { 95 "match": "(?<![\\w\\d.])0[xX]\\.[0-9A-Fa-f]+([eE]-?\\d*)?([pP][-+]\\d+)?", 96 "name": "constant.numeric.float.hexadecimal.lua" 97 }, 98 { 99 "match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(?![pPeE.0-9])", 100 "name": "constant.numeric.integer.hexadecimal.lua" 101 }, 102 { 103 "match": "(?<![\\w\\d.])\\d+(\\.\\d*)?([eE]-?\\d*)?", 104 "name": "constant.numeric.float.lua" 105 }, 106 { 107 "match": "(?<![\\w\\d.])\\.\\d+([eE]-?\\d*)?", 108 "name": "constant.numeric.float.lua" 109 }, 110 { 111 "match": "(?<![\\w\\d.])\\d+(?![pPeE.0-9])", 112 "name": "constant.numeric.integer.lua" 113 }, 114 { 115 "include": "#string" 116 }, 117 { 118 "captures": { 119 "1": { 120 "name": "punctuation.definition.comment.lua" 121 } 122 }, 123 "match": "\\A(#!).*$\\n?", 124 "name": "comment.line.shebang.lua" 125 }, 126 { 127 "include": "#comment" 128 }, 129 { 130 "captures": { 131 "1": { 132 "name": "keyword.control.goto.lua" 133 }, 134 "2": { 135 "name": "string.tag.lua" 136 } 137 }, 138 "match": "\\b(goto)\\s+([a-zA-Z_][a-zA-Z0-9_]*)" 139 }, 140 { 141 "captures": { 142 "1": { 143 "name": "punctuation.section.embedded.begin.lua" 144 }, 145 "2": { 146 "name": "punctuation.section.embedded.end.lua" 147 } 148 }, 149 "match": "(::)\\s*[a-zA-Z_][a-zA-Z0-9_]*\\s*(::)", 150 "name": "string.tag.lua" 151 }, 152 { 153 "match": "<\\s*(const|close)\\s*>", 154 "captures": { 155 "0": { 156 "name": "storage.type.attribute.lua" 157 } 158 } 159 }, 160 { 161 "match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>", 162 "name": "storage.type.generic.lua" 163 }, 164 { 165 "match": "\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in)\\b", 166 "name": "keyword.control.lua" 167 }, 168 { 169 "match": "\\b(local)\\b", 170 "name": "keyword.local.lua" 171 }, 172 { 173 "match": "^\\s*(global)\\b(?!\\s*=)", 174 "captures": { 175 "1": { 176 "name": "keyword.global.lua" 177 } 178 } 179 }, 180 { 181 "match": "\\b(function)\\b(?![,:])", 182 "name": "keyword.control.lua" 183 }, 184 { 185 "match": "(?<![^.]\\.|:)\\b(false|nil(?!:)|true|_ENV|_G|_VERSION|math\\.(pi|huge|maxinteger|mininteger)|utf8\\.charpattern|io\\.(stdin|stdout|stderr)|package\\.(config|cpath|loaded|loaders|path|preload|searchers))\\b|(?<![.])\\.{3}(?!\\.)", 186 "name": "constant.language.lua" 187 }, 188 { 189 "match": "(?<![^.]\\.|:)\\b(self)\\b", 190 "name": "variable.language.self.lua" 191 }, 192 { 193 "match": "(?<![^.]\\.|:)\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\b(?!\\s*=(?!=))", 194 "name": "support.function.lua" 195 }, 196 { 197 "match": "(?<![^.]\\.|:)\\b(async)\\b(?!\\s*=(?!=))", 198 "name": "entity.name.tag.lua" 199 }, 200 { 201 "match": "(?<![^.]\\.|:)\\b(coroutine\\.(create|isyieldable|close|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)|table\\.(concat|create|insert|maxn|move|pack|remove|sort|unpack)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?|tointeger|type)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(loadlib|seeall|searchpath)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|[gs]etuservalue|set[Cc]stacklimit|traceback|upvalueid|upvaluejoin)|bit32\\.(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)|utf8\\.(char|codes|codepoint|len|offset))\\b(?!\\s*=(?!=))", 202 "name": "support.function.library.lua" 203 }, 204 { 205 "match": "\\b(\\|\\||\\&\\&|\\!)\\b", 206 "name": "keyword.operator.lua" 207 }, 208 { 209 "match": "\\b(and|or|not)\\b", 210 "name": "keyword.operator.logical.lua" 211 }, 212 { 213 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*(?:[({\"']|\\[\\[))", 214 "name": "support.function.any-method.lua" 215 }, 216 { 217 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*\\??:)", 218 "name": "entity.name.class.lua" 219 }, 220 { 221 "match": "(?<=[^.]\\.|:)\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)", 222 "name": "entity.other.attribute.lua" 223 }, 224 { 225 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)", 226 "name": "variable.other.lua" 227 }, 228 { 229 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*=\\s*\\b(function)\\b)", 230 "name": "entity.name.function.lua" 231 }, 232 { 233 "match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|!=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)", 234 "name": "keyword.operator.lua" 235 } 236 ], 237 "repository": { 238 "escaped_char": { 239 "patterns": [ 240 { 241 "match": "\\\\[abfnrtv\\\\\"'\\n]", 242 "name": "constant.character.escape.lua" 243 }, 244 { 245 "match": "\\\\z[\\n\\t ]*", 246 "name": "constant.character.escape.lua" 247 }, 248 { 249 "match": "\\\\\\d{1,3}", 250 "name": "constant.character.escape.byte.lua" 251 }, 252 { 253 "match": "\\\\x[0-9A-Fa-f][0-9A-Fa-f]", 254 "name": "constant.character.escape.byte.lua" 255 }, 256 { 257 "match": "\\\\u\\{[0-9A-Fa-f]+\\}", 258 "name": "constant.character.escape.unicode.lua" 259 }, 260 { 261 "match": "\\\\.", 262 "name": "invalid.illegal.character.escape.lua" 263 } 264 ] 265 }, 266 "string": { 267 "patterns": [ 268 { 269 "begin": "'", 270 "beginCaptures": { 271 "0": { 272 "name": "punctuation.definition.string.begin.lua" 273 } 274 }, 275 "end": "'[ \\t]*|(?=\\n)", 276 "endCaptures": { 277 "0": { 278 "name": "punctuation.definition.string.end.lua" 279 } 280 }, 281 "name": "string.quoted.single.lua", 282 "patterns": [ 283 { 284 "include": "#escaped_char" 285 } 286 ] 287 }, 288 { 289 "begin": "\"", 290 "beginCaptures": { 291 "0": { 292 "name": "punctuation.definition.string.begin.lua" 293 } 294 }, 295 "end": "\"[ \\t]*|(?=\\n)", 296 "endCaptures": { 297 "0": { 298 "name": "punctuation.definition.string.end.lua" 299 } 300 }, 301 "name": "string.quoted.double.lua", 302 "patterns": [ 303 { 304 "include": "#escaped_char" 305 } 306 ] 307 }, 308 { 309 "begin": "`", 310 "beginCaptures": { 311 "0": { 312 "name": "punctuation.definition.string.begin.lua" 313 } 314 }, 315 "end": "`[ \\t]*|(?=\\n)", 316 "endCaptures": { 317 "0": { 318 "name": "punctuation.definition.string.end.lua" 319 } 320 }, 321 "name": "string.quoted.double.lua" 322 }, 323 { 324 "begin": "(?<=\\.cdef)\\s*(\\[(=*)\\[)", 325 "beginCaptures": { 326 "0": { 327 "name": "string.quoted.other.multiline.lua" 328 }, 329 "1": { 330 "name": "punctuation.definition.string.begin.lua" 331 } 332 }, 333 "contentName": "meta.embedded.lua", 334 "end": "(\\]\\2\\])[ \\t]*", 335 "endCaptures": { 336 "0": { 337 "name": "string.quoted.other.multiline.lua" 338 }, 339 "1": { 340 "name": "punctuation.definition.string.end.lua" 341 } 342 }, 343 "patterns": [ 344 { 345 "include": "source.c" 346 } 347 ] 348 }, 349 { 350 "begin": "(?<!--)\\[(=*)\\[", 351 "beginCaptures": { 352 "0": { 353 "name": "punctuation.definition.string.begin.lua" 354 } 355 }, 356 "end": "\\]\\1\\][ \\t]*", 357 "endCaptures": { 358 "0": { 359 "name": "punctuation.definition.string.end.lua" 360 } 361 }, 362 "name": "string.quoted.other.multiline.lua" 363 } 364 ] 365 }, 366 "comment": { 367 "patterns": [ 368 { 369 "begin": "(^[ \\t]+)?(?=--)", 370 "beginCaptures": { 371 "1": { 372 "name": "punctuation.whitespace.comment.leading.lua" 373 } 374 }, 375 "end": "(?!\\G)((?!^)[ \\t]+\\n)?", 376 "endCaptures": { 377 "1": { 378 "name": "punctuation.whitespace.comment.trailing.lua" 379 } 380 }, 381 "patterns": [ 382 { 383 "begin": "--\\[(=*)\\[@@@", 384 "beginCaptures": { 385 "0": { 386 "name": "punctuation.definition.comment.begin.lua" 387 } 388 }, 389 "end": "(--)?\\]\\1\\]", 390 "endCaptures": { 391 "0": { 392 "name": "punctuation.definition.comment.end.lua" 393 } 394 }, 395 "name": "", 396 "patterns": [ 397 { 398 "include": "source.lua" 399 } 400 ] 401 }, 402 { 403 "begin": "--\\[(=*)\\[", 404 "beginCaptures": { 405 "0": { 406 "name": "punctuation.definition.comment.begin.lua" 407 } 408 }, 409 "end": "(--)?\\]\\1\\]", 410 "endCaptures": { 411 "0": { 412 "name": "punctuation.definition.comment.end.lua" 413 } 414 }, 415 "name": "comment.block.lua", 416 "patterns": [ 417 { 418 "include": "#emmydoc" 419 }, 420 { 421 "include": "#ldoc_tag" 422 } 423 ] 424 }, 425 { 426 "begin": "----", 427 "beginCaptures": { 428 "0": { 429 "name": "punctuation.definition.comment.lua" 430 } 431 }, 432 "end": "\\n", 433 "name": "comment.line.double-dash.lua" 434 }, 435 { 436 "begin": "---", 437 "beginCaptures": { 438 "0": { 439 "name": "punctuation.definition.comment.lua" 440 } 441 }, 442 "end": "\\n", 443 "name": "comment.line.double-dash.documentation.lua", 444 "patterns": [ 445 { 446 "include": "#emmydoc" 447 }, 448 { 449 "include": "#ldoc_tag" 450 } 451 ] 452 }, 453 { 454 "begin": "--", 455 "beginCaptures": { 456 "0": { 457 "name": "punctuation.definition.comment.lua" 458 } 459 }, 460 "end": "\\n", 461 "name": "comment.line.double-dash.lua", 462 "patterns": [ 463 { 464 "include": "#ldoc_tag" 465 } 466 ] 467 } 468 ] 469 }, 470 { 471 "begin": "\\/\\*", 472 "beginCaptures": { 473 "0": { 474 "name": "punctuation.definition.comment.begin.lua" 475 } 476 }, 477 "end": "\\*\\/", 478 "endCaptures": { 479 "0": { 480 "name": "punctuation.definition.comment.end.lua" 481 } 482 }, 483 "name": "comment.block.lua", 484 "patterns": [ 485 { 486 "include": "#emmydoc" 487 }, 488 { 489 "include": "#ldoc_tag" 490 } 491 ] 492 } 493 ] 494 }, 495 "emmydoc": { 496 "patterns": [ 497 { 498 "begin": "(?<=---)[ \\t]*@class", 499 "beginCaptures": { 500 "0": { 501 "name": "storage.type.annotation.lua" 502 } 503 }, 504 "end": "(?=[\\n@#])", 505 "patterns": [ 506 { 507 "match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)", 508 "name": "support.class.lua" 509 }, 510 { 511 "match": ":|,", 512 "name": "keyword.operator.lua" 513 } 514 ] 515 }, 516 { 517 "begin": "(?<=---)[ \\t]*@enum", 518 "beginCaptures": { 519 "0": { 520 "name": "storage.type.annotation.lua" 521 } 522 }, 523 "end": "(?=[\\n@#])", 524 "patterns": [ 525 { 526 "begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)", 527 "beginCaptures": { 528 "0": { 529 "name": "variable.lua" 530 } 531 }, 532 "end": "(?=\\n)" 533 } 534 ] 535 }, 536 { 537 "begin": "(?<=---)[ \\t]*@type", 538 "beginCaptures": { 539 "0": { 540 "name": "storage.type.annotation.lua" 541 } 542 }, 543 "end": "(?=[\\n@#])", 544 "patterns": [ 545 { 546 "include": "#emmydoc.type" 547 } 548 ] 549 }, 550 { 551 "begin": "(?<=---)[ \\t]*@alias", 552 "beginCaptures": { 553 "0": { 554 "name": "storage.type.annotation.lua" 555 } 556 }, 557 "end": "(?=[\\n@#])", 558 "patterns": [ 559 { 560 "begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)", 561 "beginCaptures": { 562 "0": { 563 "name": "variable.lua" 564 } 565 }, 566 "end": "(?=[\\n#])", 567 "patterns": [ 568 { 569 "include": "#emmydoc.type" 570 } 571 ] 572 } 573 ] 574 }, 575 { 576 "begin": "(?<=---)[ \\t]*(@operator)\\s*(\\b[a-z]+)?", 577 "beginCaptures": { 578 "1": { 579 "name": "storage.type.annotation.lua" 580 }, 581 "2": { 582 "name": "support.function.library.lua" 583 } 584 }, 585 "end": "(?=[\\n@#])", 586 "patterns": [ 587 { 588 "include": "#emmydoc.type" 589 } 590 ] 591 }, 592 { 593 "begin": "(?<=---)[ \\t]*@cast", 594 "beginCaptures": { 595 "0": { 596 "name": "storage.type.annotation.lua" 597 } 598 }, 599 "end": "(?=[\\n@#])", 600 "patterns": [ 601 { 602 "begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)", 603 "beginCaptures": { 604 "0": { 605 "name": "variable.other.lua" 606 } 607 }, 608 "end": "(?=\\n)", 609 "patterns": [ 610 { 611 "include": "#emmydoc.type" 612 }, 613 { 614 "match": "([+-|])", 615 "name": "keyword.operator.lua" 616 } 617 ] 618 } 619 ] 620 }, 621 { 622 "begin": "(?<=---)[ \\t]*@param", 623 "beginCaptures": { 624 "0": { 625 "name": "storage.type.annotation.lua" 626 } 627 }, 628 "end": "(?=[\\n@#])", 629 "patterns": [ 630 { 631 "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(\\??)", 632 "beginCaptures": { 633 "1": { 634 "name": "entity.name.variable.lua" 635 }, 636 "2": { 637 "name": "keyword.operator.lua" 638 } 639 }, 640 "end": "(?=[\\n#])", 641 "patterns": [ 642 { 643 "include": "#emmydoc.type" 644 } 645 ] 646 } 647 ] 648 }, 649 { 650 "begin": "(?<=---)[ \\t]*@return", 651 "beginCaptures": { 652 "0": { 653 "name": "storage.type.annotation.lua" 654 } 655 }, 656 "end": "(?=[\\n@#])", 657 "patterns": [ 658 { 659 "match": "\\?", 660 "name": "keyword.operator.lua" 661 }, 662 { 663 "include": "#emmydoc.type" 664 } 665 ] 666 }, 667 { 668 "begin": "(?<=---)[ \\t]*@field", 669 "beginCaptures": { 670 "0": { 671 "name": "storage.type.annotation.lua" 672 } 673 }, 674 "end": "(?=[\\n@#])", 675 "patterns": [ 676 { 677 "begin": "(\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b|(\\[))(\\??)", 678 "beginCaptures": { 679 "2": { 680 "name": "entity.name.variable.lua" 681 }, 682 "3": { 683 "name": "keyword.operator.lua" 684 } 685 }, 686 "end": "(?=[\\n#])", 687 "patterns": [ 688 { 689 "include": "#string" 690 }, 691 { 692 "include": "#emmydoc.type" 693 }, 694 { 695 "match": "\\]", 696 "name": "keyword.operator.lua" 697 } 698 ] 699 } 700 ] 701 }, 702 { 703 "begin": "(?<=---)[ \\t]*@generic", 704 "beginCaptures": { 705 "0": { 706 "name": "storage.type.annotation.lua" 707 } 708 }, 709 "end": "(?=[\\n@#])", 710 "patterns": [ 711 { 712 "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b", 713 "beginCaptures": { 714 "0": { 715 "name": "storage.type.generic.lua" 716 } 717 }, 718 "end": "(?=\\n)|(,)", 719 "endCaptures": { 720 "0": { 721 "name": "keyword.operator.lua" 722 } 723 }, 724 "patterns": [ 725 { 726 "match": ":", 727 "name": "keyword.operator.lua" 728 }, 729 { 730 "include": "#emmydoc.type" 731 } 732 ] 733 } 734 ] 735 }, 736 { 737 "begin": "(?<=---)[ \\t]*@vararg", 738 "beginCaptures": { 739 "0": { 740 "name": "storage.type.annotation.lua" 741 } 742 }, 743 "end": "(?=[\\n@#])", 744 "patterns": [ 745 { 746 "include": "#emmydoc.type" 747 } 748 ] 749 }, 750 { 751 "begin": "(?<=---)[ \\t]*@overload", 752 "beginCaptures": { 753 "0": { 754 "name": "storage.type.annotation.lua" 755 } 756 }, 757 "end": "(?=[\\n@#])", 758 "patterns": [ 759 { 760 "include": "#emmydoc.type" 761 } 762 ] 763 }, 764 { 765 "begin": "(?<=---)[ \\t]*@deprecated", 766 "beginCaptures": { 767 "0": { 768 "name": "storage.type.annotation.lua" 769 } 770 }, 771 "end": "(?=[\\n@#])" 772 }, 773 { 774 "begin": "(?<=---)[ \\t]*@meta", 775 "beginCaptures": { 776 "0": { 777 "name": "storage.type.annotation.lua" 778 } 779 }, 780 "end": "(?=[\\n@#])" 781 }, 782 { 783 "begin": "(?<=---)[ \\t]*@private", 784 "beginCaptures": { 785 "0": { 786 "name": "storage.type.annotation.lua" 787 } 788 }, 789 "end": "(?=[\\n@#])" 790 }, 791 { 792 "begin": "(?<=---)[ \\t]*@protected", 793 "beginCaptures": { 794 "0": { 795 "name": "storage.type.annotation.lua" 796 } 797 }, 798 "end": "(?=[\\n@#])" 799 }, 800 { 801 "begin": "(?<=---)[ \\t]*@package", 802 "beginCaptures": { 803 "0": { 804 "name": "storage.type.annotation.lua" 805 } 806 }, 807 "end": "(?=[\\n@#])" 808 }, 809 { 810 "begin": "(?<=---)[ \\t]*@version", 811 "beginCaptures": { 812 "0": { 813 "name": "storage.type.annotation.lua" 814 } 815 }, 816 "end": "(?=[\\n@#])", 817 "patterns": [ 818 { 819 "match": "\\b(5\\.1|5\\.2|5\\.3|5\\.4|JIT)\\b", 820 "name": "support.class.lua" 821 }, 822 { 823 "match": ",|\\>|\\<", 824 "name": "keyword.operator.lua" 825 } 826 ] 827 }, 828 { 829 "begin": "(?<=---)[ \\t]*@see", 830 "beginCaptures": { 831 "0": { 832 "name": "storage.type.annotation.lua" 833 } 834 }, 835 "end": "(?=[\\n@#])", 836 "patterns": [ 837 { 838 "match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)", 839 "name": "support.class.lua" 840 }, 841 { 842 "match": "#", 843 "name": "keyword.operator.lua" 844 } 845 ] 846 }, 847 { 848 "begin": "(?<=---)[ \\t]*@diagnostic", 849 "beginCaptures": { 850 "0": { 851 "name": "storage.type.annotation.lua" 852 } 853 }, 854 "end": "(?=[\\n@#])", 855 "patterns": [ 856 { 857 "begin": "([a-zA-Z_\\-0-9]+)[ \\t]*(:)?", 858 "beginCaptures": { 859 "1": { 860 "name": "keyword.other.unit" 861 }, 862 "2": { 863 "name": "keyword.operator.unit" 864 } 865 }, 866 "end": "(?=\\n)", 867 "patterns": [ 868 { 869 "match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\-]*)", 870 "name": "support.class.lua" 871 }, 872 { 873 "match": ",", 874 "name": "keyword.operator.lua" 875 } 876 ] 877 } 878 ] 879 }, 880 { 881 "begin": "(?<=---)[ \\t]*@module", 882 "beginCaptures": { 883 "0": { 884 "name": "storage.type.annotation.lua" 885 } 886 }, 887 "end": "(?=[\\n@#])", 888 "patterns": [ 889 { 890 "include": "#string" 891 } 892 ] 893 }, 894 { 895 "match": "(?<=---)[ \\t]*@(async|nodiscard)", 896 "name": "storage.type.annotation.lua" 897 }, 898 { 899 "begin": "(?<=---)\\|\\s*[\\>\\+]?", 900 "beginCaptures": { 901 "0": { 902 "name": "storage.type.annotation.lua" 903 } 904 }, 905 "end": "(?=[\\n@#])", 906 "patterns": [ 907 { 908 "include": "#string" 909 } 910 ] 911 } 912 ] 913 }, 914 "emmydoc.type": { 915 "patterns": [ 916 { 917 "begin": "\\bfun\\b", 918 "beginCaptures": { 919 "0": { 920 "name": "keyword.control.lua" 921 } 922 }, 923 "end": "(?=[\\s#])", 924 "patterns": [ 925 { 926 "match": "[\\(\\),\\:\\?\\[\\]\\<\\>][ \\t]*", 927 "name": "keyword.operator.lua" 928 }, 929 { 930 "match": "([a-zA-Z_][a-zA-Z0-9_\\.\\*\\-]*)(?<!,)[ \\t]*(?=\\??:)", 931 "name": "entity.name.variable.lua" 932 }, 933 { 934 "include": "#emmydoc.type" 935 }, 936 { 937 "include": "#string" 938 } 939 ] 940 }, 941 { 942 "match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>", 943 "name": "storage.type.generic.lua" 944 }, 945 { 946 "match": "\\basync\\b", 947 "name": "entity.name.tag.lua" 948 }, 949 { 950 "match": "[\\{\\}\\:\\,\\?\\|\\`][ \\t]*", 951 "name": "keyword.operator.lua" 952 }, 953 { 954 "begin": "(?=[a-zA-Z_\\.\\*\"'\\[])", 955 "end": "(?=[\\s\\)\\,\\?\\:\\}\\|#])", 956 "patterns": [ 957 { 958 "match": "([a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?<!,)[ \\t]*", 959 "name": "support.type.lua" 960 }, 961 { 962 "match": "(\\.\\.\\.)[ \\t]*", 963 "name": "constant.language.lua" 964 }, 965 { 966 "include": "#string" 967 } 968 ] 969 } 970 ] 971 }, 972 "ldoc_tag": { 973 "match": "\\G[ \\t]*(@)(alias|annotation|author|charset|class|classmod|comment|constructor|copyright|description|example|export|factory|field|file|fixme|function|include|lfunction|license|local|module|name|param|pragma|private|raise|release|return|script|section|see|set|static|submodule|summary|tfield|thread|tparam|treturn|todo|topic|type|usage|warning|within)\\b", 974 "captures": { 975 "1": { 976 "name": "punctuation.definition.block.tag.ldoc" 977 }, 978 "2": { 979 "name": "storage.type.class.ldoc" 980 } 981 } 982 } 983 } 984 }