+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
(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)))
(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)
"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"))
(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))