Function: c-depropertize-ml-string

c-depropertize-ml-string is a byte-compiled function defined in cc-engine.el.gz.

Signature

(c-depropertize-ml-string STRING-DELIMS BOUND)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-engine.el.gz
  ;; syntax-table text property that was on the character at
  ;; `c-neutralize-pos' before it was replaced with '(1), or nil if none.

(defun c-depropertize-ml-string (string-delims bound)
  ;; Remove any `syntax-table' text properties associated with the opening
  ;; delimiter of a multi-line string (if it's unmatched) or with the entire
  ;; string.  Exception: A single punctuation ('(1)) property will be left on
  ;; a string character to make the entire set of multi-line strings
  ;; syntactically neutral.  This is done using the global variable
  ;; `c-neutralize-pos', the position of this property (or nil if there is
  ;; none).
  ;;
  ;; STRING-DELIMS, of the form of the output from
  ;; `c-ml-string-delims-around-point' defines the current ml string.  BOUND
  ;; is the bound for searching for a matching closing delimiter; it is
  ;; usually nil, but if we're inside a macro, it's the end of the macro
  ;; (i.e. just before the terminating \n).
  ;;
  ;; Point is undefined on input, and is moved to after the (terminated) raw
  ;; string, or left after the unmatched opening delimiter, as the case may
  ;; be.  The return value is of no significance.

  ;; Handle the special case of a closing " previously having been an
  ;; unterminated ordinary string.
  (when
      (and
       (cdr string-delims)
       (equal (c-get-char-property (cdddr string-delims) ; pos of closing ".
				   'syntax-table)
	      '(15)))
    (goto-char (cdddr string-delims))
    (when (c-safe (c-forward-sexp))	; To '(15) at EOL.
      (c-clear-syntax-table-trim-caches (1- (point)))))
    ;; The '(15) in the closing delimiter will be cleared by the following.

  (c-depropertize-ml-string-delims string-delims)
  (let ((bound1 (if (cdr string-delims)
		    (caddr string-delims) ; end of closing delimiter.
		  bound))
	s)
    (if bound1
	(c-clear-syntax-table-properties-trim-caches
	 (cadar string-delims) bound1))

    (setq s (parse-partial-sexp (or c-neutralize-pos (caar string-delims))
				(or bound1 (point-max))))
    (cond
     ((not (nth 3 s)))			; Nothing changed by this ml-string.
     ((not c-neutralize-pos)		; "New" unbalanced quote in this ml-s.
      (setq c-neutralize-pos (nth 8 s))
      (setq c-neutralized-prop (c-get-char-property c-neutralize-pos
						    'syntax-table))
      (c-put-syntax-table-trim-caches c-neutralize-pos '(1)))
     ((eq (nth 3 s) (char-after c-neutralize-pos))
      ;; New unbalanced quote balances old one.
      (if c-neutralized-prop
	  (c-put-syntax-table-trim-caches c-neutralize-pos
					c-neutralized-prop)
	(c-clear-syntax-table-trim-caches c-neutralize-pos))
      (setq c-neutralize-pos nil))
     ;; New unbalanced quote doesn't balance old one.  Nothing to do.
     )))