emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113416: progmodes/cc-engine.el (c-forward-decl-or-c


From: Alan Mackenzie
Subject: [Emacs-diffs] trunk r113416: progmodes/cc-engine.el (c-forward-decl-or-cast-1): Label CASE 13
Date: Sat, 13 Jul 2013 17:46:48 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113416
revision-id: address@hidden
parent: address@hidden
committer: Alan Mackenzie <address@hidden>
branch nick: trunk
timestamp: Sat 2013-07-13 17:45:07 +0000
message:
  progmodes/cc-engine.el (c-forward-decl-or-cast-1): Label CASE 13
  and comment it out.  This out-commenting enables certain C++
  declarations to be parsed correctly.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/cc-engine.el    
ccengine.el-20091113204419-o5vbwnq5f7feedwu-1227
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-07-13 10:55:21 +0000
+++ b/lisp/ChangeLog    2013-07-13 17:45:07 +0000
@@ -1,3 +1,9 @@
+2013-07-13  Alan Mackenzie  <address@hidden>
+
+       * progmodes/cc-engine.el (c-forward-decl-or-cast-1): Label CASE 13
+       and comment it out.  This out-commenting enables certain C++
+       declarations to be parsed correctly.
+
 2013-07-13  Eli Zaretskii  <address@hidden>
 
        * international/mule.el (define-coding-system): Doc fix.

=== modified file 'lisp/progmodes/cc-engine.el'
--- a/lisp/progmodes/cc-engine.el       2013-06-04 13:26:15 +0000
+++ b/lisp/progmodes/cc-engine.el       2013-07-13 17:45:07 +0000
@@ -6892,7 +6892,7 @@
       (while (and (looking-at c-type-decl-prefix-key)
                  (if (and (c-major-mode-is 'c++-mode)
                           (match-beginning 3))
-                     ;; If the second submatch matches in C++ then
+                     ;; 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))
@@ -7193,19 +7193,23 @@
        ;; uncommon (e.g. some placements of "const" in C++) it's not worth
        ;; the effort to look for them.)
 
-       (unless (or at-decl-end (looking-at "=[^=]"))
-         ;; If this is a declaration it should end here or its initializer(*)
-         ;; should start here, so check for allowed separation tokens.  Note
-         ;; that this rule doesn't work e.g. with a K&R arglist after a
-         ;; function header.
-         ;;
-         ;; *) Don't check for C++ style initializers using parens
-         ;; since those already have been matched as suffixes.
-         ;;
-         ;; If `at-decl-or-cast' is then we've found some other sign that
-         ;; it's a declaration or cast, so then it's probably an
-         ;; invalid/unfinished one.
-         (throw 'at-decl-or-cast at-decl-or-cast))
+;;; 2008-04-16: commented out the next form, to allow the function to recognise
+;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon)
+;;; as a(n almost complete) declaration, enabling it to be fontified.
+       ;; CASE 13
+       ;; (unless (or at-decl-end (looking-at "=[^=]"))
+       ;; If this is a declaration it should end here or its initializer(*)
+       ;; should start here, so check for allowed separation tokens.  Note
+       ;; that this rule doesn't work e.g. with a K&R arglist after a
+       ;; function header.
+       ;;
+       ;; *) Don't check for C++ style initializers using parens
+       ;; since those already have been matched as suffixes.
+       ;;
+       ;; If `at-decl-or-cast' is then we've found some other sign that
+       ;; it's a declaration or cast, so then it's probably an
+       ;; invalid/unfinished one.
+       ;;  (throw 'at-decl-or-cast at-decl-or-cast))
 
        ;; Below are tests that only should be applied when we're certain to
        ;; not have parsed halfway through an expression.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]