Commit 8d216325 authored by Glenn Morris's avatar Glenn Morris

* lisp/progmodes/f90.el (f90-type-def-re): Add "type, extends".

(f90-no-block-limit): Add "enum".  (Bug#20680)

* test/automated/f90.el (f90-test-bug20680, f90-test-bug20680b):
New tests.
parent a06426f7
......@@ -900,9 +900,11 @@ Can be overridden by the value of `font-lock-maximum-decoration'.")
;; type :: word
;; type, stuff :: word
;; type, bind(c) :: word
;; type, extends(stuff) :: word
;; NOT "type ("
"\\_<\\(type\\)\\_>\\(?:\\(?:[^()\n]*\\|\
.*,[ \t]*bind[ \t]*([ \t]*c[ \t]*)[ \t]*\\)::\\)?[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)"
.*,[ \t]*\\(?:bind\\|extends\\)[ \t]*(.*)[ \t]*\\)::\\)?\
[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)"
"Regexp matching the definition of a derived type.")
(defconst f90-typeis-re
......@@ -1450,7 +1452,7 @@ if all else fails."
(not (or (looking-at "end")
(looking-at "\\(do\\|if\\|else\\(if\\|where\\)?\
\\|select[ \t]*\\(case\\|type\\)\\|case\\|where\\|forall\\|\
block\\|critical\\)\\_>")
block\\|critical\\|enum\\)\\_>")
(looking-at "\\(program\\|\\(?:sub\\)?module\\|\
\\(?:abstract[ \t]*\\)?interface\\|block[ \t]*data\\)\\_>")
(looking-at "\\(contains\\|\\(?:\\sw\\|\\s_\\)+[ \t]*:\\)")
......
......@@ -188,5 +188,30 @@ end program prog")
(f90-end-of-subprogram)
(should (= (point) (point-max)))))
(ert-deftest f90-test-bug20680 ()
"Test for http://debbugs.gnu.org/20680 ."
(with-temp-buffer
(f90-mode)
(insert "module modname
type, extends ( sometype ) :: type1
integer :: part1
end type type1
end module modname")
(f90-indent-subprogram)
(forward-line -1)
(should (= 2 (current-indentation)))))
(ert-deftest f90-test-bug20680b ()
"Test for http://debbugs.gnu.org/20680 ."
(with-temp-buffer
(f90-mode)
(insert "module modname
enum, bind(c)
enumerator :: e1 = 0
end enum
end module modname")
(f90-indent-subprogram)
(forward-line -1)
(should (= 2 (current-indentation)))))
;;; f90.el ends here
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