branch: elpa/d-mode
commit 1bce6c416833df4d95293d974cbdd3c3833bdcfc
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Somewhat improve fontification of module names
Fixes highlighting of the final module part in module and import
declarations, but not the package parts preceding them.
cc-mode seems to be lacking the necessary constructs to handle this
cleanly.
Partially fixes issue #54.
---
d-mode-test.el | 1 +
d-mode.el | 8 ++++----
tests/I0054.d | 16 ++++++++++++++++
tests/I0054.d.html | 16 ++++++++++++++++
4 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/d-mode-test.el b/d-mode-test.el
index de4f69f..f915730 100644
--- a/d-mode-test.el
+++ b/d-mode-test.el
@@ -310,6 +310,7 @@ is expected to succeed, and nil otherwise."
(d-test-deftest i0035 "tests/I0035.d" (version< "24.4" emacs-version))
(d-test-deftest i0039 "tests/I0039.d" (version< "24.4" emacs-version))
(d-test-deftest i0049 "tests/I0049.d" t)
+(d-test-deftest i0054 "tests/I0054.d" t)
(d-test-deftest i0064 "tests/I0064.d" t)
(d-test-deftest i0069 "tests/I0069.txt" t)
(d-test-deftest i0072 "tests/I0072.txt" t)
diff --git a/d-mode.el b/d-mode.el
index 46e561f..dffe457 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <[email protected]>
;; Vladimir Panteleev <[email protected]>
;; Created: March 2007
-;; Version: 201908270026
+;; Version: 201908281339
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "24.3"))
@@ -305,10 +305,10 @@ The expression is added to
`compilation-error-regexp-alist' and
;; d '("in" "out" "body"))
(c-lang-defconst c-type-list-kwds
- d '("import"))
+ d nil)
(c-lang-defconst c-ref-list-kwds
- d '("module"))
+ d '("import" "module"))
(c-lang-defconst c-colon-type-list-kwds
;; Keywords that may be followed (not necessarily directly) by a colon
@@ -372,7 +372,7 @@ The expression is added to `compilation-error-regexp-alist'
and
d nil)
(c-lang-defconst c-other-decl-kwds
- d '("module" "import"))
+ d nil)
(c-lang-defconst c-other-kwds
;; Keywords not accounted for by any other `*-kwds' language constant.
diff --git a/tests/I0054.d b/tests/I0054.d
new file mode 100644
index 0000000..f146247
--- /dev/null
+++ b/tests/I0054.d
@@ -0,0 +1,16 @@
+// #run: (d-test-fontification)
+
+module aaa;
+
+import bbb;
+
+// FIXME:
+
+module aaa.bbb.ccc;
+
+import aaa.bbb;
+import aaa.Bbb;
+import aaa.bbb.ccc;
+import Aaa.Bbb.ccc;
+import Aaa.Bbb.Ccc;
+import aaa.bbb.Ccc;
diff --git a/tests/I0054.d.html b/tests/I0054.d.html
new file mode 100644
index 0000000..33b7df8
--- /dev/null
+++ b/tests/I0054.d.html
@@ -0,0 +1,16 @@
+<span class="comment-delimiter">// </span><span class="comment">#run:
(d-test-fontification)
+</span>
+<span class="keyword">module</span> <span class="constant">aaa</span>;
+
+<span class="keyword">import</span> <span class="constant">bbb</span>;
+
+<span class="comment-delimiter">// </span><span class="comment">FIXME:
+</span>
+<span class="keyword">module</span> aaa.bbb.<span class="constant">ccc</span>;
+
+<span class="keyword">import</span> aaa.<span class="constant">bbb</span>;
+<span class="keyword">import</span> <span class="constant">aaa</span>.<span
class="constant">Bbb</span>;
+<span class="keyword">import</span> aaa.bbb.<span class="constant">ccc</span>;
+<span class="keyword">import</span> <span
class="constant">Aaa</span>.Bbb.<span class="constant">ccc</span>;
+<span class="keyword">import</span> <span class="constant">Aaa</span>.<span
class="constant">Bbb</span>.<span class="constant">Ccc</span>;
+<span class="keyword">import</span> <span class="constant">aaa</span>.<span
class="constant">bbb</span>.<span class="constant">Ccc</span>;