File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 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."
979979 '(" '\" '" font-lock-string-face
980980 " let" font-lock-keyword-face )))
981981
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+
982988(ert-deftest font-lock-single-quote-character-literal ()
983989 (rust-test-font-lock
984990 " fn main() { let ch = '\\ ''; }"
Original file line number Diff line number Diff line change 359359 " bool"
360360 " str" " char" ))
361361
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+
363367(defconst rust-re-pre-expression-operators " [-=!%&*/:<>[{(|.^;}]" )
364368(defun rust-re-word (inner ) (concat " \\ <" inner " \\ >" ))
365369(defun rust-re-grab (inner ) (concat " \\ (" inner " \\ )" ))
366- (defun rust-re-grabword (inner ) (rust-re-grab (rust-re-word inner)))
367370(defun rust-re-item-def (itype )
368371 (concat (rust-re-word itype) " [[:space:]]+" (rust-re-grab rust-re-ident)))
369372
400403 (,(concat " '" (rust-re-grab rust-re-ident) " [^']" ) 1 font-lock-variable-name-face )
401404
402405 ; ; 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 )
404407 )
405408
406409 ; ; Item definitions
You can’t perform that action at this time.
0 commit comments