summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorMicah Chalmer <micah@micahchalmer.net>2015-08-14 20:08:42 -0400
committerMicah Chalmer <micah@micahchalmer.net>2015-08-14 20:08:42 -0400
commit1ff1d7576b6882fc146b38a43ab84f6562441876 (patch)
tree18efb93d4d02dbcc99905c203e43754bbf7a61d7 /rust-mode.el
parent5f5a428024e796e6a5a06c6044a15729c233cd93 (diff)
parent5e77aedb27761d770e7e1a3b37875d3a4b0e932f (diff)
downloadrust-mode-1ff1d7576b6882fc146b38a43ab84f6562441876.tar.gz
Merge pull request #90 from Wilfred/fix_type_word_boundaries
Correcting highlighting of capitals in function names.
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 15c1be7..b237896 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -359,11 +359,14 @@
"bool"
"str" "char"))
-(defconst rust-re-CamelCase "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*")
+(defconst rust-re-type-or-constructor
+ (rx symbol-start
+ (group upper (0+ (any word nonascii digit "_")))
+ symbol-end))
+
(defconst rust-re-pre-expression-operators "[-=!%&*/:<>[{(|.^;}]")
(defun rust-re-word (inner) (concat "\\<" inner "\\>"))
(defun rust-re-grab (inner) (concat "\\(" inner "\\)"))
-(defun rust-re-grabword (inner) (rust-re-grab (rust-re-word inner)))
(defun rust-re-item-def (itype)
(concat (rust-re-word itype) "[[:space:]]+" (rust-re-grab rust-re-ident)))
@@ -400,7 +403,7 @@
(,(concat "'" (rust-re-grab rust-re-ident) "[^']") 1 font-lock-variable-name-face)
;; CamelCase Means Type Or Constructor
- (,(rust-re-grabword rust-re-CamelCase) 1 font-lock-type-face)
+ (,rust-re-type-or-constructor 1 font-lock-type-face)
)
;; Item definitions