auto merge of #14818 : tomjakubowski/rust/emacs-attributes-key-value, r=pnkfelix
This addresses two problems noted in #14347: the highlight of `#foo]` as an attribute, and the non-highlight of `#[foo = "bar"]`.
This commit is contained in:
commit
feb294ca11
1 changed files with 3 additions and 3 deletions
|
|
@ -212,9 +212,9 @@
|
|||
;; Special types
|
||||
(,(regexp-opt rust-special-types 'words) . font-lock-type-face)
|
||||
|
||||
;; Attributes like `#[bar(baz)]` or `#![bar(baz)]`
|
||||
(,(rust-re-grab (concat "#\\!?[" rust-re-ident "[^]]*\\]"))
|
||||
1 font-lock-preprocessor-face)
|
||||
;; Attributes like `#[bar(baz)]` or `#![bar(baz)]` or `#[bar = "baz"]`
|
||||
(,(rust-re-grab (concat "#\\!?\\[" rust-re-ident "[^]]*\\]"))
|
||||
1 font-lock-preprocessor-face t)
|
||||
|
||||
;; Syntax extension invocations like `foo!`, highlight including the !
|
||||
(,(concat (rust-re-grab (concat rust-re-ident "!")) "[({[:space:][]")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue