commit 4d34210256c6e07cb713ece8d7ad998a873f0f94 (HEAD, refs/remotes/origin/master) Author: Alan Mackenzie Date: Sat Jul 23 15:03:07 2016 +0000 Fontify C++ parameter packs. This fixes debbugs #23610. * lisp/progmodes/cc-langs.el (c-pack-ops, c-pack-key): New c-lang-defconsts/defvars. (c-type-decl-prefix-key): Add "..." and "&&" into the C++ version. * lisp/progmodes/cc-engine.el (c-forward-type): Handle matches of c-pack-key. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 51d278f..dbcd071 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -7091,6 +7091,9 @@ comment at the start of cc-engine.el for more info." (while (cond ((looking-at c-decl-hangon-key) (c-forward-keyword-clause 1)) + ((looking-at c-pack-key) + (goto-char (match-end 1)) + (c-forward-syntactic-ws)) ((and c-opt-cpp-prefix (looking-at c-noise-macro-with-parens-name-re)) (c-forward-noise-clause)))) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 30949f8..ec894f6 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1329,6 +1329,14 @@ operators." (c-lang-defvar c-stmt-delim-chars-with-comma (c-lang-const c-stmt-delim-chars-with-comma)) +(c-lang-defconst c-pack-ops + "Ops which signal C++11's \"parameter pack\"" + t nil + c++ '("...")) +(c-lang-defconst c-pack-key + t (c-make-keywords-re 'appendable (c-lang-const c-pack-ops))) +(c-lang-defvar c-pack-key (c-lang-const c-pack-key)) + (c-lang-defconst c-auto-ops ;; Ops which signal C++11's new auto uses. t nil @@ -2958,6 +2966,10 @@ Identifier syntax is in effect when this is matched \(see "\\)" "\\([^=]\\|$\\)") c++ (concat "\\(" + "&&" + "\\|" + "\\.\\.\\." + "\\|" "[*(&]" "\\|" (c-lang-const c-type-decl-prefix-key) commit edcdf64960a2ab4e8d9ce4419874e43b6d3ccee4 Author: Alan Mackenzie Date: Sat Jul 23 10:43:34 2016 +0000 Java Mode: Handle strings as case labels correctly. This fixes debbugs #23901. * lisp/progmodes/cc-langs.el (c-nonlabel-token-key): Remove "\"" from the Java value. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 4d36684..30949f8 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3253,8 +3253,8 @@ i.e. before \":\". Only used if `c-recognize-colon-labels' is set." (append (c-lang-const c-label-kwds) (c-lang-const c-protection-kwds)) :test 'string-equal))) - ;; Don't allow string literals, except in AWK. Character constants are OK. - (c objc java pike idl) (concat "\"\\|" + ;; Don't allow string literals, except in AWK and Java. Character constants are OK. + (c objc pike idl) (concat "\"\\|" (c-lang-const c-nonlabel-token-key)) ;; Also check for open parens in C++, to catch member init lists in ;; constructors. We normally allow it so that macros with arguments