Function: c-font-lock-c++-using

c-font-lock-c++-using is a byte-compiled function defined in cc-fonts.el.gz.

Signature

(c-font-lock-c++-using LIMIT)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-fonts.el.gz
;;; C++.
(defun c-font-lock-c++-using (limit)
  ;; Fontify any clauses starting with the keyword `using'.
  ;;
  ;; This function will be called from font-lock- for a region bounded by
  ;; POINT and LIMIT, as though it were to identify a keyword for
  ;; font-lock-keyword-face.  It always returns NIL to inhibit this and
  ;; prevent a repeat invocation.  See elisp/lispref page "Search-based
  ;; fontification".
  (let (pos)
    (while (c-syntactic-re-search-forward c-using-key limit 'end)
      (while  ; Do one declarator of a comma separated list, each time around.
	  (progn
	    (c-forward-syntactic-ws)
	    (setq pos (point))		; token after "using".
	    (when (and (c-on-identifier)
		       (c-forward-name))
	      (cond
	       ((eq (char-after) ?=)		; using foo = <type-id>;
		(goto-char pos)
		(c-font-lock-declarators limit nil t nil))
	       ((save-excursion
		  (and c-colon-type-list-re
		       (c-go-up-list-backward)
		       (eq (char-after) ?{)
		       (eq (car (c-beginning-of-decl-1
				 (c-determine-limit 1000)))
			   'same)
		       (looking-at c-colon-type-list-re)))
		;; Inherited protected member: leave unfontified
		)
	       (t (goto-char pos)
		  (c-font-lock-declarators limit nil c-label-face-name nil)))
	      (eq (char-after) ?,)))
	(forward-char)))		; over the comma.
    nil))