diff options
Diffstat (limited to 'editors/code/rust.tmGrammar.json')
-rw-r--r-- | editors/code/rust.tmGrammar.json | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 77595aa00..b3a10795e 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json | |||
@@ -50,7 +50,7 @@ | |||
50 | { | 50 | { |
51 | "comment": "macro type metavariables", | 51 | "comment": "macro type metavariables", |
52 | "name": "meta.macro.metavariable.type.rust", | 52 | "name": "meta.macro.metavariable.type.rust", |
53 | "match": "(\\$)((crate)|([A-Z][A-Za-z0-9_]*))((:)(block|expr|ident|item|lifetime|literal|meta|pat|path|stmt|tt|ty|vis))?", | 53 | "match": "(\\$)((crate)|([A-Z][A-Za-z0-9_]*))((:)(block|expr|ident|item|lifetime|literal|meta|path?|stmt|tt|ty|vis))?", |
54 | "captures": { | 54 | "captures": { |
55 | "1": { | 55 | "1": { |
56 | "name": "keyword.operator.macro.dollar.rust" | 56 | "name": "keyword.operator.macro.dollar.rust" |
@@ -77,7 +77,7 @@ | |||
77 | { | 77 | { |
78 | "comment": "macro metavariables", | 78 | "comment": "macro metavariables", |
79 | "name": "meta.macro.metavariable.rust", | 79 | "name": "meta.macro.metavariable.rust", |
80 | "match": "(\\$)([a-z][A-Za-z0-9_]*)((:)(block|expr|ident|item|lifetime|literal|meta|pat|path|stmt|tt|ty|vis))?", | 80 | "match": "(\\$)([a-z][A-Za-z0-9_]*)((:)(block|expr|ident|item|lifetime|literal|meta|path?|stmt|tt|ty|vis))?", |
81 | "captures": { | 81 | "captures": { |
82 | "1": { | 82 | "1": { |
83 | "name": "keyword.operator.macro.dollar.rust" | 83 | "name": "keyword.operator.macro.dollar.rust" |
@@ -167,7 +167,7 @@ | |||
167 | "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)", | 167 | "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)", |
168 | "captures": { | 168 | "captures": { |
169 | "1": { | 169 | "1": { |
170 | "name": "keyword.control.rust" | 170 | "name": "storage.type.rust" |
171 | }, | 171 | }, |
172 | "2": { | 172 | "2": { |
173 | "name": "entity.name.module.rust" | 173 | "name": "entity.name.module.rust" |
@@ -180,7 +180,7 @@ | |||
180 | "begin": "\\b(extern)\\s+(crate)", | 180 | "begin": "\\b(extern)\\s+(crate)", |
181 | "beginCaptures": { | 181 | "beginCaptures": { |
182 | "1": { | 182 | "1": { |
183 | "name": "keyword.control.rust" | 183 | "name": "storage.type.rust" |
184 | }, | 184 | }, |
185 | "2": { | 185 | "2": { |
186 | "name": "keyword.other.crate.rust" | 186 | "name": "keyword.other.crate.rust" |
@@ -213,7 +213,7 @@ | |||
213 | "begin": "\\b(use)\\s", | 213 | "begin": "\\b(use)\\s", |
214 | "beginCaptures": { | 214 | "beginCaptures": { |
215 | "1": { | 215 | "1": { |
216 | "name": "keyword.control.rust" | 216 | "name": "keyword.other.rust" |
217 | } | 217 | } |
218 | }, | 218 | }, |
219 | "end": ";", | 219 | "end": ";", |
@@ -342,7 +342,7 @@ | |||
342 | "match": "\\b(const)\\s+([A-Z][A-Za-z0-9_]*)\\b", | 342 | "match": "\\b(const)\\s+([A-Z][A-Za-z0-9_]*)\\b", |
343 | "captures": { | 343 | "captures": { |
344 | "1": { | 344 | "1": { |
345 | "name": "keyword.control.rust" | 345 | "name": "storage.type.rust" |
346 | }, | 346 | }, |
347 | "2": { | 347 | "2": { |
348 | "name": "constant.other.caps.rust" | 348 | "name": "constant.other.caps.rust" |
@@ -450,7 +450,7 @@ | |||
450 | "begin": "\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)((\\()|(<))", | 450 | "begin": "\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)((\\()|(<))", |
451 | "beginCaptures": { | 451 | "beginCaptures": { |
452 | "1": { | 452 | "1": { |
453 | "name": "keyword.control.fn.rust" | 453 | "name": "keyword.other.fn.rust" |
454 | }, | 454 | }, |
455 | "2": { | 455 | "2": { |
456 | "name": "entity.name.function.rust" | 456 | "name": "entity.name.function.rust" |
@@ -643,7 +643,7 @@ | |||
643 | { | 643 | { |
644 | "comment": "control flow keywords", | 644 | "comment": "control flow keywords", |
645 | "name": "keyword.control.rust", | 645 | "name": "keyword.control.rust", |
646 | "match": "\\b(async|await|break|continue|do|else|for|if|loop|match|move|return|try|where|while|yield)\\b" | 646 | "match": "\\b(await|break|continue|do|else|for|if|loop|match|return|try|while|yield)\\b" |
647 | }, | 647 | }, |
648 | { | 648 | { |
649 | "comment": "storage keywords", | 649 | "comment": "storage keywords", |
@@ -658,7 +658,7 @@ | |||
658 | { | 658 | { |
659 | "comment": "other keywords", | 659 | "comment": "other keywords", |
660 | "name": "keyword.other.rust", | 660 | "name": "keyword.other.rust", |
661 | "match": "\\b(as|become|box|dyn|final|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual)\\b" | 661 | "match": "\\b(as|async|become|box|dyn|move|final|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual|where)\\b" |
662 | }, | 662 | }, |
663 | { | 663 | { |
664 | "comment": "fn", | 664 | "comment": "fn", |
@@ -676,11 +676,6 @@ | |||
676 | "match": "\\bmut\\b" | 676 | "match": "\\bmut\\b" |
677 | }, | 677 | }, |
678 | { | 678 | { |
679 | "comment": "math operators", | ||
680 | "name": "keyword.operator.math.rust", | ||
681 | "match": "(([+%]|(\\*(?!\\w)))(?!=))|(-(?!>))|(/(?!/))" | ||
682 | }, | ||
683 | { | ||
684 | "comment": "logical operators", | 679 | "comment": "logical operators", |
685 | "name": "keyword.operator.logical.rust", | 680 | "name": "keyword.operator.logical.rust", |
686 | "match": "(\\^|\\||\\|\\||&&|<<|>>|!)(?!=)" | 681 | "match": "(\\^|\\||\\|\\||&&|<<|>>|!)(?!=)" |
@@ -693,7 +688,7 @@ | |||
693 | { | 688 | { |
694 | "comment": "assignment operators", | 689 | "comment": "assignment operators", |
695 | "name": "keyword.operator.assignment.rust", | 690 | "name": "keyword.operator.assignment.rust", |
696 | "match": "(-=|\\*=|/=|%=|\\^=|&=|\\|=|<<=|>>=)" | 691 | "match": "(\\+=|-=|\\*=|/=|%=|\\^=|&=|\\|=|<<=|>>=)" |
697 | }, | 692 | }, |
698 | { | 693 | { |
699 | "comment": "single equal", | 694 | "comment": "single equal", |
@@ -706,6 +701,11 @@ | |||
706 | "match": "(=(=)?(?!>)|!=|<=|(?<!=)>=)" | 701 | "match": "(=(=)?(?!>)|!=|<=|(?<!=)>=)" |
707 | }, | 702 | }, |
708 | { | 703 | { |
704 | "comment": "math operators", | ||
705 | "name": "keyword.operator.math.rust", | ||
706 | "match": "(([+%]|(\\*(?!\\w)))(?!=))|(-(?!>))|(/(?!/))" | ||
707 | }, | ||
708 | { | ||
709 | "comment": "less than, greater than (special case)", | 709 | "comment": "less than, greater than (special case)", |
710 | "match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))", | 710 | "match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))", |
711 | "captures": { | 711 | "captures": { |
@@ -1127,7 +1127,7 @@ | |||
1127 | { | 1127 | { |
1128 | "comment": "variables", | 1128 | "comment": "variables", |
1129 | "name": "variable.other.rust", | 1129 | "name": "variable.other.rust", |
1130 | "match": "\\b(?<!\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b" | 1130 | "match": "\\b(?<!(?<!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b" |
1131 | } | 1131 | } |
1132 | ] | 1132 | ] |
1133 | } | 1133 | } |