;; 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
(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]*:\\)")
(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