Function: c-sc-parse-partial-sexp-no-category

c-sc-parse-partial-sexp-no-category is a byte-compiled function defined in cc-defs.el.gz.

Signature

(c-sc-parse-partial-sexp-no-category FROM TO TARGETDEPTH STOPBEFORE OLDSTATE)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-defs.el.gz
(defun c-sc-parse-partial-sexp-no-category (from to targetdepth stopbefore
						 oldstate)
  ;; Do a parse-partial-sexp using the supplied arguments, disregarding
  ;; template/generic delimiters < > and disregarding macros other than the
  ;; one at POINT-MACRO-START.
  ;;
  ;; NOTE that STOPBEFORE must be nil.  TARGETDEPTH should be one less than
  ;; the depth in OLDSTATE.  This function is thus a SPECIAL PURPOSE variation
  ;; on parse-partial-sexp, designed for calling from
  ;; `c-remove-stale-state-cache'.
  ;;
  ;; Any finishing position which is determined by an angle bracket delimiter
  ;; doesn't count as a finishing position.
  ;;
  ;; Note there is no special handling of CPP constructs here, since these are
  ;; always syntactically balanced (thanks to `c-neutralize-CPP-line').
  (let ((state
	 (parse-partial-sexp from to targetdepth stopbefore oldstate)))
    (while
	(and (< (point) to)
	     ;; We must have hit targetdepth.
	     (or (eq (char-before) ?<)
		 (eq (char-before) ?>)))
      (setcar state
	      (if (memq (char-before) '(?> ?\) ?\} ?\]))
		  (1+ (car state))
		(1- (car state))))
      (setq state
	    (parse-partial-sexp (point) to targetdepth stopbefore oldstate)))
    state))