[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode a6f0b7c35b 2/5: Merge pull request #125 from CyberS
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode a6f0b7c35b 2/5: Merge pull request #125 from CyberShadow/fix-110 |
Date: |
Wed, 25 Dec 2024 15:59:35 -0500 (EST) |
branch: elpa/d-mode
commit a6f0b7c35b039571821833c69e4eca74143bb5c8
Merge: de2a20eb21 392e72744c
Author: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Merge pull request #125 from CyberShadow/fix-110
Fix fontification of functions returning typeof(this)
---
d-mode.el | 5 +++--
tests/I0110.d | 5 +++++
tests/I0110.d.html | 5 +++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index bfefbaf927..1137b96cf6 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -244,7 +244,8 @@ operators."
"nothrow" "out" "override" "package" "pragma" "private"
"protected" "public" "pure" "ref" "return" "scope" "shared"
"static" "synchronized"
- "@property" "@safe" "@trusted" "@system" "@nogc" "@disable"))
+ "@property" "@safe" "@trusted" "@system" "@nogc" "@disable"
+ "typeof"))
(c-lang-defconst c-class-decl-kwds
;; Keywords introducing declarations where the following block (if any)
@@ -306,7 +307,7 @@ operators."
(c-lang-defconst c-paren-nontype-kwds
;;Keywords that may be followed by a parenthesis expression that doesn't
;; contain type identifiers.
- d '("version" "debug" "extern" "pragma" "__traits" "scope"))
+ d '("version" "debug" "extern" "pragma" "__traits" "scope" "typeof"))
(c-lang-defconst d-type-modifier-kwds
;; D's type modifiers.
diff --git a/tests/I0110.d b/tests/I0110.d
new file mode 100644
index 0000000000..c6f39bd0fe
--- /dev/null
+++ b/tests/I0110.d
@@ -0,0 +1,5 @@
+// #run: (d-test-fontification)
+
+typeof(this) getThis() {
+ return this;
+}
diff --git a/tests/I0110.d.html b/tests/I0110.d.html
new file mode 100644
index 0000000000..ca39ae0b8c
--- /dev/null
+++ b/tests/I0110.d.html
@@ -0,0 +1,5 @@
+<span class="comment-delimiter">// </span><span class="comment">#run:
(d-test-fontification)
+</span>
+<span class="keyword">typeof</span>(<span class="keyword">this</span>) <span
class="function-name">getThis</span>() {
+ <span class="keyword">return this</span>;
+}