emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 342ed93: * lisp/progmodes/f90.el (f90-type-def-re):


From: Glenn Morris
Subject: [Emacs-diffs] master 342ed93: * lisp/progmodes/f90.el (f90-type-def-re): Handle attribute lists
Date: Mon, 06 Jul 2015 02:25:15 +0000

branch: master
commit 342ed936e1957c0af32b96d6dee13fa0c84452c1
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    * 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.
---
 lisp/progmodes/f90.el |    8 ++++----
 test/automated/f90.el |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 2bd7e7c..43b057b 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -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.")
 
diff --git a/test/automated/f90.el b/test/automated/f90.el
index 4c1abc3..c521d28 100644
--- a/test/automated/f90.el
+++ b/test/automated/f90.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]