Function: semantic-lex-spp-find-closing-macro

semantic-lex-spp-find-closing-macro is a byte-compiled function defined in lex-spp.el.gz.

Signature

(semantic-lex-spp-find-closing-macro)

Documentation

Find next macro which closes a scope through a close-paren.

Returns position with the end of that macro.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/lex-spp.el.gz
(defun semantic-lex-spp-find-closing-macro ()
  "Find next macro which closes a scope through a close-paren.
Returns position with the end of that macro."
  (let ((macros (semantic-lex-spp-macros))
	(cmacro-regexp "\\(")
	(case-fold-search nil))
    ;; Build a regexp which search for all macros with a closing
    ;; paren, and search for it.
    (dolist (cur macros)
      (let ((stream (symbol-value cur)))
	(when (and (listp stream) (listp (car stream)))
	  (while stream
	    (if (and (eq (caar stream) 'close-paren)
		     (string= (nth 1 (car stream)) "}"))
		(setq cmacro-regexp (concat cmacro-regexp (symbol-name cur) "\\|")
		      stream nil)
	      (setq stream (cdr-safe stream)))))))
    (when cmacro-regexp
      (save-excursion
	(when (re-search-forward
	       (concat (substring cmacro-regexp 0 -2) "\\)[^0-9a-zA-Z_]") nil t)
	  (point))))))