1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/1bdd63c23b3d/
Changeset: 1bdd63c23b3d
User: acm
Date: 2013-09-07 16:21:31
Summary: Correctly fontify Java class constructors.
cc-langs.el (c-type-decl-suffix-key): Now matches ")" in Java Mode.
(c-recognize-typeless-decls): Set the Java value to t.
cc-engine.el (c-forward-decl-or-cast-1): While handling a "(", add a
check for, effectively, Java, and handle a "typeless" declaration there.
Affected #: 2 files
diff -r e0466fccd2dfbf91a8b7352ac602003554fadf19 -r
1bdd63c23b3dcf39b93f66655ccd457f515be41d cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -6944,32 +6944,38 @@
;; Skip over type decl prefix operators. (Note similar code in
;; `c-font-lock-declarators'.)
- (while (and (looking-at c-type-decl-prefix-key)
- (if (and (c-major-mode-is 'c++-mode)
- (match-beginning 3))
- ;; If the third submatch matches in C++ then
- ;; we're looking at an identifier that's a
- ;; prefix only if it specifies a member pointer.
- (when (setq got-identifier (c-forward-name))
- (if (looking-at "\\(::\\)")
- ;; We only check for a trailing "::" and
- ;; let the "*" that should follow be
- ;; matched in the next round.
- (progn (setq got-identifier nil) t)
- ;; It turned out to be the real identifier,
- ;; so stop.
- nil))
- t))
-
- (if (eq (char-after) ?\()
+ (if (and c-recognize-typeless-decls
+ (equal c-type-decl-prefix-key "\\<\\>"))
+ (when (eq (char-after) ?\()
(progn
(setq paren-depth (1+ paren-depth))
- (forward-char))
- (unless got-prefix-before-parens
- (setq got-prefix-before-parens (= paren-depth 0)))
- (setq got-prefix t)
- (goto-char (match-end 1)))
- (c-forward-syntactic-ws))
+ (forward-char)))
+ (while (and (looking-at c-type-decl-prefix-key)
+ (if (and (c-major-mode-is 'c++-mode)
+ (match-beginning 3))
+ ;; If the third submatch matches in C++ then
+ ;; we're looking at an identifier that's a
+ ;; prefix only if it specifies a member pointer.
+ (when (setq got-identifier (c-forward-name))
+ (if (looking-at "\\(::\\)")
+ ;; We only check for a trailing "::" and
+ ;; let the "*" that should follow be
+ ;; matched in the next round.
+ (progn (setq got-identifier nil) t)
+ ;; It turned out to be the real identifier,
+ ;; so stop.
+ nil))
+ t))
+
+ (if (eq (char-after) ?\()
+ (progn
+ (setq paren-depth (1+ paren-depth))
+ (forward-char))
+ (unless got-prefix-before-parens
+ (setq got-prefix-before-parens (= paren-depth 0)))
+ (setq got-prefix t)
+ (goto-char (match-end 1)))
+ (c-forward-syntactic-ws)))
(setq got-parens (> paren-depth 0))
diff -r e0466fccd2dfbf91a8b7352ac602003554fadf19 -r
1bdd63c23b3dcf39b93f66655ccd457f515be41d cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -2807,7 +2807,8 @@
"\\>")
"")
"\\)")
- (java idl) "\\([\[\(]\\)")
+ java "\\([\[\(\)]\\)"
+ idl "\\([\[\(]\\)")
(c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key)
'dont-doc)
@@ -2926,7 +2927,7 @@
that are preceded by a declaration starting keyword, so
e.g. `c-typeless-decl-kwds' may still be used when it's set to nil."
t nil
- (c c++ objc) t)
+ (c c++ objc java) t)
(c-lang-defvar c-recognize-typeless-decls
(c-lang-const c-recognize-typeless-decls))
Repository URL:
https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches