]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix fontification of multi-line declarations in f90-mode
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 May 2022 14:11:23 +0000 (16:11 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 May 2022 14:12:35 +0000 (16:12 +0200)
* lisp/progmodes/f90.el (f90-font-lock-keywords-2): Fontify
multi-line declarations (bug#17222).

lisp/progmodes/f90.el

index 263cd0ef2963de12a2a91926bc8009edfe1ee7e5..ce8824b85c19d1fa055e977a994699b13968113d 100644 (file)
@@ -600,6 +600,7 @@ and variable-name parts, respectively."
   (append
    f90-font-lock-keywords-1
    (list
+    '("\\(&\\)[ \t]*\\(!\\|$\\)"  (1 font-lock-keyword-face))
     ;; Variable declarations (avoid the real function call).
     ;; NB by accident (?), this correctly fontifies the "integer" in:
     ;; integer () function foo ()
@@ -611,8 +612,8 @@ and variable-name parts, respectively."
     '("^[ \t0-9]*\\(?:pure\\|elemental\\)?[ \t]*\
 \\(real\\|integer\\|c\\(haracter\\|omplex\\)\\|\
 enumerator\\|generic\\|procedure\\|logical\\|double[ \t]*precision\\)\
-\\(.*::\\|[ \t]*(.*)\\)?\\([^&!\n]*\\)"
-      (1 font-lock-type-face t) (4 font-lock-variable-name-face t))
+\\(.*::\\|[ \t]*(.*)\\)?\\(\\(?:[^&!\n]*\\(?:&\n\\)?\\)+\\)"
+      (1 font-lock-type-face t) (4 font-lock-variable-name-face append))
     ;; Derived type/class variables.
     ;; TODO ? If we just highlighted the "type" part, rather than
     ;; "type(...)", this could be in the previous expression. And this
@@ -654,7 +655,6 @@ logical\\|double[ \t]*precision\\|type[ \t]*(\\(?:\\sw\\|\\s_\\)+)\\|none\\)[ \t
     '("\\_<\\(namelist\\|common\\)[ \t]*/\\(\\(?:\\sw\\|\\s_\\)+\\)?/"
       (1 font-lock-keyword-face) (2 font-lock-constant-face nil t))
     "\\_<else\\([ \t]*if\\|where\\)?\\_>"
-    '("\\(&\\)[ \t]*\\(!\\|$\\)"  (1 font-lock-keyword-face))
     "\\_<\\(then\\|continue\\|format\\|include\\|\\(?:error[ \t]+\\)?stop\\|\
 return\\)\\_>"
     '("\\_<\\(exit\\|cycle\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)?\\_>"