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 |
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) ?\\) |
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. |
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) ?{) |
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 |
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" |
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. |