Don't call c-parse-state when c++-template-syntax-table is active.
[bpt/emacs.git] / lisp / progmodes / cc-fonts.el
index 376edcd..bf5630d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cc-fonts.el --- font lock support for CC Mode
 
-;; Copyright (C) 2002-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2014 Free Software Foundation, Inc.
 
 ;; Authors:    2003- Alan Mackenzie
 ;;             2002- Martin Stjernholm
       'font-lock-negation-char-face))
 
 (cc-bytecomp-defun face-inverse-video-p) ; Only in Emacs.
-(cc-bytecomp-defun face-property-instance) ; Only in XEmacs.
 
 (defun c-make-inverse-face (oldface newface)
   ;; Emacs and XEmacs have completely different face manipulation
@@ -1308,7 +1307,8 @@ casts and declarations are fontified.  Used on level 2 and higher."
                            (goto-char match-pos)
                            (backward-char)
                            (c-backward-token-2)
-                           (looking-at c-block-stmt-2-key)))
+                           (or (looking-at c-block-stmt-2-key)
+                               (looking-at c-block-stmt-1-2-key))))
                     (setq context nil
                           c-restricted-<>-arglists t))
                    ;; Near BOB.
@@ -1473,11 +1473,7 @@ casts and declarations are fontified.  Used on level 2 and higher."
                      (numberp (car paren-state))
                      (save-excursion
                        (goto-char (car paren-state))
-                       (c-backward-token-2)
-                       (or (looking-at c-brace-list-key)
-                           (progn
-                             (c-backward-token-2)
-                             (looking-at c-brace-list-key)))))))
+                       (c-backward-over-enum-header)))))
              (c-forward-token-2)
              nil)
 
@@ -1567,12 +1563,7 @@ casts and declarations are fontified.  Used on level 2 and higher."
           (eq (char-after encl-pos) ?\{)
           (save-excursion
             (goto-char encl-pos)
-            (c-backward-syntactic-ws)
-            (c-simple-skip-symbol-backward)
-            (or (looking-at c-brace-list-key) ; "enum"
-                (progn (c-backward-syntactic-ws)
-                       (c-simple-skip-symbol-backward)
-                       (looking-at c-brace-list-key)))))
+            (c-backward-over-enum-header)))
       (c-syntactic-skip-backward "^{," nil t)
       (c-put-char-property (1- (point)) 'c-type 'c-decl-id-start)
 
@@ -1893,7 +1884,7 @@ higher."
                "\\)\\>"
                ;; Disallow various common punctuation chars that can't come
                ;; before the '{' of the enum list, to avoid searching too far.
-               "[^\]\[{}();,/#=]*"
+               "[^\]\[{}();/#=]*"
                "{")
               '((c-font-lock-declarators limit t nil)
                 (save-match-data
@@ -2049,7 +2040,7 @@ styles specified by `c-doc-comment-style'.")
 
 (defconst c-font-lock-keywords-3 (c-lang-const c-matchers-3 c)
   "Accurate normal font locking for C mode.
-Like `c-font-lock-keywords-2' but detects declarations in a more
+Like the variable `c-font-lock-keywords-2' but detects declarations in a more
 accurate way that works in most cases for arbitrary types without the
 need for `c-font-lock-extra-types'.")
 
@@ -2207,7 +2198,7 @@ styles specified by `c-doc-comment-style'.")
 
 (defconst c++-font-lock-keywords-3 (c-lang-const c-matchers-3 c++)
   "Accurate normal font locking for C++ mode.
-Like `c++-font-lock-keywords-2' but detects declarations in a more
+Like the variable `c++-font-lock-keywords-2' but detects declarations in a more
 accurate way that works in most cases for arbitrary types without the
 need for `c++-font-lock-extra-types'.")
 
@@ -2313,7 +2304,7 @@ comment styles specified by `c-doc-comment-style'.")
 
 (defconst objc-font-lock-keywords-3 (c-lang-const c-matchers-3 objc)
   "Accurate normal font locking for Objective-C mode.
-Like `objc-font-lock-keywords-2' but detects declarations in a more
+Like the variable `objc-font-lock-keywords-2' but detects declarations in a more
 accurate way that works in most cases for arbitrary types without the
 need for `objc-font-lock-extra-types'.")
 
@@ -2356,7 +2347,7 @@ comment styles specified by `c-doc-comment-style'.")
 
 (defconst java-font-lock-keywords-3 (c-lang-const c-matchers-3 java)
   "Accurate normal font locking for Java mode.
-Like `java-font-lock-keywords-2' but detects declarations in a more
+Like variable `java-font-lock-keywords-2' but detects declarations in a more
 accurate way that works in most cases for arbitrary types without the
 need for `java-font-lock-extra-types'.")
 
@@ -2389,7 +2380,7 @@ styles specified by `c-doc-comment-style'.")
 
 (defconst idl-font-lock-keywords-3 (c-lang-const c-matchers-3 idl)
   "Accurate normal font locking for CORBA IDL mode.
-Like `idl-font-lock-keywords-2' but detects declarations in a more
+Like the variable `idl-font-lock-keywords-2' but detects declarations in a more
 accurate way that works in most cases for arbitrary types without the
 need for `idl-font-lock-extra-types'.")
 
@@ -2422,7 +2413,7 @@ comment styles specified by `c-doc-comment-style'.")
 
 (defconst pike-font-lock-keywords-3 (c-lang-const c-matchers-3 pike)
   "Accurate normal font locking for Pike mode.
-Like `pike-font-lock-keywords-2' but detects declarations in a more
+Like the variable `pike-font-lock-keywords-2' but detects declarations in a more
 accurate way that works in most cases for arbitrary types without the
 need for `pike-font-lock-extra-types'.")
 
@@ -2486,7 +2477,7 @@ need for `pike-font-lock-extra-types'.")
              (setq comment-beg nil))
            (setq region-beg comment-beg))
 
-      (if (eq (elt (parse-partial-sexp comment-beg (+ comment-beg 2)) 7) t)
+      (if (elt (parse-partial-sexp comment-beg (+ comment-beg 2)) 7)
          ;; Collect a sequence of doc style line comments.
          (progn
            (goto-char comment-beg)