emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/d-mode 45c60e0 286/346: Fix fontification of variable decl


From: ELPA Syncer
Subject: [nongnu] elpa/d-mode 45c60e0 286/346: Fix fontification of variable declarations with top-level types
Date: Sun, 29 Aug 2021 11:00:47 -0400 (EDT)

branch: elpa/d-mode
commit 45c60e0640ed49d2fcfdbe54b1322a5fa870a52b
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>

    Fix fontification of variable declarations with top-level types
---
 d-mode.el          | 9 +++++----
 tests/fonts.d      | 2 ++
 tests/fonts.d.html | 2 ++
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/d-mode.el b/d-mode.el
index 23341f1..9509d3f 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
 ;; Maintainer:  Russel Winder <russel@winder.org.uk>
 ;;              Vladimir Panteleev <vladimir@thecybershadow.net>
 ;; Created:  March 2007
-;; Version:  201911111350
+;; Version:  201911111355
 ;; Keywords:  D programming language emacs cc-mode
 ;; Package-Requires: ((emacs "25.1"))
 
@@ -133,7 +133,7 @@
                   "\\([^=]\\|$\\)"))
 
 (c-lang-defconst c-decl-start-re
-  d "[[:alpha:]_@~]")
+  d "[[:alpha:]_@~.]")
   ;; d "[[:alpha:]_@]")
 
 (c-lang-defconst d-decl-end-re
@@ -954,6 +954,9 @@ Currently handles `-delimited string literals."
      ;; Identifier
      ((progn
        (setq pos nil)
+       (when (looking-at "[.]")
+         (forward-char)
+         (c-forward-syntactic-ws))
        (if (looking-at c-identifier-start)
            (save-excursion
              (setq id-start (point)
@@ -1022,8 +1025,6 @@ Currently handles `-delimited string literals."
 
       ;; D: Descend into scope names
       (when (looking-at "[.]")
-       (forward-char)
-       (c-forward-syntactic-ws)
        (unless (d-forward-type)
          (setq res nil)))
 
diff --git a/tests/fonts.d b/tests/fonts.d
index 26e320b..ef4540e 100644
--- a/tests/fonts.d
+++ b/tests/fonts.d
@@ -30,3 +30,5 @@ invariant {}
 
 class Foo : Bar {}
 enum Foo : Bar {}
+
+.TopLevelType var;
diff --git a/tests/fonts.d.html b/tests/fonts.d.html
index 51a0e36..4b0ec6f 100644
--- a/tests/fonts.d.html
+++ b/tests/fonts.d.html
@@ -30,3 +30,5 @@
 
 <span class="keyword">class</span> <span class="type">Foo</span> : <span 
class="type">Bar</span> {}
 <span class="keyword">enum</span> <span class="type">Foo</span> : <span 
class="type">Bar</span> {}
+
+.<span class="type">TopLevelType</span> <span class="variable-name">var</span>;



reply via email to

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