comparison lisp/progmodes/f90.el @ 95487:35a83ed5a550

(f90-typedef-matcher, f90-looking-at-type-like): Check that end-of-word follows "type".
author Glenn Morris <rgm@gnu.org>
date Tue, 03 Jun 2008 03:12:31 +0000
parents 52b7a8c22af5
children c5f85ede892d
comparison
equal deleted inserted replaced
95486:23898c5b8565 95487:35a83ed5a550
438 (defun f90-typedef-matcher (limit) 438 (defun f90-typedef-matcher (limit)
439 "Search for the start/end of the definition of a derived type, up to LIMIT. 439 "Search for the start/end of the definition of a derived type, up to LIMIT.
440 Set the match data so that subexpression 1,2 are the TYPE, and 440 Set the match data so that subexpression 1,2 are the TYPE, and
441 type-name parts, respectively." 441 type-name parts, respectively."
442 (let (found l) 442 (let (found l)
443 (while (and (re-search-forward "\\<\\(\\(?:end[ \t]*\\)?type\\)[ \t]*" 443 (while (and (re-search-forward "\\<\\(\\(?:end[ \t]*\\)?type\\)\\>[ \t]*"
444 limit t) 444 limit t)
445 (not (setq found 445 (not (setq found
446 (progn 446 (progn
447 (setq l (match-data)) 447 (setq l (match-data))
448 (unless (looking-at "\\(is\\>\\|(\\)") 448 (unless (looking-at "\\(is\\>\\|(\\)")
1211 (defsubst f90-looking-at-type-like () 1211 (defsubst f90-looking-at-type-like ()
1212 "Return (KIND NAME) if a type/enum/interface/block-data starts after point. 1212 "Return (KIND NAME) if a type/enum/interface/block-data starts after point.
1213 NAME is non-nil only for type." 1213 NAME is non-nil only for type."
1214 (cond 1214 (cond
1215 ((save-excursion 1215 ((save-excursion
1216 (and (looking-at "\\<type[ \t]*") 1216 (and (looking-at "\\<type\\>[ \t]*")
1217 (goto-char (match-end 0)) 1217 (goto-char (match-end 0))
1218 (not (looking-at "\\(is\\>\\|(\\)")) 1218 (not (looking-at "\\(is\\>\\|(\\)"))
1219 (or (looking-at "\\(\\sw+\\)") 1219 (or (looking-at "\\(\\sw+\\)")
1220 (re-search-forward "[ \t]*::[ \t]*\\(\\sw+\\)" 1220 (re-search-forward "[ \t]*::[ \t]*\\(\\sw+\\)"
1221 (line-end-position) t)))) 1221 (line-end-position) t))))