/[emacs]/emacs/lisp/progmodes/cc-engine.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/cc-engine.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by mast, Sat May 25 16:17:27 2002 UTC revision 1.24.2.1 by miles, Fri Apr 4 06:20:32 2003 UTC
# Line 366  COMMA-DELIM is non-nil then ',' is treat Line 366  COMMA-DELIM is non-nil then ',' is treat
366                          c-maybe-labelp nil))))                          c-maybe-labelp nil))))
367    
368                ;; Step to next sexp, but not if we crossed a boundary, since                ;; Step to next sexp, but not if we crossed a boundary, since
369                ;; that doesn't consume an sexp.                ;; that doesn't consume a sexp.
370                (if (eq sym 'boundary)                (if (eq sym 'boundary)
371                    (setq ret 'previous)                    (setq ret 'previous)
372                  (while                  (while
# Line 642  specified." Line 642  specified."
642          (forward-char))          (forward-char))
643         ;; Skip preprocessor directives.         ;; Skip preprocessor directives.
644         ((and (looking-at "#[ \t]*[a-zA-Z0-9!]")         ((and (looking-at "#[ \t]*[a-zA-Z0-9!]")
645               (progn (skip-chars-backward " \t")               (save-excursion
646                      (bolp)))                 (skip-chars-backward " \t")
647                   (bolp)))
648          (end-of-line)          (end-of-line)
649          (while (and (<= (point) lim)          (while (and (<= (point) lim)
650                      (eq (char-before) ?\\)                      (eq (char-before) ?\\)
# Line 1143  you need both the type of a literal and Line 1144  you need both the type of a literal and
1144      (let* ((here (point))      (let* ((here (point))
1145             (c-macro-start (c-query-macro-start))             (c-macro-start (c-query-macro-start))
1146             (in-macro-start (or c-macro-start (point)))             (in-macro-start (or c-macro-start (point)))
1147             old-state last-pos pairs pos)             old-state last-pos pairs pos save-pos)
1148        ;; Somewhat ugly use of c-check-state-cache to get rid of the        ;; Somewhat ugly use of c-check-state-cache to get rid of the
1149        ;; part of the state cache that is after point.  Can't use        ;; part of the state cache that is after point.  Can't use
1150        ;; c-whack-state-after for the same reasons as in that function.        ;; c-whack-state-after for the same reasons as in that function.
# Line 1224  you need both the type of a literal and Line 1225  you need both the type of a literal and
1225        (narrow-to-region (point-min) here)        (narrow-to-region (point-min) here)
1226        (while pos        (while pos
1227          ;; Find the balanced brace pairs.          ;; Find the balanced brace pairs.
1228          (setq pairs nil)          (setq save-pos pos
1229                  pairs nil)
1230          (while (and (setq last-pos (c-down-list-forward pos))          (while (and (setq last-pos (c-down-list-forward pos))
1231                      (setq pos (c-up-list-forward last-pos)))                      (setq pos (c-up-list-forward last-pos)))
1232            (if (eq (char-before last-pos) ?{)            (if (eq (char-before last-pos) ?{)
# Line 1245  you need both the type of a literal and Line 1247  you need both the type of a literal and
1247                (setq c-state-cache (cdr c-state-cache)))                (setq c-state-cache (cdr c-state-cache)))
1248            (setq pairs (car pairs))            (setq pairs (car pairs))
1249            (setcar pairs (1- (car pairs)))            (setcar pairs (1- (car pairs)))
1250              (when (consp (car-safe c-state-cache))
1251                ;; There could already be a cons first in `c-state-cache'
1252                ;; if we've jumped over an unbalanced open paren in a
1253                ;; macro below.
1254                (setq c-state-cache (cdr c-state-cache)))
1255            (setq c-state-cache (cons pairs c-state-cache)))            (setq c-state-cache (cons pairs c-state-cache)))
1256          (if last-pos          (if last-pos
1257              ;; Prepare to loop, but record the open paren only if it's              ;; Prepare to loop, but record the open paren only if it's
# Line 1263  you need both the type of a literal and Line 1270  you need both the type of a literal and
1270                (progn                (progn
1271                  (setq pos (c-up-list-backward pos)                  (setq pos (c-up-list-backward pos)
1272                        c-state-cache nil)                        c-state-cache nil)
1273                  (unless pos                  (when (or (not pos)
1274                              ;; Emacs (up to at least 21.2) can get confused by
1275                              ;; open parens in column zero inside comments: The
1276                              ;; sexp functions can then misbehave and bring us
1277                              ;; back to the same point again.  Check this so that
1278                              ;; we don't get an infinite loop.
1279                              (>= pos save-pos))
1280                    (setq pos last-pos                    (setq pos last-pos
1281                          c-parsing-error                          c-parsing-error
1282                          (format "Unbalanced close paren at line %d"                          (format "Unbalanced close paren at line %d"
# Line 1794  brace." Line 1807  brace."
1807                search-end (nth 0 paren-state)))                search-end (nth 0 paren-state)))
1808        ;; if search-end is nil, or if the search-end character isn't an        ;; if search-end is nil, or if the search-end character isn't an
1809        ;; open brace, we are definitely not in a class        ;; open brace, we are definitely not in a class
1810        (if (or (not search-end)        (when (consp search-end)
1811                (< search-end (point-min))          (setq search-end (car search-end)))
1812                (not (eq (char-after search-end) ?{)))        (unless (or (not search-end)
1813            nil                    (< search-end (point-min))
1814                      (not (eq (char-after search-end) ?{)))
1815          ;; now, we need to look more closely at search-start.  if          ;; now, we need to look more closely at search-start.  if
1816          ;; search-start is nil, then our start boundary is really          ;; search-start is nil, then our start boundary is really
1817          ;; point-min.          ;; point-min.

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.24.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26