1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

* lisp/progmodes/f90.el (f90-type-def-re): Handle attribute lists

such as "extends(parent), private".  (Bug#20969)

* test/automated/f90.el (f90-test-bug20969, f90-test-bug20969b):
New tests.
This commit is contained in:
Glenn Morris 2015-07-05 19:25:04 -07:00
parent ad23626030
commit 342ed936e1
2 changed files with 30 additions and 4 deletions

View File

@ -898,12 +898,12 @@ Can be overridden by the value of `font-lock-maximum-decoration'.")
(defconst f90-type-def-re
;; type word
;; type :: word
;; type, stuff :: word
;; type, bind(c) :: word
;; type, extends(stuff) :: word
;; type, attr-list :: word
;; where attr-list = attr [, attr ...]
;; and attr may include bind(c) or extends(thing)
;; NOT "type ("
"\\_<\\(type\\)\\_>\\(?:\\(?:[^()\n]*\\|\
.*,[ \t]*\\(?:bind\\|extends\\)[ \t]*(.*)[ \t]*\\)::\\)?\
.*,[ \t]*\\(?:bind\\|extends\\)[ \t]*(.*).*\\)::\\)?\
[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)"
"Regexp matching the definition of a derived type.")

View File

@ -214,4 +214,30 @@ end module modname")
(forward-line -1)
(should (= 2 (current-indentation)))))
(ert-deftest f90-test-bug20969 ()
"Test for http://debbugs.gnu.org/20969 ."
(with-temp-buffer
(f90-mode)
(insert "module modname
type, extends ( sometype ), private :: type1
integer :: part1
end type type1
end module modname")
(f90-indent-subprogram)
(forward-line -1)
(should (= 2 (current-indentation)))))
(ert-deftest f90-test-bug20969b ()
"Test for http://debbugs.gnu.org/20969 ."
(with-temp-buffer
(f90-mode)
(insert "module modname
type, private, extends ( sometype ) :: type1
integer :: part1
end type type1
end module modname")
(f90-indent-subprogram)
(forward-line -1)
(should (= 2 (current-indentation)))))
;;; f90.el ends here