emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Glenn Morris
Subject: [Emacs-diffs] master 8d21632: * lisp/progmodes/f90.el (f90-type-def-re): Add "type, extends".
Date: Thu, 28 May 2015 06:11:03 +0000

branch: master
commit 8d216325eacdb164011f0e0c59974ec372471599
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    * 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.
---
 lisp/progmodes/f90.el |    6 ++++--
 test/automated/f90.el |   25 +++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 6264d3b..756c5af 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 1cb2f03..4c1abc3 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



reply via email to

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