|
98 | 98 | {
|
99 | 99 | "comment": "macro rules",
|
100 | 100 | "name": "meta.macro.rules.rust",
|
101 |
| - "match": "\\b(macro_rules)(!)\\s+(([a-z0-9_]+)|([A-Z][a-z0-9_]*))\\s+(\\{)", |
| 101 | + "match": "\\b(macro_rules!)\\s+(([a-z0-9_]+)|([A-Z][a-z0-9_]*))\\s+(\\{)", |
102 | 102 | "captures": {
|
103 | 103 | "1": {
|
104 |
| - "name": "entity.name.function.macro.rust" |
| 104 | + "name": "entity.name.function.macro.rules.rust" |
105 | 105 | },
|
106 |
| - "2": { |
107 |
| - "name": "keyword.operator.macro.not.rust" |
| 106 | + "3": { |
| 107 | + "name": "entity.name.function.macro.rust" |
108 | 108 | },
|
109 | 109 | "4": {
|
110 |
| - "name": "entity.name.function.rust" |
111 |
| - }, |
112 |
| - "5": { |
113 | 110 | "name": "entity.name.type.macro.rust"
|
114 | 111 | },
|
115 |
| - "6": { |
| 112 | + "5": { |
116 | 113 | "name": "punctuation.brackets.curly.rust"
|
117 | 114 | }
|
118 | 115 | }
|
|
564 | 561 | {
|
565 | 562 | "comment": "control flow keywords",
|
566 | 563 | "name": "keyword.control.rust",
|
567 |
| - "match": "\\b(abstract|as|async|await|become|box|break|const|continue|do|dyn|else|enum|extern|final|for|if|impl|in|let|loop|macro|match|mod|move|override|priv|pub|ref|return|static|struct|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\\b" |
| 564 | + "match": "\\b(async|await|break|continue|do|else|for|if|loop|match|move|return|try|where|while|yield)\\b" |
| 565 | + }, |
| 566 | + { |
| 567 | + "comment": "storage keywords", |
| 568 | + "name": "storage.type.rust", |
| 569 | + "match": "\\b(const|enum|extern|let|macro|mod|struct|trait|type)\\b" |
| 570 | + }, |
| 571 | + { |
| 572 | + "comment": "storage modifiers", |
| 573 | + "name": "storage.modifier.rust", |
| 574 | + "match": "\\b(abstract|static)\\b" |
| 575 | + }, |
| 576 | + { |
| 577 | + "comment": "other keywords", |
| 578 | + "name": "keyword.other.rust", |
| 579 | + "match": "\\b(as|become|box|dyn|final|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual)\\b" |
568 | 580 | },
|
569 | 581 | {
|
570 | 582 | "comment": "pub as a function",
|
|
580 | 592 | },
|
581 | 593 | {
|
582 | 594 | "comment": "fn",
|
583 |
| - "name": "keyword.control.fn.rust", |
| 595 | + "name": "keyword.other.fn.rust", |
584 | 596 | "match": "\\bfn\\b"
|
585 | 597 | },
|
586 | 598 | {
|
|
590 | 602 | },
|
591 | 603 | {
|
592 | 604 | "comment": "mut",
|
593 |
| - "name": "keyword.other.mut.rust", |
| 605 | + "name": "storage.modifier.mut.rust", |
594 | 606 | "match": "\\bmut\\b"
|
595 | 607 | },
|
596 | 608 | {
|
|
601 | 613 | {
|
602 | 614 | "comment": "logical operators",
|
603 | 615 | "name": "keyword.operator.logical.rust",
|
604 |
| - "match": "(\\^|\\||\\|\\||&&|<<|>>)(?!=)" |
605 |
| - }, |
606 |
| - { |
607 |
| - "comment": "macro bang and not", |
608 |
| - "name": "keyword.operator.macro.not.rust", |
609 |
| - "match": "!(?!=)" |
| 616 | + "match": "(\\^|\\||\\|\\||&&|<<|>>|!)(?!=)" |
610 | 617 | },
|
611 | 618 | {
|
612 | 619 | "comment": "logical AND, borrow references",
|
|
652 | 659 | }
|
653 | 660 | },
|
654 | 661 | {
|
655 |
| - "comment": "subpattern bindng", |
| 662 | + "comment": "subpattern binding", |
656 | 663 | "name": "keyword.operator.subpattern.rust",
|
657 | 664 | "match": "@"
|
658 | 665 | },
|
|
750 | 757 | {
|
751 | 758 | "comment": "macros",
|
752 | 759 | "name": "meta.macro.rust",
|
753 |
| - "match": "(([a-z_][A-Za-z0-9_]*)|([A-Z_][A-Za-z0-9_]*))(!)", |
| 760 | + "match": "(([a-z_][A-Za-z0-9_]*!)|([A-Z_][A-Za-z0-9_]*!))", |
754 | 761 | "captures": {
|
755 | 762 | "2": {
|
756 | 763 | "name": "entity.name.function.macro.rust"
|
757 | 764 | },
|
758 | 765 | "3": {
|
759 | 766 | "name": "entity.name.type.macro.rust"
|
760 |
| - }, |
761 |
| - "4": { |
762 |
| - "name": "keyword.operator.macro.not.rust" |
763 | 767 | }
|
764 | 768 | }
|
765 | 769 | }
|
|
843 | 847 | "match": "\\b(trait)\\s+([A-Z][A-Za-z0-9]*)\\b",
|
844 | 848 | "captures": {
|
845 | 849 | "1": {
|
846 |
| - "name": "keyword.control.rust" |
| 850 | + "name": "storage.type.rust" |
847 | 851 | },
|
848 | 852 | "2": {
|
849 | 853 | "name": "entity.name.type.trait.rust"
|
|
855 | 859 | "match": "\\b(struct)\\s+([A-Z][A-Za-z0-9]*)\\b",
|
856 | 860 | "captures": {
|
857 | 861 | "1": {
|
858 |
| - "name": "keyword.control.rust" |
| 862 | + "name": "storage.type.rust" |
859 | 863 | },
|
860 | 864 | "2": {
|
861 | 865 | "name": "entity.name.type.struct.rust"
|
|
867 | 871 | "match": "\\b(enum)\\s+([A-Z][A-Za-z0-9_]*)\\b",
|
868 | 872 | "captures": {
|
869 | 873 | "1": {
|
870 |
| - "name": "keyword.control.rust" |
| 874 | + "name": "storage.type.rust" |
871 | 875 | },
|
872 | 876 | "2": {
|
873 | 877 | "name": "entity.name.type.enum.rust"
|
|
879 | 883 | "match": "\\b(type)\\s+([A-Z][A-Za-z0-9_]*)\\b",
|
880 | 884 | "captures": {
|
881 | 885 | "1": {
|
882 |
| - "name": "keyword.control.rust" |
| 886 | + "name": "storage.type.rust" |
883 | 887 | },
|
884 | 888 | "2": {
|
885 | 889 | "name": "entity.name.type.declaration.rust"
|
|
0 commit comments