;; states going back to the beginning of the buffer, one entry every 3000
;; characters.
;;
-;; When searching this cache, `c-state-semi-pp-to-literal' first seeks an
+;; When searching this cache, `c-semi-pp-to-literal' first seeks an
;; exact match, then a "close" match from the near cache. If neither of these
;; succeed, the nearest entry in the far cache is used.
;;
-;; Because either sub-cache can raise `c-state-semi-nonlit-pos-cache-limit',
+;; Because either sub-cache can raise `c-lit-pos-cache-limit',
;; both of them are "trimmed" together after a buffer change to ensure
;; consistency.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar c-state-semi-nonlit-pos-cache nil)
-(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache)
+(defvar c-lit-pos-cache nil)
+(make-variable-buffer-local 'c-lit-pos-cache)
;; A list of elements in descending order of POS of one of the forms:
;; o - POS (when point is not in a literal);
;; o - (POS CHAR-1) (when the last character before point is potentially
;; potentially forming the first half of a two-char construct (in Emacs <= 25
;; and XEmacs) or the syntax of the character (Emacs >= 26).
-(defvar c-state-semi-nonlit-pos-cache-limit 1)
-(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit)
-;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This
+(defvar c-lit-pos-cache-limit 1)
+(make-variable-buffer-local 'c-lit-pos-cache-limit)
+;; An upper limit on valid entries in `c-lit-pos-cache'. This
;; is reduced by buffer changes, and increased by invocations of
;; `c-parse-ps-state-below'.
-(defvar c-state-semi-nonlit-near-cache nil)
-(make-variable-buffer-local 'c-state-semi-nonlit-near-cache)
-;; A list of up to six recent results from `c-state-semi-pp-to-literal'. Each
+(defvar c-semi-lit-near-cache nil)
+(make-variable-buffer-local 'c-semi-lit-near-cache)
+;; A list of up to six recent results from `c-semi-pp-to-literal'. Each
;; element is a cons of the buffer position and the `parse-partial-sexp' state
;; at that position.
-(defsubst c-truncate-semi-nonlit-pos-cache (pos)
- ;; Truncate the upper bound of the cache `c-state-semi-nonlit-pos-cache' to
- ;; POS, if it is higher than that position.
- (setq c-state-semi-nonlit-pos-cache-limit
- (min c-state-semi-nonlit-pos-cache-limit pos)))
-
-(defun c-state-semi-trim-near-cache ()
- ;; Remove stale entries in `c-state-semi-nonlit-near-cache', i.e. those
- ;; whose positions are above `c-state-semi-nonlit-pos-cache-limit'.
- (let ((nc-list c-state-semi-nonlit-near-cache))
+(defvar c-semi-near-cache-limit 1)
+(make-variable-buffer-local 'c-semi-near-cache-limit)
+;; An upper limit on valid entries in `c-semi-lit-near-cache'. This is
+;; reduced by buffer changes, and increased by invocations of
+;; `c-semi-pp-to-literal'.
+
+(defsubst c-truncate-lit-pos-cache (pos)
+ ;; Truncate the upper bound of each of the three caches to POS, if it is
+ ;; higher than that position.
+ (setq c-lit-pos-cache-limit
+ (min c-lit-pos-cache-limit pos)
+ c-semi-near-cache-limit
+ (min c-semi-near-cache-limit pos)
+ c-full-near-cache-limit
+ (min c-full-near-cache-limit pos)))
+
+(defun c-semi-trim-near-cache ()
+ ;; Remove stale entries in `c-semi-lit-near-cache', i.e. those
+ ;; whose positions are above `c-lit-pos-cache-limit'.
+ (let ((nc-list c-semi-lit-near-cache))
(while nc-list
- (if (> (caar nc-list) c-state-semi-nonlit-pos-cache-limit)
- (setq c-state-semi-nonlit-near-cache
- (delq (car nc-list) c-state-semi-nonlit-near-cache)
- nc-list c-state-semi-nonlit-near-cache) ; start again in case
+ (if (> (caar nc-list) c-lit-pos-cache-limit)
+ (setq c-semi-lit-near-cache
+ (delq (car nc-list) c-semi-lit-near-cache)
+ nc-list c-semi-lit-near-cache) ; start again in case
; of list breakage.
(setq nc-list (cdr nc-list))))))
-(defun c-state-semi-get-near-cache-entry (here)
+(defun c-semi-get-near-cache-entry (here)
;; Return the near cache entry at the highest postion before HERE, if any,
;; or nil. The near cache entry is of the form (POSITION . STATE), where
;; STATE has the form of a result of `parse-partial-sexp'.
(let ((nc-pos-state
- (or (assq here c-state-semi-nonlit-near-cache)
- (let ((nc-list c-state-semi-nonlit-near-cache)
+ (or (assq here c-semi-lit-near-cache)
+ (let ((nc-list c-semi-lit-near-cache)
pos (nc-pos 0) cand-pos-state)
(catch 'found
(while nc-list
(setq nc-list (cdr nc-list)))
cand-pos-state)))))
(when (and nc-pos-state
- (not (eq nc-pos-state (car c-state-semi-nonlit-near-cache))))
+ (not (eq nc-pos-state (car c-semi-lit-near-cache))))
;; Move the found cache entry to the front of the list.
- (setq c-state-semi-nonlit-near-cache
- (delq nc-pos-state c-state-semi-nonlit-near-cache))
- (push nc-pos-state c-state-semi-nonlit-near-cache))
- nc-pos-state))
+ (setq c-semi-lit-near-cache
+ (delq nc-pos-state c-semi-lit-near-cache))
+ (push nc-pos-state c-semi-lit-near-cache))
+ (copy-tree nc-pos-state)))
-(defun c-state-semi-put-near-cache-entry (here state)
+(defun c-semi-put-near-cache-entry (here state)
;; Put a new near cache entry into the near cache.
- (while (>= (length c-state-semi-nonlit-near-cache) 6)
- (setq c-state-semi-nonlit-near-cache
- (delq (car (last c-state-semi-nonlit-near-cache))
- c-state-semi-nonlit-near-cache)))
- (push (cons here state) c-state-semi-nonlit-near-cache))
-
-(defun c-state-semi-pp-to-literal (here &optional not-in-delimiter)
+ (while (>= (length c-semi-lit-near-cache) 6)
+ (setq c-semi-lit-near-cache
+ (delq (car (last c-semi-lit-near-cache))
+ c-semi-lit-near-cache)))
+ (push (cons here state) c-semi-lit-near-cache)
+ (setq c-semi-near-cache-limit
+ (max c-semi-near-cache-limit here)))
+
+(defun c-semi-pp-to-literal (here &optional not-in-delimiter)
;; Do a parse-partial-sexp from a position in the buffer before HERE which
;; isn't in a literal, and return information about HERE, either:
;; (STATE TYPE BEG) if HERE is in a literal; or
(save-excursion
(save-restriction
(widen)
- (c-state-semi-trim-cache)
- (c-state-semi-trim-near-cache)
- (setq c-state-semi-nonlit-pos-cache-limit here)
+ (c-trim-lit-pos-cache)
+ (c-semi-trim-near-cache)
+ (setq c-lit-pos-cache-limit here)
(save-match-data
- (let* ((pos-and-state (c-state-semi-get-near-cache-entry here))
+ (let* ((pos-and-state (c-semi-get-near-cache-entry here))
(pos (car pos-and-state))
(near-pos pos)
(s (cdr pos-and-state))
(not (memq (char-before here) '(?\\ ?\n)))))))
(setq s (parse-partial-sexp pos here nil nil s)))
(when (not (eq near-pos here))
- (c-state-semi-put-near-cache-entry here s))
+ (c-semi-put-near-cache-entry here s))
(cond
((or (nth 3 s)
(and (nth 4 s)
(t (list s))))))))
-(defun c-state-full-pp-to-literal (here &optional not-in-delimiter)
+(defvar c-full-near-cache-limit 1)
+(make-variable-buffer-local 'c-full-near-cache-limit)
+;; An upper limit on valid entries in `c-full-lit-near-cache'. This
+;; is reduced by buffer changes, and increased by invocations of
+;; `c-full-pp-to-literal'.
+
+(defvar c-full-lit-near-cache nil)
+(make-variable-buffer-local 'c-full-lit-near-cache)
+;; A list of up to six recent results from `c-full-pp-to-literal'. Each
+;; element is a list (HERE STATE END)), where HERE is the buffer position the
+;; function was called for, STATE is the `parse-partial-sexp' state there, and
+;; END is the end of the literal enclosing HERE, if any, or nil otherwise.
+
+(defun c-full-trim-near-cache ()
+ ;; Remove stale entries in `c-full-lit-near-cache', i.e. those
+ ;; whose END entries, or positions, are above
+ ;; `c-state-full-nonlit-pos-cache-limit'.
+ (let ((nc-list c-full-lit-near-cache) elt)
+ (while nc-list
+ (let ((elt (car nc-list)))
+ (if (if (car (cddr elt))
+ (< c-full-near-cache-limit (car (cddr elt)))
+ (< c-full-near-cache-limit (car elt)))
+ (setq c-full-lit-near-cache
+ (delq elt c-full-lit-near-cache)
+ nc-list c-full-lit-near-cache) ; start again in
+ ; case of list breakage.
+ (setq nc-list (cdr nc-list)))))))
+
+(defun c-full-get-near-cache-entry (here)
+ ;; Return a near cache entry which either represents a literal which
+ ;; encloses HERE, or is at the highest position before HERE. The returned
+ ;; cache entry is of the form (POSITION STATE END), where STATE has the form
+ ;; of a result from `parse-partial-sexp' which is valid at POSITION and END
+ ;; is the end of any enclosing literal, or nil.
+ (let ((nc-pos-state
+ (or (assq here c-full-lit-near-cache)
+ (let ((nc-list c-full-lit-near-cache)
+ elt match (nc-pos 0) cand-pos-state)
+ (setq match
+ (catch 'found
+ (while nc-list
+ (setq elt (car nc-list))
+ (when
+ (and (car (cddr elt))
+ (>= here (nth 8 (cadr elt)))
+ (< here (car (cddr elt))))
+ (throw 'found elt))
+ (when
+ (and (< (car elt) here)
+ (> (car elt) nc-pos))
+ (setq nc-pos (car elt)
+ cand-pos-state elt))
+ (setq nc-list (cdr nc-list)))
+ nil))
+ (or match cand-pos-state)))))
+ ;; Move the found cache entry, if any, to the front of the list.
+ (when (and nc-pos-state
+ (not (eq nc-pos-state (car c-full-lit-near-cache))))
+ (setq c-full-lit-near-cache
+ (delq nc-pos-state c-full-lit-near-cache))
+ (push nc-pos-state c-full-lit-near-cache))
+ (copy-tree nc-pos-state)))
+
+(defun c-full-put-near-cache-entry (here state end)
+ ;; Put a new near chace entry into the near cache.
+ (while (>= (length c-full-lit-near-cache) 6)
+ (setq c-full-lit-near-cache
+ (delq (car (last c-full-lit-near-cache))
+ c-full-lit-near-cache)))
+ (push (list here state end) c-full-lit-near-cache)
+ (setq c-full-near-cache-limit
+ (max c-full-near-cache-limit (or end here))))
+
+(defun c-full-pp-to-literal (here &optional not-in-delimiter)
;; This function will supersede c-state-pp-to-literal.
;;
;; Do a parse-partial-sexp from a position in the buffer before HERE which
(save-excursion
(save-restriction
(widen)
- (c-state-semi-trim-cache)
- (c-state-semi-trim-near-cache)
- (setq c-state-semi-nonlit-pos-cache-limit here)
+ (c-trim-lit-pos-cache)
+ (c-full-trim-near-cache)
(save-match-data
- (let* ((base-and-state (c-state-semi-get-near-cache-entry here))
- (base (car base-and-state))
+ (let* ((elt (c-full-get-near-cache-entry here))
+ (base (car elt))
(near-base base)
- (s (cdr base-and-state))
+ (s (cadr elt))
+ (end (car (cddr elt)))
far-base-and-state far-base far-s ty start)
- (if (or (not base)
- (< base (- here 100)))
+ (if (or
+ (not base) ; FIXME!!! Compare base and far-base??
+ ; (2019-05-21)
+ (not end)
+ (> here end))
(progn
(setq far-base-and-state (c-parse-ps-state-below here)
far-base (car far-base-and-state)
far-s (cdr far-base-and-state))
(when (or (not base) (> far-base base))
(setq base far-base
- s far-s))))
- (when (> here base)
+ s far-s
+ end nil))))
+ (when
+ (or
+ (and (> here base) (null end))
+ (null (nth 8 s))
+ (and end (> here end))
+ (not
+ (or
+ (and (nth 3 s) ; string
+ (not (eq (char-before here) ?\\)))
+ (and (nth 4 s) (not (nth 7 s)) ; Block comment
+ (not (memq (char-before here)
+ c-block-comment-awkward-chars)))
+ (and (nth 4 s) (nth 7 s) ; Line comment
+ (not (memq (char-before here) '(?\\ ?\n)))))))
(setq s (parse-partial-sexp base here nil nil s)))
- (when (not (eq near-base here))
- (c-state-semi-put-near-cache-entry here s))
(cond
((or (nth 3 s)
(and (nth 4 s)
((nth 7 s) 'c++)
(t 'c)))
(setq start (nth 8 s))
- (parse-partial-sexp here (point-max)
- nil ; TARGETDEPTH
- nil ; STOPBEFORE
- s ; OLDSTATE
- 'syntax-table) ; stop at end of literal
- (list s ty (cons start (point))))
+ (unless end
+ (parse-partial-sexp here (point-max)
+ nil ; TARGETDEPTH
+ nil ; STOPBEFORE
+ s ; OLDSTATE
+ 'syntax-table) ; stop at end of literal
+ (setq end (point)))
+ (unless (eq near-base here)
+ (c-full-put-near-cache-entry here s end))
+ (list s ty (cons start end)))
((and (not not-in-delimiter) ; inside a comment starter
(not (bobp))
(forward-comment 1)
(list s ty (cons start (point))))
- (t (list s))))))))
+ (t
+ (c-full-put-near-cache-entry here s nil)
+ (list s))))))))
(defun c-state-pp-to-literal (from to &optional not-in-delimiter)
;; Do a parse-partial-sexp from FROM to TO, returning either
(defun c-cache-to-parse-ps-state (elt)
;; Create a list suitable to use as the old-state parameter to
;; `parse-partial-sexp', out of ELT, a member of
- ;; `c-state-semi-nonlit-pos-cache'. ELT is either just a number, or a list
+ ;; `c-lit-pos-cache'. ELT is either just a number, or a list
;; with 2, 3, or 4 members (See `c-parse-ps-state-to-cache'). That number
;; or the car of the list is the "position element" of ELT, the position
;; where ELT is valid.
;; Note that as of 2019-05-27, the forms involving CHAR-1 are no longer used.
(defun c-parse-ps-state-to-cache (state)
;; Convert STATE, a `parse-partial-sexp' state valid at POINT, to an element
- ;; for the `c-state-semi-nonlit-pos-cache' cache. This is one of
+ ;; for the `c-lit-pos-cache' cache. This is one of
;; o - POINT (when point is not in a literal);
;; o - (POINT CHAR-1) (when the last character before point is potentially
;; the first of a two-character construct
(defsubst c-ps-state-cache-pos (elt)
;; Get the buffer position from ELT, an element from the cache
- ;; `c-state-semi-nonlit-pos-cache'.
+ ;; `c-lit-pos-cache'.
(if (atom elt)
elt
(car elt)))
-(defun c-state-semi-trim-cache ()
- ;; Trim the `c-state-semi-nonlit-pos-cache' to take account of buffer
- ;; changes, indicated by `c-state-semi-nonlit-pos-cache-limit'.
- (while (and c-state-semi-nonlit-pos-cache
- (> (c-ps-state-cache-pos (car c-state-semi-nonlit-pos-cache))
- c-state-semi-nonlit-pos-cache-limit))
- (setq c-state-semi-nonlit-pos-cache (cdr c-state-semi-nonlit-pos-cache))))
+(defun c-trim-lit-pos-cache ()
+ ;; Trim the `c-lit-pos-cache' to take account of buffer
+ ;; changes, indicated by `c-lit-pos-cache-limit'.
+ (while (and c-lit-pos-cache
+ (> (c-ps-state-cache-pos (car c-lit-pos-cache))
+ c-lit-pos-cache-limit))
+ (setq c-lit-pos-cache (cdr c-lit-pos-cache))))
(defun c-parse-ps-state-below (here)
;; Given a buffer position HERE, Return a cons (CACHE-POS . STATE), where
(save-excursion
(save-restriction
(widen)
- (c-state-semi-trim-cache)
- (let ((c c-state-semi-nonlit-pos-cache)
+ (c-trim-lit-pos-cache)
+ (let ((c c-lit-pos-cache)
elt state npos high-elt)
(while (and c (> (c-ps-state-cache-pos (car c)) here))
(setq high-elt (car c))
(when (not high-elt)
;; We need to extend the cache. Add an element to
- ;; `c-state-semi-nonlit-pos-cache' each iteration of the following.
+ ;; `c-lit-pos-cache' each iteration of the following.
(while
(<= (setq npos (+ (point) c-state-nonlit-pos-interval)) here)
(setq state (parse-partial-sexp (point) npos nil nil state))
(setcar (nthcdr 5 state) nil)))
(setq elt (c-parse-ps-state-to-cache state))
- (setq c-state-semi-nonlit-pos-cache
- (cons elt c-state-semi-nonlit-pos-cache))))
+ (setq c-lit-pos-cache
+ (cons elt c-lit-pos-cache))))
- (if (> (point) c-state-semi-nonlit-pos-cache-limit)
- (setq c-state-semi-nonlit-pos-cache-limit (point)))
+ (if (> (point) c-lit-pos-cache-limit)
+ (setq c-lit-pos-cache-limit (point)))
(cons (point) state)))))
c-state-cache-good-pos 1
c-state-nonlit-pos-cache nil
c-state-nonlit-pos-cache-limit 1
- c-state-semi-nonlit-pos-cache nil
- c-state-semi-nonlit-pos-cache-limit 1
+ c-lit-pos-cache nil
+ c-lit-pos-cache-limit 1
c-state-brace-pair-desert nil
c-state-point-min 1
c-state-point-min-lit-type nil
;; HERE.
(if (<= here c-state-nonlit-pos-cache-limit)
(setq c-state-nonlit-pos-cache-limit (1- here)))
- (c-truncate-semi-nonlit-pos-cache here)
+ (c-truncate-lit-pos-cache here)
;; `c-state-cache':
;; Case 1: if `here' is in a literal containing point-min, everything
c-state-cache-good-pos
c-state-nonlit-pos-cache
c-state-nonlit-pos-cache-limit
- c-state-semi-nonlit-pos-cache
- c-state-semi-nonlit-pos-cache-limit
+ c-lit-pos-cache
+ c-lit-pos-cache-limit
c-state-brace-pair-desert
c-state-point-min
c-state-point-min-lit-type
comment at the start of cc-engine.el for more info."
(save-restriction
(widen)
- (let ((lit (c-state-semi-pp-to-literal (point))))
+ (let ((lit (c-semi-pp-to-literal (point))))
(or (cadr lit)
(and detect-cpp
(save-excursion (c-beginning-of-macro))
s
'syntax-table)
(point)))))
- (let ((pp-to-lit (c-state-full-pp-to-literal pos not-in-delimiter)))
+ (let ((pp-to-lit (c-full-pp-to-literal pos not-in-delimiter)))
(car (cddr pp-to-lit))))))
(cond
(lit-limits)
(and (or (nth 3 s)
(and (nth 4 s) (not (eq (nth 7 s) 'syntax-table))))
(nth 8 s)))
- (car (cddr (c-state-semi-pp-to-literal (point))))))
+ (car (cddr (c-semi-pp-to-literal (point))))))
;; In case external callers use this; it did have a docstring.
(defalias 'c-literal-limits-fast 'c-literal-limits)
(c-backward-syntactic-ws)
(setq start (point))
(let* ((pos (max (- start try-size) (point-min)))
- (s (c-state-semi-pp-to-literal pos))
+ (s (c-semi-pp-to-literal pos))
(cand (or (car (cddr s)) pos)))
(if (>= cand (point-min))
cand
;;
;; Note: this function is dependant upon the correct syntax-table text
;; properties being set.
- (let ((state (c-state-semi-pp-to-literal (point)))
+ (let ((state (c-semi-pp-to-literal (point)))
open-quote-pos open-paren-pos close-paren-pos close-quote-pos id)
(save-excursion
(when
;; the 'syntax-table property from all of them.
(setq first (c-clear-char-property-with-value-on-char
open-quote open-paren 'syntax-table '(1) ?\"))
- (if first (c-truncate-semi-nonlit-pos-cache first))
+ (if first (c-truncate-lit-pos-cache first))
(cond
((null open-paren-prop)
;; Should be a terminated raw string...
(setq first (c-clear-char-property-with-value-on-char
(1+ (match-beginning 0)) (1- (match-end 0))
'syntax-table '(1) ?\"))
- (if first (c-truncate-semi-nonlit-pos-cache first))
+ (if first (c-truncate-lit-pos-cache first))
;; Clear any random `syntax-table' text properties from the contents.
(let* ((closing-paren (match-beginning 0))
(first-st
(when first-st
(c-clear-char-properties first-st (match-beginning 0)
'syntax-table)
- (c-truncate-semi-nonlit-pos-cache first-st))
+ (c-truncate-lit-pos-cache first-st))
(when (c-get-char-property (1- (match-end 0)) 'syntax-table)
;; Was previously an unterminated (ordinary) string
(save-excursion
(when (c-safe (c-forward-sexp)) ; to '(1) at EOL.
(c-clear-char-property (1- (point)) 'syntax-table))
(c-clear-char-property (1- (match-end 0)) 'syntax-table)
- (c-truncate-semi-nonlit-pos-cache (1- (match-end 0))))))))
+ (c-truncate-lit-pos-cache (1- (match-end 0))))))))
((or (and (equal open-paren-prop '(15)) (null bound))
(equal open-paren-prop '(1)))
;; An unterminated raw string either not in a macro, or in a macro with
;; the open parenthesis right up against the end of macro
(c-clear-char-property open-quote 'syntax-table)
- (c-truncate-semi-nonlit-pos-cache open-quote)
+ (c-truncate-lit-pos-cache open-quote)
(c-clear-char-property open-paren 'syntax-table))
(t
;; An unterminated string in a macro, with at least one char after the
;; open paren
(c-clear-char-property open-quote 'syntax-table)
- (c-truncate-semi-nonlit-pos-cache open-quote)
+ (c-truncate-lit-pos-cache open-quote)
(c-clear-char-property open-paren 'syntax-table)
(c-clear-char-property-with-value (1+ open-paren) bound 'syntax-table
'(15))))))
(while (and (skip-chars-forward "^\"" end)
(< (point) end))
(c-put-char-property (point) 'syntax-table '(1))
- (c-truncate-semi-nonlit-pos-cache (point))
+ (c-truncate-lit-pos-cache (point))
(forward-char))))
(defun c-propertize-raw-string-opener (id open-quote open-paren bound)
(while (progn (skip-syntax-forward "^\"" end-string)
(< (point) end-string))
(c-put-char-property (point) 'syntax-table '(1)) ; punctuation
- (c-truncate-semi-nonlit-pos-cache (point))
+ (c-truncate-lit-pos-cache (point))
(forward-char))
(goto-char after-quote)
t)
(c-put-char-property open-quote 'syntax-table '(1)) ; punctuation
- (c-truncate-semi-nonlit-pos-cache open-quote)
+ (c-truncate-lit-pos-cache open-quote)
(c-put-char-property open-paren 'syntax-table '(15)) ; generic string
(when bound
;; In a CPP construct, we try to apply a generic-string
(if (match-beginning 10)
(progn
(c-put-char-property (match-beginning 10) 'syntax-table '(15))
- (c-truncate-semi-nonlit-pos-cache (match-beginning 10)))
+ (c-truncate-lit-pos-cache (match-beginning 10)))
(c-put-char-property (match-beginning 5) 'syntax-table '(1))
(c-put-char-property (1+ (match-beginning 5)) 'syntax-table '(15))
- (c-truncate-semi-nonlit-pos-cache (1+ (match-beginning 5))))
+ (c-truncate-lit-pos-cache (1+ (match-beginning 5))))
;; (c-put-char-property open-paren 'syntax-table '(1))
)
(goto-char bound))
(setq eoll (c-point 'eoll))
(when (and (null c-old-END-literality)
(search-forward-regexp c-c++-raw-string-opener-re eoll t))
- (setq state (c-state-semi-pp-to-literal end))
+ (setq state (c-semi-pp-to-literal end))
(when (eq (cadr state) 'string)
(unwind-protect
;; Temporarily insert a closing string delimiter....
((eq (nth 3 (car state)) t)
(insert ?\")
(c-put-char-property end 'syntax-table '(15))))
- (c-truncate-semi-nonlit-pos-cache end)
+ (c-truncate-lit-pos-cache end)
;; ....ensure c-new-END extends right to the end of the about
;; to be un-stringed raw string....
(save-excursion
(goto-char (1- (cadr c-old-beg-rs)))
(unless (looking-at c-c++-raw-string-opener-re)
(c-clear-char-property (1+ (point)) 'syntax-table)
- (c-truncate-semi-nonlit-pos-cache (1+ (point)))
+ (c-truncate-lit-pos-cache (1+ (point)))
(if (c-search-forward-char-property 'syntax-table '(15)
(c-point 'eol))
(c-clear-char-property (1- (point)) 'syntax-table))))
(setq c-new-END (point-max))
(c-clear-char-properties (cadr c-old-beg-rs) c-new-END
'syntax-table)
- (c-truncate-semi-nonlit-pos-cache (cadr c-old-beg-rs)))))
+ (c-truncate-lit-pos-cache (cadr c-old-beg-rs)))))
;; Have we terminated an existing raw string by inserting or removing
;; text?
(when (eq c-old-END-literality 'string)
(while
(and
(setq found (search-backward (concat "R\"" id "(") nil t))
- (setq state (c-state-semi-pp-to-literal (point)))
+ (setq state (c-semi-pp-to-literal (point)))
(memq (nth 3 (car state)) '(t ?\"))))
(when found
(setq c-new-BEG (min (point) c-new-BEG)
c-new-END (point-max))
(c-clear-char-properties (point) c-new-END 'syntax-table)
- (c-truncate-semi-nonlit-pos-cache (point)))))
+ (c-truncate-lit-pos-cache (point)))))
;; Are there any raw strings in a newly created macro?
(when (< beg end)