]> git.eshelyaron.com Git - emacs.git/commitdiff
Resolve invalid use of a regexp in regexp-opt.
authorAlan Mackenzie <acm@muc.de>
Sat, 20 Aug 2011 22:02:25 +0000 (22:02 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 20 Aug 2011 22:02:25 +0000 (22:02 +0000)
cc-fonts.el (c-complex-decl-matchers): Add in special detection for a
java annotation.

cc-engine.el (c-forward-decl-or-cast-1): Add in special detection for a
java annotation.

cc-langs.el (c-prefix-spec-kwds-re): Remove the special handling for
java.
(c-modifier-kwds): Remove the regexp "@[A-za-z0-9]+".

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

index cab269240417cae57e93d23ac172637c7d1afaf8..efacb110d1b336657e3838bc9deabbf61a2232c0 100644 (file)
@@ -1,3 +1,17 @@
+2011-08-20  Alan Mackenzie  <acm@muc.de>
+
+       Resolve invalid use of a regexp in regexp-opt.
+
+       * cc-fonts.el (c-complex-decl-matchers): Add in special detection
+       for a java annotation.
+
+       * cc-engine.el (c-forward-decl-or-cast-1): Add in special
+       detection for a java annotation.
+
+       * cc-langs.el (c-prefix-spec-kwds-re): Remove the special handling
+       for java.
+       (c-modifier-kwds): Remove the regexp "@[A-za-z0-9]+".
+
 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
 
        * startup.el (normal-top-level-add-subdirs-to-load-path): Doc fix
index 0d88f85d263e8b1d44f93c4825e80b5679312df1..a1cbdc1656076fbc25ce5edf75502fd8afb3a317 100644 (file)
@@ -6325,7 +6325,9 @@ comment at the start of cc-engine.el for more info."
        (let* ((start (point)) kwd-sym kwd-clause-end found-type)
 
          ;; Look for a specifier keyword clause.
-         (when (looking-at c-prefix-spec-kwds-re)
+         (when (or (looking-at c-prefix-spec-kwds-re)
+                   (and (c-major-mode-is 'java-mode)
+                        (looking-at "@[A-Za-z0-9]+")))
            (if (looking-at c-typedef-key)
                (setq at-typedef t))
            (setq kwd-sym (c-keyword-sym (match-string 1)))
index dea205221c9d64307876568d7ecd925aab8323e9..3d5dc30d82321f2190b9d69306528ca4b180348c 100644 (file)
@@ -1666,7 +1666,9 @@ on level 2 only and so aren't combined with `c-complex-decl-matchers'."
                        (unless (c-skip-comments-and-strings limit)
                          (c-forward-syntactic-ws)
                          ;; Handle prefix declaration specifiers.
-                         (when (looking-at c-prefix-spec-kwds-re)
+                         (when (or (looking-at c-prefix-spec-kwds-re)
+                                   (and (c-major-mode-is 'java-mode)
+                                        (looking-at "@[A-Za-z0-9]+")))
                            (c-forward-keyword-clause 1))
                          ,(if (c-major-mode-is 'c++-mode)
                               `(when (and (c-forward-type)
index 153ef0880c7a3a0a2b22530801f987ef865c6e14..279c5e46c46e05a08f2b2a4353b8e2f2648e4f5f 100644 (file)
@@ -1823,7 +1823,7 @@ will be handled."
         "bindsTo" "delegatesTo" "implements" "proxy" "storedOn")
   ;; Note: "const" is not used in Java, but it's still a reserved keyword.
   java '("abstract" "const" "final" "native" "private" "protected" "public"
-        "static" "strictfp" "synchronized" "transient" "volatile" "@[A-Za-z0-9]+")
+        "static" "strictfp" "synchronized" "transient" "volatile")
   pike '("final" "inline" "local" "nomask" "optional" "private" "protected"
         "public" "static" "variant"))
 
@@ -1909,10 +1909,7 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
 
 (c-lang-defconst c-prefix-spec-kwds-re
   ;; Adorned regexp of `c-prefix-spec-kwds'.
-  t (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds))
-  java (replace-regexp-in-string
-     "\\\\\\[" "["
-     (replace-regexp-in-string "\\\\\\+" "+" (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds)))))
+  t (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds)))
 
 (c-lang-defvar c-prefix-spec-kwds-re (c-lang-const c-prefix-spec-kwds-re))