1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/f403d0ee1451/
Changeset: f403d0ee1451
User: acm
Date: 2017-12-14 17:43:41+00:00
Summary: Fix misfontification of C++ member initialization list after
"throw"
* cc-engine.el (c-forward-type): Stop recognizing a "type" starting with
"throw", by using c-opt-type-modifier-prefix-key.
* cc-langs.el (c-type-modifier-prefix-kwds): New lang const which, in C++,
doesn't contain "throw", otherwise like c-type-modifier-kwds.
(c-opt-type-modifier-prefix-key): New lang const and var, a regexp matching
any keyword in the previous lang const.
Affected #: 2 files
diff -r f317d82b1010097a2b092dd010c6d0ec5b45a85d -r
f403d0ee1451d89f9bc647ae8c73dc96c7551952 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -7583,8 +7583,8 @@
;; Skip leading type modifiers. If any are found we know it's a
;; prefix of a type.
- (when c-opt-type-modifier-key ; e.g. "const" "volatile", but NOT
"typedef"
- (while (looking-at c-opt-type-modifier-key)
+ (when c-opt-type-modifier-prefix-key ; e.g. "const" "volatile",
but NOT "typedef"
+ (while (looking-at c-opt-type-modifier-prefix-key)
(goto-char (match-end 1))
(c-forward-syntactic-ws)
(setq res 'prefix)))
diff -r f317d82b1010097a2b092dd010c6d0ec5b45a85d -r
f403d0ee1451d89f9bc647ae8c73dc96c7551952 cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -1908,16 +1908,32 @@
t (c-make-keywords-re t (c-lang-const c-type-prefix-kwds)))
(c-lang-defvar c-type-prefix-key (c-lang-const c-type-prefix-key))
-(c-lang-defconst c-type-modifier-kwds
- "Type modifier keywords. These can occur almost anywhere in types
-but they don't build a type of themselves. Unlike the keywords on
-`c-primitive-type-kwds', they are fontified with the keyword face and
-not the type face."
+(c-lang-defconst c-type-modifier-prefix-kwds
+ "Type modifier keywords which can appear in front of a type. These can
+also occur almost anywhere in types but they don't build a type of
+themselves. Unlike the keywords on `c-primitive-type-kwds', they are
+fontified with the keyword face and not the type face."
t nil
c '("const" "restrict" "volatile")
- c++ '("const" "noexcept" "volatile"
"throw")
+ c++ '("const" "noexcept" "volatile")
objc '("const" "volatile"))
+(c-lang-defconst c-opt-type-modifier-prefix-key
+ ;; Adorned regexp matching `c-type-modifier-prefix-kwds', or nil in
+ ;; languages without such keywords.
+ t (and (c-lang-const c-type-modifier-prefix-kwds)
+ (c-make-keywords-re t (c-lang-const c-type-modifier-prefix-kwds))))
+(c-lang-defvar c-opt-type-modifier-prefix-key
+ (c-lang-const c-opt-type-modifier-prefix-key))
+
+(c-lang-defconst c-type-modifier-kwds
+ "Type modifier keywords. These can occur almost anywhere in types except
+at the start, but they don't build a type of themselves. Unlike the keywords
+on `c-primitive-type-kwds', they are fontified with the keyword face and not
+the type face."
+ t (c-lang-const c-type-modifier-prefix-kwds)
+ c++ (append (c-lang-const c-type-modifier-prefix-kwds) '("throw")))
+
(c-lang-defconst c-opt-type-modifier-key
;; Adorned regexp matching `c-type-modifier-kwds', or nil in
;; languages without such keywords.
Repository URL:
https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.