PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.2
Code Block Pro – Beautiful Syntax Highlighting v1.27.2
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / lua.tmLanguage.json

lua.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.27.2, at build/shiki/languages/lua.tmLanguage.json

962 lines 26.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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/94ce82cc4d45f82641a5252d7a7fd9e28c875adc",
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": "[a-zA-Z_][a-zA-Z0-9_]*",
47 "name": "variable.parameter.function.lua"
48 },
49 {
50 "match": ",",
51 "name": "punctuation.separator.arguments.lua"
52 },
53 {
54 "begin": ":",
55 "beginCaptures": {
56 "0": {
57 "name": "punctuation.separator.arguments.lua"
58 }
59 },
60 "end": "(?=[\\),])",
61 "patterns": [
62 {
63 "include": "#emmydoc.type"
64 }
65 ]
66 }
67 ]
68 },
69 {
70 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s*(?=:)",
71 "name": "entity.name.class.lua"
72 },
73 {
74 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
75 "name": "entity.name.function.lua"
76 }
77 ]
78 },
79 {
80 "match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(\\.[0-9A-Fa-f]*)?([eE]-?\\d*)?([pP][-+]\\d+)?",
81 "name": "constant.numeric.float.hexadecimal.lua"
82 },
83 {
84 "match": "(?<![\\w\\d.])0[xX]\\.[0-9A-Fa-f]+([eE]-?\\d*)?([pP][-+]\\d+)?",
85 "name": "constant.numeric.float.hexadecimal.lua"
86 },
87 {
88 "match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(?![pPeE.0-9])",
89 "name": "constant.numeric.integer.hexadecimal.lua"
90 },
91 {
92 "match": "(?<![\\w\\d.])\\d+(\\.\\d*)?([eE]-?\\d*)?",
93 "name": "constant.numeric.float.lua"
94 },
95 {
96 "match": "(?<![\\w\\d.])\\.\\d+([eE]-?\\d*)?",
97 "name": "constant.numeric.float.lua"
98 },
99 {
100 "match": "(?<![\\w\\d.])\\d+(?![pPeE.0-9])",
101 "name": "constant.numeric.integer.lua"
102 },
103 {
104 "include": "#string"
105 },
106 {
107 "captures": {
108 "1": {
109 "name": "punctuation.definition.comment.lua"
110 }
111 },
112 "match": "\\A(#!).*$\\n?",
113 "name": "comment.line.shebang.lua"
114 },
115 {
116 "include": "#comment"
117 },
118 {
119 "captures": {
120 "1": {
121 "name": "keyword.control.goto.lua"
122 },
123 "2": {
124 "name": "string.tag.lua"
125 }
126 },
127 "match": "\\b(goto)\\s+([a-zA-Z_][a-zA-Z0-9_]*)"
128 },
129 {
130 "captures": {
131 "1": {
132 "name": "punctuation.section.embedded.begin.lua"
133 },
134 "2": {
135 "name": "punctuation.section.embedded.end.lua"
136 }
137 },
138 "match": "(::)\\s*[a-zA-Z_][a-zA-Z0-9_]*\\s*(::)",
139 "name": "string.tag.lua"
140 },
141 {
142 "match": "<\\s*(const|close)\\s*>",
143 "captures": {
144 "1": {
145 "name": "string.tag.lua"
146 }
147 }
148 },
149 {
150 "match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>",
151 "name": "storage.type.generic.lua"
152 },
153 {
154 "match": "\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in)\\b",
155 "name": "keyword.control.lua"
156 },
157 {
158 "match": "\\b(local|global)\\b",
159 "name": "keyword.local.lua"
160 },
161 {
162 "match": "\\b(function)\\b(?![,:])",
163 "name": "keyword.control.lua"
164 },
165 {
166 "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}(?!\\.)",
167 "name": "constant.language.lua"
168 },
169 {
170 "match": "(?<![^.]\\.|:)\\b(self)\\b",
171 "name": "variable.language.self.lua"
172 },
173 {
174 "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*=(?!=))",
175 "name": "support.function.lua"
176 },
177 {
178 "match": "(?<![^.]\\.|:)\\b(async)\\b(?!\\s*=(?!=))",
179 "name": "entity.name.tag.lua"
180 },
181 {
182 "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|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*=(?!=))",
183 "name": "support.function.library.lua"
184 },
185 {
186 "match": "\\b(and|or|not|\\|\\||\\&\\&|\\!)\\b",
187 "name": "keyword.operator.lua"
188 },
189 {
190 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*(?:[({\"']|\\[\\[))",
191 "name": "support.function.any-method.lua"
192 },
193 {
194 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*\\??:)",
195 "name": "entity.name.class.lua"
196 },
197 {
198 "match": "(?<=[^.]\\.|:)\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)",
199 "name": "entity.other.attribute.lua"
200 },
201 {
202 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?!\\s*=\\s*\\b(function)\\b)",
203 "name": "variable.other.lua"
204 },
205 {
206 "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(?=\\s*=\\s*\\b(function)\\b)",
207 "name": "entity.name.function.lua"
208 },
209 {
210 "match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|!=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
211 "name": "keyword.operator.lua"
212 }
213 ],
214 "repository": {
215 "escaped_char": {
216 "patterns": [
217 {
218 "match": "\\\\[abfnrtv\\\\\"'\\n]",
219 "name": "constant.character.escape.lua"
220 },
221 {
222 "match": "\\\\z[\\n\\t ]*",
223 "name": "constant.character.escape.lua"
224 },
225 {
226 "match": "\\\\\\d{1,3}",
227 "name": "constant.character.escape.byte.lua"
228 },
229 {
230 "match": "\\\\x[0-9A-Fa-f][0-9A-Fa-f]",
231 "name": "constant.character.escape.byte.lua"
232 },
233 {
234 "match": "\\\\u\\{[0-9A-Fa-f]+\\}",
235 "name": "constant.character.escape.unicode.lua"
236 },
237 {
238 "match": "\\\\.",
239 "name": "invalid.illegal.character.escape.lua"
240 }
241 ]
242 },
243 "string": {
244 "patterns": [
245 {
246 "begin": "'",
247 "beginCaptures": {
248 "0": {
249 "name": "punctuation.definition.string.begin.lua"
250 }
251 },
252 "end": "'[ \\t]*|(?=\\n)",
253 "endCaptures": {
254 "0": {
255 "name": "punctuation.definition.string.end.lua"
256 }
257 },
258 "name": "string.quoted.single.lua",
259 "patterns": [
260 {
261 "include": "#escaped_char"
262 }
263 ]
264 },
265 {
266 "begin": "\"",
267 "beginCaptures": {
268 "0": {
269 "name": "punctuation.definition.string.begin.lua"
270 }
271 },
272 "end": "\"[ \\t]*|(?=\\n)",
273 "endCaptures": {
274 "0": {
275 "name": "punctuation.definition.string.end.lua"
276 }
277 },
278 "name": "string.quoted.double.lua",
279 "patterns": [
280 {
281 "include": "#escaped_char"
282 }
283 ]
284 },
285 {
286 "begin": "`",
287 "beginCaptures": {
288 "0": {
289 "name": "punctuation.definition.string.begin.lua"
290 }
291 },
292 "end": "`[ \\t]*|(?=\\n)",
293 "endCaptures": {
294 "0": {
295 "name": "punctuation.definition.string.end.lua"
296 }
297 },
298 "name": "string.quoted.double.lua"
299 },
300 {
301 "begin": "(?<=\\.cdef)\\s*(\\[(=*)\\[)",
302 "beginCaptures": {
303 "0": {
304 "name": "string.quoted.other.multiline.lua"
305 },
306 "1": {
307 "name": "punctuation.definition.string.begin.lua"
308 }
309 },
310 "contentName": "meta.embedded.lua",
311 "end": "(\\]\\2\\])[ \\t]*",
312 "endCaptures": {
313 "0": {
314 "name": "string.quoted.other.multiline.lua"
315 },
316 "1": {
317 "name": "punctuation.definition.string.end.lua"
318 }
319 },
320 "patterns": [
321 {
322 "include": "source.c"
323 }
324 ]
325 },
326 {
327 "begin": "(?<!--)\\[(=*)\\[",
328 "beginCaptures": {
329 "0": {
330 "name": "punctuation.definition.string.begin.lua"
331 }
332 },
333 "end": "\\]\\1\\][ \\t]*",
334 "endCaptures": {
335 "0": {
336 "name": "punctuation.definition.string.end.lua"
337 }
338 },
339 "name": "string.quoted.other.multiline.lua"
340 }
341 ]
342 },
343 "comment": {
344 "patterns": [
345 {
346 "begin": "(^[ \\t]+)?(?=--)",
347 "beginCaptures": {
348 "1": {
349 "name": "punctuation.whitespace.comment.leading.lua"
350 }
351 },
352 "end": "(?!\\G)((?!^)[ \\t]+\\n)?",
353 "endCaptures": {
354 "1": {
355 "name": "punctuation.whitespace.comment.trailing.lua"
356 }
357 },
358 "patterns": [
359 {
360 "begin": "--\\[(=*)\\[@@@",
361 "beginCaptures": {
362 "0": {
363 "name": "punctuation.definition.comment.begin.lua"
364 }
365 },
366 "end": "\\]\\1\\]",
367 "endCaptures": {
368 "0": {
369 "name": "punctuation.definition.comment.end.lua"
370 }
371 },
372 "name": "",
373 "patterns": [
374 {
375 "include": "source.lua"
376 }
377 ]
378 },
379 {
380 "begin": "--\\[(=*)\\[",
381 "beginCaptures": {
382 "0": {
383 "name": "punctuation.definition.comment.begin.lua"
384 }
385 },
386 "end": "\\]\\1\\]",
387 "endCaptures": {
388 "0": {
389 "name": "punctuation.definition.comment.end.lua"
390 }
391 },
392 "name": "comment.block.lua",
393 "patterns": [
394 {
395 "include": "#emmydoc"
396 },
397 {
398 "include": "#ldoc_tag"
399 }
400 ]
401 },
402 {
403 "begin": "----",
404 "beginCaptures": {
405 "0": {
406 "name": "punctuation.definition.comment.lua"
407 }
408 },
409 "end": "\\n",
410 "name": "comment.line.double-dash.lua"
411 },
412 {
413 "begin": "---",
414 "beginCaptures": {
415 "0": {
416 "name": "punctuation.definition.comment.lua"
417 }
418 },
419 "end": "\\n",
420 "name": "comment.line.double-dash.documentation.lua",
421 "patterns": [
422 {
423 "include": "#emmydoc"
424 },
425 {
426 "include": "#ldoc_tag"
427 }
428 ]
429 },
430 {
431 "begin": "--",
432 "beginCaptures": {
433 "0": {
434 "name": "punctuation.definition.comment.lua"
435 }
436 },
437 "end": "\\n",
438 "name": "comment.line.double-dash.lua",
439 "patterns": [
440 {
441 "include": "#ldoc_tag"
442 }
443 ]
444 }
445 ]
446 },
447 {
448 "begin": "\\/\\*",
449 "beginCaptures": {
450 "0": {
451 "name": "punctuation.definition.comment.begin.lua"
452 }
453 },
454 "end": "\\*\\/",
455 "endCaptures": {
456 "0": {
457 "name": "punctuation.definition.comment.end.lua"
458 }
459 },
460 "name": "comment.block.lua",
461 "patterns": [
462 {
463 "include": "#emmydoc"
464 },
465 {
466 "include": "#ldoc_tag"
467 }
468 ]
469 }
470 ]
471 },
472 "emmydoc": {
473 "patterns": [
474 {
475 "begin": "(?<=---[ \\t]*)@class",
476 "beginCaptures": {
477 "0": {
478 "name": "storage.type.annotation.lua"
479 }
480 },
481 "end": "(?=[\\n@#])",
482 "patterns": [
483 {
484 "match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
485 "name": "support.class.lua"
486 },
487 {
488 "match": ":|,",
489 "name": "keyword.operator.lua"
490 }
491 ]
492 },
493 {
494 "begin": "(?<=---[ \\t]*)@enum",
495 "beginCaptures": {
496 "0": {
497 "name": "storage.type.annotation.lua"
498 }
499 },
500 "end": "(?=[\\n@#])",
501 "patterns": [
502 {
503 "begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
504 "beginCaptures": {
505 "0": {
506 "name": "variable.lua"
507 }
508 },
509 "end": "(?=\\n)"
510 }
511 ]
512 },
513 {
514 "begin": "(?<=---[ \\t]*)@type",
515 "beginCaptures": {
516 "0": {
517 "name": "storage.type.annotation.lua"
518 }
519 },
520 "end": "(?=[\\n@#])",
521 "patterns": [
522 {
523 "include": "#emmydoc.type"
524 }
525 ]
526 },
527 {
528 "begin": "(?<=---[ \\t]*)@alias",
529 "beginCaptures": {
530 "0": {
531 "name": "storage.type.annotation.lua"
532 }
533 },
534 "end": "(?=[\\n@#])",
535 "patterns": [
536 {
537 "begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
538 "beginCaptures": {
539 "0": {
540 "name": "variable.lua"
541 }
542 },
543 "end": "(?=[\\n#])",
544 "patterns": [
545 {
546 "include": "#emmydoc.type"
547 }
548 ]
549 }
550 ]
551 },
552 {
553 "begin": "(?<=---[ \\t]*)(@operator)\\s*(\\b[a-z]+)?",
554 "beginCaptures": {
555 "1": {
556 "name": "storage.type.annotation.lua"
557 },
558 "2": {
559 "name": "support.function.library.lua"
560 }
561 },
562 "end": "(?=[\\n@#])",
563 "patterns": [
564 {
565 "include": "#emmydoc.type"
566 }
567 ]
568 },
569 {
570 "begin": "(?<=---[ \\t]*)@cast",
571 "beginCaptures": {
572 "0": {
573 "name": "storage.type.annotation.lua"
574 }
575 },
576 "end": "(?=[\\n@#])",
577 "patterns": [
578 {
579 "begin": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
580 "beginCaptures": {
581 "0": {
582 "name": "variable.other.lua"
583 }
584 },
585 "end": "(?=\\n)",
586 "patterns": [
587 {
588 "include": "#emmydoc.type"
589 },
590 {
591 "match": "([+-|])",
592 "name": "keyword.operator.lua"
593 }
594 ]
595 }
596 ]
597 },
598 {
599 "begin": "(?<=---[ \\t]*)@param",
600 "beginCaptures": {
601 "0": {
602 "name": "storage.type.annotation.lua"
603 }
604 },
605 "end": "(?=[\\n@#])",
606 "patterns": [
607 {
608 "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b(\\??)",
609 "beginCaptures": {
610 "1": {
611 "name": "entity.name.variable.lua"
612 },
613 "2": {
614 "name": "keyword.operator.lua"
615 }
616 },
617 "end": "(?=[\\n#])",
618 "patterns": [
619 {
620 "include": "#emmydoc.type"
621 }
622 ]
623 }
624 ]
625 },
626 {
627 "begin": "(?<=---[ \\t]*)@return",
628 "beginCaptures": {
629 "0": {
630 "name": "storage.type.annotation.lua"
631 }
632 },
633 "end": "(?=[\\n@#])",
634 "patterns": [
635 {
636 "match": "\\?",
637 "name": "keyword.operator.lua"
638 },
639 {
640 "include": "#emmydoc.type"
641 }
642 ]
643 },
644 {
645 "begin": "(?<=---[ \\t]*)@field",
646 "beginCaptures": {
647 "0": {
648 "name": "storage.type.annotation.lua"
649 }
650 },
651 "end": "(?=[\\n@#])",
652 "patterns": [
653 {
654 "begin": "(\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b|(\\[))(\\??)",
655 "beginCaptures": {
656 "2": {
657 "name": "entity.name.variable.lua"
658 },
659 "3": {
660 "name": "keyword.operator.lua"
661 }
662 },
663 "end": "(?=[\\n#])",
664 "patterns": [
665 {
666 "include": "#string"
667 },
668 {
669 "include": "#emmydoc.type"
670 },
671 {
672 "match": "\\]",
673 "name": "keyword.operator.lua"
674 }
675 ]
676 }
677 ]
678 },
679 {
680 "begin": "(?<=---[ \\t]*)@generic",
681 "beginCaptures": {
682 "0": {
683 "name": "storage.type.annotation.lua"
684 }
685 },
686 "end": "(?=[\\n@#])",
687 "patterns": [
688 {
689 "begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
690 "beginCaptures": {
691 "0": {
692 "name": "storage.type.generic.lua"
693 }
694 },
695 "end": "(?=\\n)|(,)",
696 "endCaptures": {
697 "0": {
698 "name": "keyword.operator.lua"
699 }
700 },
701 "patterns": [
702 {
703 "match": ":",
704 "name": "keyword.operator.lua"
705 },
706 {
707 "include": "#emmydoc.type"
708 }
709 ]
710 }
711 ]
712 },
713 {
714 "begin": "(?<=---[ \\t]*)@vararg",
715 "beginCaptures": {
716 "0": {
717 "name": "storage.type.annotation.lua"
718 }
719 },
720 "end": "(?=[\\n@#])",
721 "patterns": [
722 {
723 "include": "#emmydoc.type"
724 }
725 ]
726 },
727 {
728 "begin": "(?<=---[ \\t]*)@overload",
729 "beginCaptures": {
730 "0": {
731 "name": "storage.type.annotation.lua"
732 }
733 },
734 "end": "(?=[\\n@#])",
735 "patterns": [
736 {
737 "include": "#emmydoc.type"
738 }
739 ]
740 },
741 {
742 "begin": "(?<=---[ \\t]*)@deprecated",
743 "beginCaptures": {
744 "0": {
745 "name": "storage.type.annotation.lua"
746 }
747 },
748 "end": "(?=[\\n@#])"
749 },
750 {
751 "begin": "(?<=---[ \\t]*)@meta",
752 "beginCaptures": {
753 "0": {
754 "name": "storage.type.annotation.lua"
755 }
756 },
757 "end": "(?=[\\n@#])"
758 },
759 {
760 "begin": "(?<=---[ \\t]*)@private",
761 "beginCaptures": {
762 "0": {
763 "name": "storage.type.annotation.lua"
764 }
765 },
766 "end": "(?=[\\n@#])"
767 },
768 {
769 "begin": "(?<=---[ \\t]*)@protected",
770 "beginCaptures": {
771 "0": {
772 "name": "storage.type.annotation.lua"
773 }
774 },
775 "end": "(?=[\\n@#])"
776 },
777 {
778 "begin": "(?<=---[ \\t]*)@package",
779 "beginCaptures": {
780 "0": {
781 "name": "storage.type.annotation.lua"
782 }
783 },
784 "end": "(?=[\\n@#])"
785 },
786 {
787 "begin": "(?<=---[ \\t]*)@version",
788 "beginCaptures": {
789 "0": {
790 "name": "storage.type.annotation.lua"
791 }
792 },
793 "end": "(?=[\\n@#])",
794 "patterns": [
795 {
796 "match": "\\b(5\\.1|5\\.2|5\\.3|5\\.4|JIT)\\b",
797 "name": "support.class.lua"
798 },
799 {
800 "match": ",|\\>|\\<",
801 "name": "keyword.operator.lua"
802 }
803 ]
804 },
805 {
806 "begin": "(?<=---[ \\t]*)@see",
807 "beginCaptures": {
808 "0": {
809 "name": "storage.type.annotation.lua"
810 }
811 },
812 "end": "(?=[\\n@#])",
813 "patterns": [
814 {
815 "match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*)",
816 "name": "support.class.lua"
817 },
818 {
819 "match": "#",
820 "name": "keyword.operator.lua"
821 }
822 ]
823 },
824 {
825 "begin": "(?<=---[ \\t]*)@diagnostic",
826 "beginCaptures": {
827 "0": {
828 "name": "storage.type.annotation.lua"
829 }
830 },
831 "end": "(?=[\\n@#])",
832 "patterns": [
833 {
834 "begin": "([a-zA-Z_\\-0-9]+)[ \\t]*(:)?",
835 "beginCaptures": {
836 "1": {
837 "name": "keyword.other.unit"
838 },
839 "2": {
840 "name": "keyword.operator.unit"
841 }
842 },
843 "end": "(?=\\n)",
844 "patterns": [
845 {
846 "match": "\\b([a-zA-Z_\\*][a-zA-Z0-9_\\-]*)",
847 "name": "support.class.lua"
848 },
849 {
850 "match": ",",
851 "name": "keyword.operator.lua"
852 }
853 ]
854 }
855 ]
856 },
857 {
858 "begin": "(?<=---[ \\t]*)@module",
859 "beginCaptures": {
860 "0": {
861 "name": "storage.type.annotation.lua"
862 }
863 },
864 "end": "(?=[\\n@#])",
865 "patterns": [
866 {
867 "include": "#string"
868 }
869 ]
870 },
871 {
872 "match": "(?<=---[ \\t]*)@(async|nodiscard)",
873 "name": "storage.type.annotation.lua"
874 },
875 {
876 "begin": "(?<=---)\\|\\s*[\\>\\+]?",
877 "beginCaptures": {
878 "0": {
879 "name": "storage.type.annotation.lua"
880 }
881 },
882 "end": "(?=[\\n@#])",
883 "patterns": [
884 {
885 "include": "#string"
886 }
887 ]
888 }
889 ]
890 },
891 "emmydoc.type": {
892 "patterns": [
893 {
894 "begin": "\\bfun\\b",
895 "beginCaptures": {
896 "0": {
897 "name": "keyword.control.lua"
898 }
899 },
900 "end": "(?=[\\s#])",
901 "patterns": [
902 {
903 "match": "[\\(\\),:\\?][ \\t]*",
904 "name": "keyword.operator.lua"
905 },
906 {
907 "match": "([a-zA-Z_][a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]*)(?<!,)[ \\t]*(?=\\??:)",
908 "name": "entity.name.variable.lua"
909 },
910 {
911 "include": "#emmydoc.type"
912 },
913 {
914 "include": "#string"
915 }
916 ]
917 },
918 {
919 "match": "\\<[a-zA-Z_\\*][a-zA-Z0-9_\\.\\*\\-]*\\>",
920 "name": "storage.type.generic.lua"
921 },
922 {
923 "match": "\\basync\\b",
924 "name": "entity.name.tag.lua"
925 },
926 {
927 "match": "[\\{\\}\\:\\,\\?\\|\\`][ \\t]*",
928 "name": "keyword.operator.lua"
929 },
930 {
931 "begin": "(?=[a-zA-Z_\\.\\*\"'\\[])",
932 "end": "(?=[\\s\\)\\,\\?\\:\\}\\|#])",
933 "patterns": [
934 {
935 "match": "([a-zA-Z0-9_\\.\\*\\[\\]\\<\\>\\,\\-]+)(?<!,)[ \\t]*",
936 "name": "support.type.lua"
937 },
938 {
939 "match": "(\\.\\.\\.)[ \\t]*",
940 "name": "constant.language.lua"
941 },
942 {
943 "include": "#string"
944 }
945 ]
946 }
947 ]
948 },
949 "ldoc_tag": {
950 "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",
951 "captures": {
952 "1": {
953 "name": "punctuation.definition.block.tag.ldoc"
954 },
955 "2": {
956 "name": "storage.type.class.ldoc"
957 }
958 }
959 }
960 }
961 }
962