Function: f90-looking-at-program-block-start
f90-looking-at-program-block-start is a byte-compiled function defined
in f90.el.gz.
Signature
(f90-looking-at-program-block-start)
Documentation
Return (KIND NAME) if a program block with name NAME starts after point.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/f90.el.gz
(defsubst f90-looking-at-program-block-start ()
"Return (KIND NAME) if a program block with name NAME starts after point."
;;;NAME is nil for an un-named main PROGRAM block."
(cond
((looking-at "\\(program\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
(list (match-string 1) (match-string 2)))
((and (not (looking-at "module[ \t]*\\(procedure\\|function\\|subroutine\\)\\_>"))
(looking-at "\\(module\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>"))
(list (match-string 1) (match-string 2)))
((looking-at "\\(submodule\\)[ \t]*([^)\n]+)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
(list (match-string 1) (match-string 2)))
((and (not (looking-at "end[ \t]*\\(function\\|procedure\\|subroutine\\)"))
(looking-at "[^!'\"&\n]*\\(?:module[ \t]*\\)?\
\\(function\\|subroutine\\)[ \t]+\
\\(\\(?:\\sw\\|\\s_\\)+\\)"))
;; TODO: In F2008 "module procedure foo" may or may not start a block,
;; It is impossible to tell the difference without parsing state.
;;; (looking-at "[^!'\"&\n]*module[ \t]*\\(procedure\\)[ \t]+\
;;;\\(\\(?:\\sw\\|\\s_\\)+\\)")))
(list (match-string 1) (match-string 2)))))