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 / solidity.tmLanguage.json

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

1,209 lines 27.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "fileTypes": ["sol"],
3 "name": "solidity",
4 "patterns": [
5 {
6 "include": "#natspec"
7 },
8 {
9 "include": "#declaration-userType"
10 },
11 {
12 "include": "#comment"
13 },
14 {
15 "include": "#operator"
16 },
17 {
18 "include": "#global"
19 },
20 {
21 "include": "#control"
22 },
23 {
24 "include": "#constant"
25 },
26 {
27 "include": "#primitive"
28 },
29 {
30 "include": "#type-primitive"
31 },
32 {
33 "include": "#type-modifier-extended-scope"
34 },
35 {
36 "include": "#declaration"
37 },
38 {
39 "include": "#function-call"
40 },
41 {
42 "include": "#assembly"
43 },
44 {
45 "include": "#punctuation"
46 }
47 ],
48 "repository": {
49 "natspec": {
50 "patterns": [
51 {
52 "begin": "/\\*\\*",
53 "end": "\\*/",
54 "name": "comment.block.documentation",
55 "patterns": [
56 {
57 "include": "#natspec-tags"
58 }
59 ]
60 },
61 {
62 "begin": "///",
63 "end": "$",
64 "name": "comment.block.documentation",
65 "patterns": [
66 {
67 "include": "#natspec-tags"
68 }
69 ]
70 }
71 ]
72 },
73 "natspec-tags": {
74 "patterns": [
75 {
76 "include": "#comment-todo"
77 },
78 {
79 "include": "#natspec-tag-title"
80 },
81 {
82 "include": "#natspec-tag-author"
83 },
84 {
85 "include": "#natspec-tag-notice"
86 },
87 {
88 "include": "#natspec-tag-dev"
89 },
90 {
91 "include": "#natspec-tag-param"
92 },
93 {
94 "include": "#natspec-tag-return"
95 },
96 {
97 "include": "#natspec-tag-custom"
98 },
99 {
100 "include": "#natspec-tag-inheritdoc"
101 }
102 ]
103 },
104 "natspec-tag-title": {
105 "match": "(@title)\\b",
106 "name": "storage.type.title.natspec"
107 },
108 "natspec-tag-author": {
109 "match": "(@author)\\b",
110 "name": "storage.type.author.natspec"
111 },
112 "natspec-tag-notice": {
113 "match": "(@notice)\\b",
114 "name": "storage.type.dev.natspec"
115 },
116 "natspec-tag-custom": {
117 "match": "(@custom:\\w*)\\b",
118 "name": "storage.type.dev.natspec"
119 },
120 "natspec-tag-inheritdoc": {
121 "match": "(@inheritdoc)\\b",
122 "name": "storage.type.author.natspec"
123 },
124 "natspec-tag-dev": {
125 "match": "(@dev)\\b",
126 "name": "storage.type.dev.natspec"
127 },
128 "natspec-tag-param": {
129 "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b",
130 "captures": {
131 "1": {
132 "name": "storage.type.param.natspec"
133 },
134 "3": {
135 "name": "variable.other.natspec"
136 }
137 }
138 },
139 "natspec-tag-return": {
140 "match": "(@return)(\\s+([A-Za-z_]\\w*))?\\b",
141 "captures": {
142 "1": {
143 "name": "storage.type.return.natspec"
144 },
145 "3": {
146 "name": "variable.other.natspec"
147 }
148 }
149 },
150 "comment": {
151 "patterns": [
152 {
153 "include": "#comment-line"
154 },
155 {
156 "include": "#comment-block"
157 }
158 ]
159 },
160 "comment-todo": {
161 "match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)",
162 "name": "keyword.comment.todo"
163 },
164 "comment-line": {
165 "begin": "(?<!tp:)//",
166 "end": "$",
167 "name": "comment.line",
168 "patterns": [
169 {
170 "include": "#comment-todo"
171 }
172 ]
173 },
174 "comment-block": {
175 "begin": "/\\*",
176 "end": "\\*/",
177 "name": "comment.block",
178 "patterns": [
179 {
180 "include": "#comment-todo"
181 }
182 ]
183 },
184 "operator": {
185 "patterns": [
186 {
187 "include": "#operator-logic"
188 },
189 {
190 "include": "#operator-mapping"
191 },
192 {
193 "include": "#operator-arithmetic"
194 },
195 {
196 "include": "#operator-binary"
197 },
198 {
199 "include": "#operator-assignment"
200 }
201 ]
202 },
203 "operator-logic": {
204 "match": "(==|\\!=|<(?!<)|<=|>(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?|\\!)",
205 "name": "keyword.operator.logic"
206 },
207 "operator-mapping": {
208 "match": "(=>)",
209 "name": "keyword.operator.mapping"
210 },
211 "operator-arithmetic": {
212 "match": "(\\+|\\-|\\/|\\*)",
213 "name": "keyword.operator.arithmetic"
214 },
215 "operator-binary": {
216 "match": "(\\^|\\&|\\||<<|>>)",
217 "name": "keyword.operator.binary"
218 },
219 "operator-assignment": {
220 "match": "(\\:?=)",
221 "name": "keyword.operator.assignment"
222 },
223 "control": {
224 "patterns": [
225 {
226 "include": "#control-flow"
227 },
228 {
229 "include": "#control-using"
230 },
231 {
232 "include": "#control-import"
233 },
234 {
235 "include": "#control-pragma"
236 },
237 {
238 "include": "#control-underscore"
239 },
240 {
241 "include": "#control-unchecked"
242 },
243 {
244 "include": "#control-other"
245 }
246 ]
247 },
248 "control-flow": {
249 "patterns": [
250 {
251 "match": "\\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return|global)\\b",
252 "name": "keyword.control.flow"
253 },
254 {
255 "begin": "\\b(returns)\\b",
256 "beginCaptures": {
257 "1": {
258 "name": "keyword.control.flow.return"
259 }
260 },
261 "end": "(?=\\))",
262 "patterns": [
263 {
264 "include": "#declaration-function-parameters"
265 }
266 ]
267 }
268 ]
269 },
270 "control-using": {
271 "patterns": [
272 {
273 "match": "\\b(using)\\b\\s+\\b([A-Za-z\\d_]+)\\b\\s+\\b(for)\\b\\s+\\b([A-Za-z\\d_]+)",
274 "captures": {
275 "1": {
276 "name": "keyword.control.using"
277 },
278 "2": {
279 "name": "entity.name.type.library"
280 },
281 "3": {
282 "name": "keyword.control.for"
283 },
284 "4": {
285 "name": "entity.name.type"
286 }
287 }
288 },
289 {
290 "match": "\\b(using)\\b",
291 "name": "keyword.control.using"
292 }
293 ]
294 },
295 "control-import": {
296 "patterns": [
297 {
298 "begin": "\\b(import)\\b",
299 "beginCaptures": {
300 "1": {
301 "name": "keyword.control.import"
302 }
303 },
304 "end": "(?=\\;)",
305 "patterns": [
306 {
307 "begin": "((?=\\{))",
308 "end": "((?=\\}))",
309 "patterns": [
310 {
311 "match": "\\b(\\w+)\\b",
312 "name": "entity.name.type.interface"
313 }
314 ]
315 },
316 {
317 "match": "\\b(from)\\b",
318 "name": "keyword.control.import.from"
319 },
320 {
321 "include": "#string"
322 },
323 {
324 "include": "#punctuation"
325 }
326 ]
327 },
328 {
329 "match": "\\b(import)\\b",
330 "name": "keyword.control.import"
331 }
332 ]
333 },
334 "control-unchecked": {
335 "match": "\\b(unchecked)\\b",
336 "name": "keyword.control.unchecked"
337 },
338 "control-pragma": {
339 "match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b",
340 "captures": {
341 "1": {
342 "name": "keyword.control.pragma"
343 },
344 "2": {
345 "name": "entity.name.tag.pragma"
346 },
347 "3": {
348 "name": "constant.other.pragma"
349 }
350 }
351 },
352 "control-underscore": {
353 "match": "\\b(_)\\b",
354 "name": "constant.other.underscore"
355 },
356 "control-other": {
357 "match": "\\b(new|delete|emit)\\b",
358 "name": "keyword.control"
359 },
360 "constant": {
361 "patterns": [
362 {
363 "include": "#constant-boolean"
364 },
365 {
366 "include": "#constant-time"
367 },
368 {
369 "include": "#constant-currency"
370 }
371 ]
372 },
373 "constant-boolean": {
374 "match": "\\b(true|false)\\b",
375 "name": "constant.language.boolean"
376 },
377 "constant-time": {
378 "match": "\\b(seconds|minutes|hours|days|weeks|years)\\b",
379 "name": "constant.language.time"
380 },
381 "constant-currency": {
382 "match": "\\b(ether|wei|gwei|finney|szabo)\\b",
383 "name": "constant.language.currency"
384 },
385 "number": {
386 "patterns": [
387 {
388 "include": "#number-decimal"
389 },
390 {
391 "include": "#number-hex"
392 },
393 {
394 "include": "#number-scientific"
395 }
396 ]
397 },
398 "number-decimal": {
399 "match": "\\b([0-9_]+(\\.[0-9_]+)?)\\b",
400 "name": "constant.numeric.decimal"
401 },
402 "number-hex": {
403 "match": "\\b(0[xX][a-fA-F0-9]+)\\b",
404 "name": "constant.numeric.hexadecimal"
405 },
406 "number-scientific": {
407 "match": "\\b(?:0\\.(?:0[0-9]|[0-9][0-9_]?)|[0-9][0-9_]*(?:\\.\\d{1,2})?)(?:e[+-]?[0-9_]+)?",
408 "name": "constant.numeric.scientific"
409 },
410 "string": {
411 "patterns": [
412 {
413 "match": "\\\"(?:\\\\\"|[^\\\"])*\\\"",
414 "name": "string.quoted.double"
415 },
416 {
417 "match": "\\'(?:\\\\'|[^\\'])*\\'",
418 "name": "string.quoted.single"
419 }
420 ]
421 },
422 "primitive": {
423 "patterns": [
424 {
425 "include": "#number-decimal"
426 },
427 {
428 "include": "#number-hex"
429 },
430 {
431 "include": "#number-scientific"
432 },
433 {
434 "include": "#string"
435 }
436 ]
437 },
438 "type-primitive": {
439 "patterns": [
440 {
441 "begin": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b(?:\\[\\])(\\()",
442 "beginCaptures": {
443 "1": {
444 "name": "support.type.primitive"
445 }
446 },
447 "end": "(\\))",
448 "patterns": [
449 {
450 "include": "#primitive"
451 },
452 {
453 "include": "#punctuation"
454 },
455 {
456 "include": "#global"
457 },
458 {
459 "include": "#variable"
460 }
461 ]
462 },
463 {
464 "match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b",
465 "name": "support.type.primitive"
466 }
467 ]
468 },
469 "global": {
470 "patterns": [
471 {
472 "include": "#global-variables"
473 },
474 {
475 "include": "#global-functions"
476 }
477 ]
478 },
479 "global-variables": {
480 "patterns": [
481 {
482 "match": "\\b(this)\\b",
483 "name": "variable.language.this"
484 },
485 {
486 "match": "\\b(super)\\b",
487 "name": "variable.language.super"
488 },
489 {
490 "match": "\\b(abi)\\b",
491 "name": "variable.language.builtin.abi"
492 },
493 {
494 "match": "\\b(msg\\.sender|msg|block|tx|now)\\b",
495 "name": "variable.language.transaction"
496 },
497 {
498 "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b",
499 "name": "variable.language.transaction"
500 }
501 ]
502 },
503 "global-functions": {
504 "patterns": [
505 {
506 "match": "\\b(require|assert|revert)\\b",
507 "name": "keyword.control.exceptions"
508 },
509 {
510 "match": "\\b(selfdestruct|suicide)\\b",
511 "name": "keyword.control.contract"
512 },
513 {
514 "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b",
515 "name": "support.function.math"
516 },
517 {
518 "match": "\\b(unicode)\\b",
519 "name": "support.function.string"
520 },
521 {
522 "match": "\\b(blockhash|gasleft)\\b",
523 "name": "variable.language.transaction"
524 },
525 {
526 "match": "\\b(type)\\b",
527 "name": "variable.language.type"
528 }
529 ]
530 },
531 "type-modifier-access": {
532 "match": "\\b(internal|external|private|public)\\b",
533 "name": "storage.type.modifier.access"
534 },
535 "type-modifier-payable": {
536 "match": "\\b(nonpayable|payable)\\b",
537 "name": "storage.type.modifier.payable"
538 },
539 "type-modifier-constant": {
540 "match": "\\b(constant)\\b",
541 "name": "storage.type.modifier.readonly"
542 },
543 "type-modifier-immutable": {
544 "match": "\\b(immutable)\\b",
545 "name": "storage.type.modifier.readonly"
546 },
547 "type-modifier-extended-scope": {
548 "match": "\\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\\b",
549 "name": "storage.type.modifier.extendedscope"
550 },
551 "variable": {
552 "patterns": [
553 {
554 "match": "\\b(\\_\\w+)\\b",
555 "captures": {
556 "1": {
557 "name": "variable.parameter.function"
558 }
559 }
560 },
561 {
562 "match": "(?:\\.)(\\w+)\\b",
563 "captures": {
564 "1": {
565 "name": "support.variable.property"
566 }
567 }
568 },
569 {
570 "match": "\\b(\\w+)\\b",
571 "captures": {
572 "1": {
573 "name": "variable.parameter.other"
574 }
575 }
576 }
577 ]
578 },
579 "modifier-call": {
580 "patterns": [
581 {
582 "include": "#function-call"
583 },
584 {
585 "match": "\\b(\\w+)\\b",
586 "name": "entity.name.function.modifier"
587 }
588 ]
589 },
590 "declaration": {
591 "patterns": [
592 {
593 "include": "#declaration-contract"
594 },
595 {
596 "include": "#declaration-userType"
597 },
598 {
599 "include": "#declaration-interface"
600 },
601 {
602 "include": "#declaration-library"
603 },
604 {
605 "include": "#declaration-function"
606 },
607 {
608 "include": "#declaration-modifier"
609 },
610 {
611 "include": "#declaration-constructor"
612 },
613 {
614 "include": "#declaration-event"
615 },
616 {
617 "include": "#declaration-storage"
618 },
619 {
620 "include": "#declaration-error"
621 }
622 ]
623 },
624 "declaration-storage-field": {
625 "patterns": [
626 {
627 "include": "#comment"
628 },
629 {
630 "include": "#control"
631 },
632 {
633 "include": "#type-primitive"
634 },
635 {
636 "include": "#type-modifier-access"
637 },
638 {
639 "include": "#type-modifier-immutable"
640 },
641 {
642 "include": "#type-modifier-extend-scope"
643 },
644 {
645 "include": "#type-modifier-payable"
646 },
647 {
648 "include": "#type-modifier-constant"
649 },
650 {
651 "include": "#primitive"
652 },
653 {
654 "include": "#constant"
655 },
656 {
657 "include": "#operator"
658 },
659 {
660 "include": "#punctuation"
661 }
662 ]
663 },
664 "declaration-storage": {
665 "patterns": [
666 {
667 "include": "#declaration-storage-mapping"
668 },
669 {
670 "include": "#declaration-struct"
671 },
672 {
673 "include": "#declaration-enum"
674 },
675 {
676 "include": "#declaration-storage-field"
677 }
678 ]
679 },
680 "declaration-userType": {
681 "match": "\\b(type)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b",
682 "captures": {
683 "1": {
684 "name": "storage.type.userType"
685 },
686 "2": {
687 "name": "entity.name.type.userType"
688 },
689 "3": {
690 "name": "storage.modifier.is"
691 }
692 }
693 },
694 "declaration-contract": {
695 "patterns": [
696 {
697 "begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+",
698 "end": "(?=\\{)",
699 "beginCaptures": {
700 "1": {
701 "name": "storage.type.contract"
702 },
703 "2": {
704 "name": "entity.name.type.contract"
705 },
706 "3": {
707 "name": "storage.modifier.is"
708 }
709 },
710 "patterns": [
711 {
712 "match": "\\b(\\w+)\\b",
713 "name": "entity.name.type.contract.extend"
714 }
715 ]
716 },
717 {
718 "match": "\\b(contract)(\\s+([A-Za-z_]\\w*))?\\b",
719 "captures": {
720 "1": {
721 "name": "storage.type.contract"
722 },
723 "2": {
724 "name": "entity.name.type.contract"
725 }
726 }
727 }
728 ]
729 },
730 "declaration-interface": {
731 "patterns": [
732 {
733 "begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+",
734 "end": "(?=\\{)",
735 "beginCaptures": {
736 "1": {
737 "name": "storage.type.interface"
738 },
739 "2": {
740 "name": "entity.name.type.interface"
741 },
742 "3": {
743 "name": "storage.modifier.is"
744 }
745 },
746 "patterns": [
747 {
748 "match": "\\b(\\w+)\\b",
749 "name": "entity.name.type.interface.extend"
750 }
751 ]
752 },
753 {
754 "match": "\\b(interface)(\\s+([A-Za-z_]\\w*))?\\b",
755 "captures": {
756 "1": {
757 "name": "storage.type.interface"
758 },
759 "2": {
760 "name": "entity.name.type.interface"
761 }
762 }
763 }
764 ]
765 },
766 "declaration-library": {
767 "match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b",
768 "captures": {
769 "1": {
770 "name": "storage.type.library"
771 },
772 "3": {
773 "name": "entity.name.type.library"
774 }
775 }
776 },
777 "declaration-struct": {
778 "patterns": [
779 {
780 "match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b",
781 "captures": {
782 "1": {
783 "name": "storage.type.struct"
784 },
785 "3": {
786 "name": "entity.name.type.struct"
787 }
788 }
789 },
790 {
791 "begin": "\\b(struct)\\b\\s*(\\w+)?\\b\\s*(?=\\{)",
792 "beginCaptures": {
793 "1": {
794 "name": "storage.type.struct"
795 },
796 "2": {
797 "name": "entity.name.type.struct"
798 }
799 },
800 "end": "(?=\\})",
801 "patterns": [
802 {
803 "include": "#type-primitive"
804 },
805 {
806 "include": "#variable"
807 },
808 {
809 "include": "#punctuation"
810 },
811 {
812 "include": "#comment"
813 }
814 ]
815 }
816 ]
817 },
818 "declaration-event": {
819 "patterns": [
820 {
821 "begin": "\\b(event)\\b(?:\\s+(\\w+)\\b)?",
822 "end": "(?=\\))",
823 "beginCaptures": {
824 "1": {
825 "name": "storage.type.event"
826 },
827 "2": {
828 "name": "entity.name.type.event"
829 }
830 },
831 "patterns": [
832 {
833 "include": "#type-primitive"
834 },
835 {
836 "match": "\\b(?:(indexed)\\s)?(\\w+)(?:,\\s*|)",
837 "captures": {
838 "1": {
839 "name": "storage.type.modifier.indexed"
840 },
841 "2": {
842 "name": "variable.parameter.event"
843 }
844 }
845 },
846 {
847 "include": "#punctuation"
848 }
849 ]
850 },
851 {
852 "match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b",
853 "captures": {
854 "1": {
855 "name": "storage.type.event"
856 },
857 "3": {
858 "name": "entity.name.type.event"
859 }
860 }
861 }
862 ]
863 },
864 "declaration-constructor": {
865 "patterns": [
866 {
867 "begin": "\\b(constructor)\\b",
868 "beginCaptures": {
869 "1": {
870 "name": "storage.type.constructor"
871 }
872 },
873 "end": "(?=\\{)",
874 "patterns": [
875 {
876 "begin": "\\G\\s*(?=\\()",
877 "end": "(?=\\))",
878 "patterns": [
879 {
880 "include": "#declaration-function-parameters"
881 }
882 ]
883 },
884 {
885 "begin": "(?<=\\))",
886 "end": "(?=\\{)",
887 "patterns": [
888 {
889 "include": "#type-modifier-access"
890 },
891 {
892 "include": "#function-call"
893 }
894 ]
895 }
896 ]
897 },
898 {
899 "match": "\\b(constructor)\\b",
900 "captures": {
901 "1": {
902 "name": "storage.type.constructor"
903 }
904 }
905 }
906 ]
907 },
908 "declaration-enum": {
909 "patterns": [
910 {
911 "begin": "\\b(enum)\\s+(\\w+)\\b",
912 "beginCaptures": {
913 "1": {
914 "name": "storage.type.enum"
915 },
916 "2": {
917 "name": "entity.name.type.enum"
918 }
919 },
920 "end": "(?=\\})",
921 "patterns": [
922 {
923 "match": "\\b(\\w+)\\b",
924 "name": "variable.other.enummember"
925 },
926 {
927 "include": "#punctuation"
928 },
929 {
930 "include": "#comment"
931 }
932 ]
933 },
934 {
935 "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b",
936 "captures": {
937 "1": {
938 "name": "storage.type.enum"
939 },
940 "3": {
941 "name": "entity.name.type.enum"
942 }
943 }
944 }
945 ]
946 },
947 "declaration-function-parameters": {
948 "begin": "\\G\\s*(?=\\()",
949 "end": "(?=\\))",
950 "patterns": [
951 {
952 "include": "#type-primitive"
953 },
954 {
955 "include": "#type-modifier-extended-scope"
956 },
957 {
958 "match": "\\b([A-Z]\\w*)\\b",
959 "captures": {
960 "1": {
961 "name": "storage.type.struct"
962 }
963 }
964 },
965 {
966 "include": "#variable"
967 },
968 {
969 "include": "#punctuation"
970 },
971 {
972 "include": "#comment"
973 }
974 ]
975 },
976 "declaration-function": {
977 "patterns": [
978 {
979 "begin": "\\b(function)\\s+(\\w+)\\b",
980 "beginCaptures": {
981 "1": {
982 "name": "storage.type.function"
983 },
984 "2": {
985 "name": "entity.name.function"
986 }
987 },
988 "end": "(?=\\{|;)",
989 "patterns": [
990 {
991 "include": "#natspec"
992 },
993 {
994 "include": "#global"
995 },
996 {
997 "include": "#declaration-function-parameters"
998 },
999 {
1000 "include": "#type-modifier-access"
1001 },
1002 {
1003 "include": "#type-modifier-payable"
1004 },
1005 {
1006 "include": "#type-modifier-immutable"
1007 },
1008 {
1009 "include": "#type-modifier-extended-scope"
1010 },
1011 {
1012 "include": "#control-flow"
1013 },
1014 {
1015 "include": "#function-call"
1016 },
1017 {
1018 "include": "#modifier-call"
1019 },
1020 {
1021 "include": "#punctuation"
1022 }
1023 ]
1024 },
1025 {
1026 "match": "\\b(function)\\s+([A-Za-z_]\\w*)\\b",
1027 "captures": {
1028 "1": {
1029 "name": "storage.type.function"
1030 },
1031 "2": {
1032 "name": "entity.name.function"
1033 }
1034 }
1035 }
1036 ]
1037 },
1038 "declaration-modifier": {
1039 "patterns": [
1040 {
1041 "begin": "\\b(modifier)\\b\\s*(\\w+)",
1042 "beginCaptures": {
1043 "1": {
1044 "name": "storage.type.function.modifier"
1045 },
1046 "2": {
1047 "name": "entity.name.function.modifier"
1048 }
1049 },
1050 "end": "(?=\\{)",
1051 "patterns": [
1052 {
1053 "include": "#declaration-function-parameters"
1054 },
1055 {
1056 "begin": "(?<=\\))",
1057 "end": "(?=\\{)",
1058 "patterns": [
1059 {
1060 "include": "#declaration-function-parameters"
1061 },
1062 {
1063 "include": "#type-modifier-access"
1064 },
1065 {
1066 "include": "#type-modifier-payable"
1067 },
1068 {
1069 "include": "#type-modifier-immutable"
1070 },
1071 {
1072 "include": "#type-modifier-extended-scope"
1073 },
1074 {
1075 "include": "#function-call"
1076 },
1077 {
1078 "include": "#modifier-call"
1079 },
1080 {
1081 "include": "#control-flow"
1082 }
1083 ]
1084 }
1085 ]
1086 },
1087 {
1088 "match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b",
1089 "captures": {
1090 "1": {
1091 "name": "storage.type.modifier"
1092 },
1093 "3": {
1094 "name": "entity.name.function"
1095 }
1096 }
1097 }
1098 ]
1099 },
1100 "declaration-storage-mapping": {
1101 "patterns": [
1102 {
1103 "begin": "\\b(mapping)\\b",
1104 "beginCaptures": {
1105 "1": {
1106 "name": "storage.type.mapping"
1107 }
1108 },
1109 "end": "(?=\\))",
1110 "patterns": [
1111 {
1112 "include": "#declaration-storage-mapping"
1113 },
1114 {
1115 "include": "#type-primitive"
1116 },
1117 {
1118 "include": "#punctuation"
1119 },
1120 {
1121 "include": "#operator"
1122 }
1123 ]
1124 },
1125 {
1126 "match": "\\b(mapping)\\b",
1127 "name": "storage.type.mapping"
1128 }
1129 ]
1130 },
1131 "declaration-error": {
1132 "match": "\\b(error)(\\s+([A-Za-z_]\\w*))?\\b",
1133 "captures": {
1134 "1": {
1135 "name": "storage.type.error"
1136 },
1137 "3": {
1138 "name": "entity.name.type.error"
1139 }
1140 }
1141 },
1142 "function-call": {
1143 "match": "\\b([A-Za-z_]\\w*)\\s*(\\()",
1144 "captures": {
1145 "1": {
1146 "name": "entity.name.function"
1147 },
1148 "2": {
1149 "name": "punctuation.parameters.begin"
1150 }
1151 }
1152 },
1153 "assembly": {
1154 "patterns": [
1155 {
1156 "match": "\\b(assembly)\\b",
1157 "name": "keyword.control.assembly"
1158 },
1159 {
1160 "match": "\\b(let)\\b",
1161 "name": "storage.type.assembly"
1162 }
1163 ]
1164 },
1165 "punctuation": {
1166 "patterns": [
1167 {
1168 "match": ";",
1169 "name": "punctuation.terminator.statement"
1170 },
1171 {
1172 "match": "\\.",
1173 "name": "punctuation.accessor"
1174 },
1175 {
1176 "match": ",",
1177 "name": "punctuation.separator"
1178 },
1179 {
1180 "match": "\\{",
1181 "name": "punctuation.brace.curly.begin"
1182 },
1183 {
1184 "match": "\\}",
1185 "name": "punctuation.brace.curly.end"
1186 },
1187 {
1188 "match": "\\[",
1189 "name": "punctuation.brace.square.begin"
1190 },
1191 {
1192 "match": "\\]",
1193 "name": "punctuation.brace.square.end"
1194 },
1195 {
1196 "match": "\\(",
1197 "name": "punctuation.parameters.begin"
1198 },
1199 {
1200 "match": "\\)",
1201 "name": "punctuation.parameters.end"
1202 }
1203 ]
1204 }
1205 },
1206 "scopeName": "source.solidity",
1207 "uuid": "ad87d2cd-8575-4afe-984e-9421a3788933"
1208 }
1209