[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>;
- [nongnu] elpa/d-mode c3be102 344/346: Cask: Fetch undercover.el directly from git, (continued)
- [nongnu] elpa/d-mode c3be102 344/346: Cask: Fetch undercover.el directly from git, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 7fdd7b2 343/346: .github/workflows/test.yml: Add final step to call the Coveralls webhook, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 505022e 341/346: tests: New testcase, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 199743d 346/346: tests/I0021: Update condition, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 66796d0 247/346: Rename gplv2.txt -> COPYING, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 51dcd68 251/346: Improve comprehension of D constructors and destructors, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f4b3d8a 267/346: Precompute regular expressions for inline keyword lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 809586a 266/346: Reorganize code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 4851fc2 270/346: Fix fontification of "enum" in string literals, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 49cb5a8 275/346: Consolidate c-forward-decl-or-cast-1 annotation patch, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 45c60e0 286/346: Fix fontification of variable declarations with top-level types,
ELPA Syncer <=
- [nongnu] elpa/d-mode e9a034e 283/346: Tighten decl/arglist recognition, obsoleting another patch, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 05fc5f1 284/346: Consolidate c-forward-decl-or-cast-1 "scope" patch, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 44cf02b 287/346: tests: New testcase, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 73f4bdc 292/346: Emacs 25 compatibility, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8e77187 293/346: Fix fontification of return statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode cb97457 297/346: Remove another obsolete hack, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode bc725ef 296/346: Use a conditional compilation macro for version checks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c77fc0a 307/346: Skip coverage analysis when byte-compiling, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode d9e9d06 311/346: Merge d-forward-module-clause into d-forward-keyword-clause, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f76ba89 308/346: Fontify (type-inferred) lambda arguments, ELPA Syncer, 2021/08/29