Skip to content

Commit

Permalink
Merge pull request #125 from CyberShadow/fix-110
Browse files Browse the repository at this point in the history
Fix fontification of functions returning typeof(this)
  • Loading branch information
CyberShadow authored Dec 25, 2024
2 parents de2a20e + 392e727 commit a6f0b7c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions d-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions tests/I0110.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// #run: (d-test-fontification)

typeof(this) getThis() {
return this;
}
5 changes: 5 additions & 0 deletions tests/I0110.d.html
Original file line number Diff line number Diff line change
@@ -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>;
}

0 comments on commit a6f0b7c

Please sign in to comment.