File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 326
326
(defun rust-re-item-def (itype )
327
327
(concat (rust-re-word itype) " [[:space:]]+" (rust-re-grab rust-re-ident)))
328
328
329
+ ; ; (See PR #42 -- this is just like `(regexp-opt words 'symbols)` from
330
+ ; ; newer Emacs versions, but will work on Emacs 23.)
331
+ (defun regexp-opt-symbols (words )
332
+ (concat " \\ _<" (regexp-opt words t ) " \\ _>" ))
333
+
329
334
(defvar rust-mode-font-lock-keywords
330
335
(append
331
336
`(
332
337
; ; Keywords proper
333
- (,(regexp-opt rust-mode-keywords 'symbols ) . font-lock-keyword-face )
338
+ (,(regexp-opt-symbols rust-mode-keywords) . font-lock-keyword-face )
334
339
335
340
; ; Special types
336
- (,(regexp-opt rust-special-types 'symbols ) . font-lock-type-face )
341
+ (,(regexp-opt-symbols rust-special-types) . font-lock-type-face )
337
342
338
343
; ; Attributes like `#[bar(baz)]` or `#![bar(baz)]` or `#[bar = "baz"]`
339
344
(,(rust-re-grab (concat " #\\ !?\\ [" rust-re-ident " [^]]*\\ ]" ))
You can’t perform that action at this time.
0 commit comments