Function: f90-imenu-type-matcher

f90-imenu-type-matcher is a byte-compiled function defined in f90.el.gz.

Signature

(f90-imenu-type-matcher)

Documentation

Search backward for the start of a derived type.

Set subexpression 1 in the match-data to the name of the type.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/f90.el.gz
;; Imenu support.
;; FIXME trivial to extend this to enum. Worth it?
(defun f90-imenu-type-matcher ()
  "Search backward for the start of a derived type.
Set subexpression 1 in the `match-data' to the name of the type."
  (let (found)
    (while (and (re-search-backward "^[ \t0-9]*type[ \t]*" nil t)
                (not (setq found
                           (save-excursion
                             (goto-char (match-end 0))
                             (unless (looking-at "\\(is\\_>\\|(\\)")
                               (or (looking-at "\\(\\(?:\\sw\\|\\s_\\)+\\)")
                                   (re-search-forward
                                    "[ \t]*::[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)"
                                    (line-end-position) t))))))))
    found))