Function: f90-typedef-matcher

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

Signature

(f90-typedef-matcher LIMIT)

Documentation

Search for the start/end of the definition of a derived type, up to LIMIT.

Set the match data so that subexpression 1,2 are the TYPE, and type-name parts, respectively.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/f90.el.gz
;; cf f90-looking-at-type-like.
(defun f90-typedef-matcher (limit)
  "Search for the start/end of the definition of a derived type, up to LIMIT.
Set the match data so that subexpression 1,2 are the TYPE, and
type-name parts, respectively."
  (let (found l)
    (while (and (re-search-forward "\\_<\\(\\(?:end[ \t]*\\)?type\\)\\_>[ \t]*"
                                   limit t)
                (not (setq found
                           (progn
                             (setq l (match-data))
                             (unless (looking-at "\\(is\\_>\\|(\\)")
                               (when (if (looking-at "\\(\\(?:\\sw\\|\\s_\\)+\\)")
                                         (goto-char (match-end 0))
                                       (re-search-forward
                                        "[ \t]*::[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)"
                                        (line-end-position) t))
                                 ;; 0 is wrong, but we don't use it.
                                 (set-match-data
                                  (append l (list (match-beginning 1)
                                                  (match-end 1))))
                                 t)))))))
    found))