]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-engine.el
(gud-stop-subjob): Using jdb, suspend threads
[gnu-emacs] / lisp / progmodes / cc-engine.el
index d5a31032ddfceb8223bf18b6e8d97ca51491ebc5..817b161ff878b8a29db9d445680b4eb65e965c32 100644 (file)
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -27,9 +27,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -8254,21 +8252,24 @@ comment at the start of cc-engine.el for more info."
              (c-add-syntax 'inher-cont (c-point 'boi)))
 
             ;; CASE 5D.5: Continuation of the "expression part" of a
-            ;; top level construct.
+            ;; top level construct.  Or, perhaps, an unrecognised construct.
             (t
-             (while (and (eq (car (c-beginning-of-decl-1 containing-sexp))
+             (while (and (setq placeholder (point))
+                         (eq (car (c-beginning-of-decl-1 containing-sexp))
                              'same)
                          (save-excursion
                            (c-backward-syntactic-ws)
-                           (eq (char-before) ?}))))
+                           (eq (char-before) ?}))
+                         (< (point) placeholder)))
              (c-add-stmt-syntax
-              (if (eq char-before-ip ?,)
+              (cond
+               ((eq (point) placeholder) 'statement) ; unrecognised construct
                   ;; A preceding comma at the top level means that a
                   ;; new variable declaration starts here.  Use
                   ;; topmost-intro-cont for it, for consistency with
                   ;; the first variable declaration.  C.f. case 5N.
-                  'topmost-intro-cont
-                'statement-cont)
+               ((eq char-before-ip ?,) 'topmost-intro-cont)
+               (t 'statement-cont))
               nil nil containing-sexp paren-state))
             ))