Commit 845d331e authored by Glenn Morris's avatar Glenn Morris

(fortran-beginning-do): Ignore labelled DO loops altogether.

parent f7d43438
2002-10-06 Glenn Morris <gmorris@ast.cam.ac.uk>
* progmodes/fortran.el (fortran-beginning-do): Ignore labelled DO
loops.
2002-10-04 Markus Rost <rost@math.ohio-state.edu>
* vc.el (vc-default-show-log-entry): Fix typo.
......
......@@ -1104,12 +1104,13 @@ Return point or nil."
(defun fortran-beginning-do ()
"Search backwards for first unmatched DO [WHILE].
Return point or nil."
(let ((case-fold-search t))
Return point or nil. Ignores labelled DO loops (ie DO 10 ... 10 CONTINUE)."
(let ((case-fold-search t)
(dostart-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?do[ \t]+[^0-9]"))
(if (save-excursion
(beginning-of-line)
(skip-chars-forward " \t0-9")
(looking-at "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?do[ \t]+"))
(looking-at dostart-re))
;; Sitting on one.
(match-beginning 0)
;; Search for one.
......@@ -1121,9 +1122,9 @@ Return point or nil."
(not (and (looking-at fortran-end-prog-re)
(fortran-check-end-prog-re))))
(skip-chars-forward " \t0-9")
(cond ((looking-at
"\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?do[ \t]+")
(cond ((looking-at dostart-re)
(setq count (1- count)))
;; Note labelled loop ends not considered.
((looking-at "end[ \t]*do\\b")
(setq count (1+ count)))))
(and (= count 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment