Function: c-neutralize-CPP-line
c-neutralize-CPP-line is a byte-compiled function defined in
cc-mode.el.gz.
Signature
(c-neutralize-CPP-line BEG END)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cc-mode.el.gz
(defun c-neutralize-CPP-line (beg end)
;; BEG and END bound a region, typically a preprocessor line. Put a
;; "punctuation" syntax-table property on syntactically obtrusive
;; characters, ones which would interact syntactically with stuff outside
;; this region.
;;
;; These are unmatched parens/brackets/braces. An unclosed comment is
;; regarded as valid, NOT obtrusive. Unbalanced strings are handled
;; elsewhere.
(save-excursion
(let (s)
(while
(progn
(setq s (parse-partial-sexp beg end -1))
(cond
((< (nth 0 s) 0) ; found an unmated ),},],>
(if (eq (char-before) ?>)
(c-clear->-pair-props (1- (point)))
(c-put-syntax-table-trim-caches (1- (point)) '(1)))
t)
;; Unbalanced strings are now handled by
;; `c-before-change-check-unbalanced-strings', etc.
;; ((nth 3 s) ; In a string
;; (c-put-char-property (nth 8 s) 'syntax-table '(1))
;; t)
((> (nth 0 s) 0) ; In a (,{,[,<
(if (eq (char-after (nth 1 s)) ?<)
(c-clear-<-pair-props (nth 1 s))
(c-put-syntax-table-trim-caches (nth 1 s) '(1)))
t)
(t nil)))))))