From: Glenn Morris Date: Thu, 28 May 2015 06:10:46 +0000 (-0700) Subject: * lisp/progmodes/f90.el (f90-type-def-re): Add "type, extends". X-Git-Tag: emacs-25.0.90~1948 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8d216325eacdb164011f0e0c59974ec372471599;p=emacs.git * 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. --- diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 6264d3b7b82..756c5af24e4 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -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]*:\\)") diff --git a/test/automated/f90.el b/test/automated/f90.el index 1cb2f035a6b..4c1abc34c47 100644 --- a/test/automated/f90.el +++ b/test/automated/f90.el @@ -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