summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authormrBliss <dewinant@gmail.com>2017-01-12 10:33:04 +0100
committermrBliss <dewinant@gmail.com>2017-01-12 10:39:19 +0100
commitb8126e4f647ed6a4f79e623752b0b0821f42890e (patch)
tree7e340056357e17dd45bd234df7a03d024dcdc36e /rust-mode.el
parentc091852fbda25c62095513753b44d3fcaf8eb340 (diff)
downloadrust-mode-b8126e4f647ed6a4f79e623752b0b0821f42890e.tar.gz
Recognize "extern" imenu items
Fixes #188.
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 1527c7a..dfe3e9a 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -33,6 +33,7 @@
(defconst rust-re-uc-ident "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*")
(defconst rust-re-vis "pub")
(defconst rust-re-unsafe "unsafe")
+(defconst rust-re-extern "extern")
(defconst rust-re-non-standard-string
(rx
@@ -571,6 +572,8 @@ buffer."
(concat "^[[:space:]]*"
(rust-re-shy (concat (rust-re-word rust-re-vis) "[[:space:]]+")) "?"
(rust-re-shy (concat (rust-re-word rust-re-unsafe) "[[:space:]]+")) "?"
+ (rust-re-shy (concat (rust-re-word rust-re-extern) "[[:space:]]+"
+ (rust-re-shy "\"[^\"]+\"[[:space:]]+") "?")) "?"
(rust-re-item-def itype)))
(defconst rust-re-special-types (regexp-opt rust-special-types 'symbols))