]> git.eshelyaron.com Git - emacs.git/commitdiff
Fontify C++ parameter packs.
authorAlan Mackenzie <acm@muc.de>
Sat, 23 Jul 2016 15:03:07 +0000 (15:03 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 23 Jul 2016 15:03:07 +0000 (15:03 +0000)
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.

lisp/progmodes/cc-engine.el
lisp/progmodes/cc-langs.el

index 51d278f354d12449de7385a5b25ca25f2a1e99cb..dbcd071da1634d666e7af1ab4d7a5112a405487a 100644 (file)
@@ -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))))
index 30949f8aee1bdc4030db4b7916b7b51162b6b577..ec894f619a8d4e5b64aec01471057f14fbf5fc34 100644 (file)
@@ -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)