summaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/rust-prog-mode.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/rust-prog-mode.el')
-rw-r--r--.emacs.d/lisp/rust-prog-mode.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/.emacs.d/lisp/rust-prog-mode.el b/.emacs.d/lisp/rust-prog-mode.el
index f2f3f0b..ea6ef82 100644
--- a/.emacs.d/lisp/rust-prog-mode.el
+++ b/.emacs.d/lisp/rust-prog-mode.el
@@ -112,6 +112,14 @@ to the function arguments. When nil, `->' will be indented one level."
112 (or space line-start) 112 (or space line-start)
113 (group symbol-start "union" symbol-end) 113 (group symbol-start "union" symbol-end)
114 (+ space) (regexp ,rust-re-ident)))) 114 (+ space) (regexp ,rust-re-ident))))
115(defconst rust-re-raw
116 (rx-to-string
117 `(seq
118 "&"
119 (zero-or-more space)
120 (group "raw")
121 (one-or-more space)
122 (or "const" "mut"))))
115 123
116(defun rust-re-item-def (itype) 124(defun rust-re-item-def (itype)
117 (concat (rust-re-word itype) 125 (concat (rust-re-word itype)
@@ -269,6 +277,7 @@ Does not match type annotations of the form \"foo::<\"."
269 ;; Contextual keywords 277 ;; Contextual keywords
270 ("\\_<\\(default\\)[[:space:]]+fn\\_>" 1 font-lock-keyword-face) 278 ("\\_<\\(default\\)[[:space:]]+fn\\_>" 1 font-lock-keyword-face)
271 (,rust-re-union 1 font-lock-keyword-face) 279 (,rust-re-union 1 font-lock-keyword-face)
280 (,rust-re-raw 1 font-lock-keyword-face)
272 281
273 ;; Special types 282 ;; Special types
274 (,(regexp-opt rust-special-types 'symbols) . font-lock-type-face) 283 (,(regexp-opt rust-special-types 'symbols) . font-lock-type-face)