File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -979,6 +979,12 @@ list of substrings of `STR' each followed by its face."
979
979
'(" '\" '" font-lock-string-face
980
980
" let" font-lock-keyword-face )))
981
981
982
+ (ert-deftest font-lock-fn-contains-capital ()
983
+ (rust-test-font-lock
984
+ " fn foo_Bar() {}"
985
+ '(" fn" font-lock-keyword-face
986
+ " foo_Bar" font-lock-function-name-face )))
987
+
982
988
(ert-deftest font-lock-single-quote-character-literal ()
983
989
(rust-test-font-lock
984
990
" fn main() { let ch = '\\ ''; }"
Original file line number Diff line number Diff line change 359
359
" bool"
360
360
" str" " char" ))
361
361
362
- (defconst rust-re-CamelCase " [[:upper:]][[:word:][:multibyte:]_[:digit:]]*" )
362
+ (defconst rust-re-type-or-constructor
363
+ (rx symbol-start
364
+ (group upper (0+ (any word nonascii digit " _" )))
365
+ symbol-end))
366
+
363
367
(defconst rust-re-pre-expression-operators " [-=!%&*/:<>[{(|.^;}]" )
364
368
(defun rust-re-word (inner ) (concat " \\ <" inner " \\ >" ))
365
369
(defun rust-re-grab (inner ) (concat " \\ (" inner " \\ )" ))
366
- (defun rust-re-grabword (inner ) (rust-re-grab (rust-re-word inner)))
367
370
(defun rust-re-item-def (itype )
368
371
(concat (rust-re-word itype) " [[:space:]]+" (rust-re-grab rust-re-ident)))
369
372
400
403
(,(concat " '" (rust-re-grab rust-re-ident) " [^']" ) 1 font-lock-variable-name-face )
401
404
402
405
; ; CamelCase Means Type Or Constructor
403
- (,( rust-re-grabword rust-re-CamelCase) 1 font-lock-type-face )
406
+ (, rust-re-type-or-constructor 1 font-lock-type-face )
404
407
)
405
408
406
409
; ; Item definitions
You can’t perform that action at this time.
0 commit comments