;; assume that these text properties are used as described here.
;;
;; 'syntax-table
-;; Used to modify the syntax of some characters. Currently used to
-;; mark the "<" and ">" of angle bracket parens with paren syntax.
+;; Used to modify the syntax of some characters. It is used to
+;; mark the "<" and ">" of angle bracket parens with paren syntax, and
+;; to "hide" obtrusive characters in preprocessor lines.
;;
;; This property is used on single characters and is therefore
;; always treated as front and rear nonsticky (or start and end open
c-found-types)
(sort type-list 'string-lessp)))
+;; Shut up the byte compiler.
+(defvar c-maybe-stale-found-type)
+
(defun c-trim-found-types (beg end old-len)
;; An after change function which, in conjunction with the info in
;; c-maybe-stale-found-type (set in c-before-change), removes a type
;; the searchable range.
(let* ((macro-start (c-query-macro-start))
(lim (max (or lim (point-min)) (or macro-start (point-min))))
- before-lparen after-rparen)
+ before-lparen after-rparen
+ (pp-count-out 20)) ; Max number of paren/brace constructs before we give up
(narrow-to-region lim (c-point 'eol))
;; Search backwards for the defun's argument list. We give up if we
;; {
(catch 'knr
- (while t ; go round one paren/bracket construct each time round.
+ (while (> pp-count-out 0) ; go back one paren/bracket pair each time.
+ (setq pp-count-out (1- pp-count-out))
(c-syntactic-skip-backward "^)]}")
(cond ((eq (char-before) ?\))
(setq after-rparen (point)))
;; CASE 5A.5: ordinary defun open
(t
- (goto-char placeholder)
- (if (or containing-decl-open macro-start)
- (c-add-syntax 'defun-open (c-point 'boi))
- ;; Bogus to use bol here, but it's the legacy.
- (c-add-syntax 'defun-open (c-point 'bol)))
- )))
+ (save-excursion
+ (c-beginning-of-decl-1 lim)
+ (while (looking-at c-specifier-key)
+ (goto-char (match-end 1))
+ (c-forward-syntactic-ws indent-point))
+ (c-add-syntax 'defun-open (c-point 'boi))
+ ;; Bogus to use bol here, but it's the legacy. (Resolved,
+ ;; 2007-11-09)
+ ))))
;; CASE 5B: After a function header but before the body (or
;; the ending semicolon if there's no body).
\f
(cc-provide 'cc-engine)
-;;; arch-tag: 149add18-4673-4da5-ac47-6805e4eae089
+;; arch-tag: 149add18-4673-4da5-ac47-6805e4eae089
;;; cc-engine.el ends here