+2015-02-24 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/f90.el (f90-beginning-of-subprogram)
+ (f90-end-of-subprogram, f90-match-end):
+ Handle continued strings where the continuation does not start
+ with "&" and happens to match our regexp. (Bug#19809)
+
2015-02-24 Bozhidar Batsov <bozhidar@batsov.com>
* comint.el (comint-clear-buffer): New command.
(re-search-backward f90-program-block-re nil 'move))
(beginning-of-line)
(skip-chars-forward " \t0-9")
- (cond ((setq matching-beg (f90-looking-at-program-block-start))
+ ;; Check if in string in case using non-standard feature where
+ ;; continued strings do not need "&" at start of continuations.
+ (cond ((f90-in-string))
+ ((setq matching-beg (f90-looking-at-program-block-start))
(setq count (1- count)))
((f90-looking-at-program-block-end)
(setq count (1+ count)))))
(re-search-forward f90-program-block-re nil 'move))
(beginning-of-line)
(skip-chars-forward " \t0-9")
- (cond ((f90-looking-at-program-block-start)
+ (cond ((f90-in-string))
+ ((f90-looking-at-program-block-start)
(setq count (1+ count)))
((setq matching-end (f90-looking-at-program-block-end))
(setq count (1- count))))
(end-point (point))
(case-fold-search t)
matching-beg beg-name end-name beg-block end-block end-struct)
+ ;; Check if in string in case using non-standard feature where
+ ;; continued strings do not need "&" at start of continuations.
(when (save-excursion (beginning-of-line) (skip-chars-forward " \t0-9")
- (setq end-struct (f90-looking-at-program-block-end)))
+ (unless (f90-in-string)
+ (setq end-struct
+ (f90-looking-at-program-block-end))))
(setq end-block (car end-struct)
end-name (cadr end-struct))
(save-excursion
+2015-02-24 Glenn Morris <rgm@gnu.org>
+
+ * automated/f90.el (f90-test-bug-19809): New test.
+
2015-02-22 Michael Albinus <michael.albinus@gmx.de>
* automated/tramp-tests.el (tramp-test17-insert-directory):
(f90-indent-subprogram)
(should (= 0 (current-indentation)))))
+(ert-deftest f90-test-bug-19809 ()
+ "Test for http://debbugs.gnu.org/19809 ."
+ (with-temp-buffer
+ (f90-mode)
+ ;; The Fortran standard says that continued strings should have
+ ;; '&' at the start of continuation lines, but it seems gfortran
+ ;; allows them to be absent (albeit with a warning).
+ (insert "program prog
+ write (*,*), '&
+end program prog'
+end program prog")
+ (goto-char (point-min))
+ (f90-end-of-subprogram)
+ (should (= (point) (point-max)))))
+
+
;;; f90.el ends here