[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 55c8cb0 306/346: Fontify types in function paramete
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 55c8cb0 306/346: Fontify types in function parameter lists |
Date: |
Sun, 29 Aug 2021 11:00:50 -0400 (EDT) |
branch: elpa/d-mode
commit 55c8cb015fbe9196967b866cd21596bfa7a8a7dc
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Fontify types in function parameter lists
Now that we have a sufficiently correct understanding of D syntax, we
can use it to fontify more things. In this case, single items in a
'decl context should always mean types (whether they occur in the
compile-time or run-time parameter list).
---
d-mode.el | 15 +++++++++------
tests/I0093_546738540.d.html | 2 +-
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 2da456c..06c0c3d 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: 201911112251
+;; Version: 201911112253
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -606,15 +606,18 @@ Evaluate OLD-FORM if the Emacs version is older than
MIN-VERSION,
;; lists. For functions, they indicate the type of an
;; anonymous parameter; for lambdas, they indicate the name
;; of a parameter with an inferred type.
- ;; Currently we don't fontify them as either.
((and (eq context 'decl)
(d-forward-type))
(setq type-start decl-start)
(setq id-start (point))
- (and (d-forward-identifier) ; parameter name
- (progn
- (c-forward-syntactic-ws)
- (looking-at "[,=)]")))))
+ (cond
+ ;; Type only
+ ((looking-at "[,=)]")
+ t)
+ ;; Parameter name
+ ((d-forward-identifier)
+ (c-forward-syntactic-ws)
+ (looking-at "[,=)]")))))
;; Valid declaration, process it.
diff --git a/tests/I0093_546738540.d.html b/tests/I0093_546738540.d.html
index 79dba61..7f39ecb 100644
--- a/tests/I0093_546738540.d.html
+++ b/tests/I0093_546738540.d.html
@@ -1,5 +1,5 @@
<span class="comment-delimiter">// </span><span class="comment">#run:
(d-test-fontification)
</span>
-<span class="type">void</span> <span class="function-name">f</span>(T)(<span
class="keyword">scope return</span> <span class="type">T</span> <span
class="variable-name">x</span>)
+<span class="type">void</span> <span class="function-name">f</span>(<span
class="type">T</span>)(<span class="keyword">scope return</span> <span
class="type">T</span> <span class="variable-name">x</span>)
{
}
- [nongnu] elpa/d-mode 362be11 250/346: Fix imenu false positive with e.g. private{...}, (continued)
- [nongnu] elpa/d-mode 362be11 250/346: Fix imenu false positive with e.g. private{...}, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ea32e73 264/346: Makefile: Test byte-compiled version, too, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 979c946 256/346: Fix testing multiple nested imenu entries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8ffe5ac 265/346: Remove doxygen-font-lock-*, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 80f2019 261/346: Don't nest imenu to arbitrary depths, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode bdd5d78 281/346: Replace d-forward-decl-or-cast-1 implementation with a custom one, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 02d1c7f 290/346: tests: Add more binary operation tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 09ecdaa 303/346: Add "make coverage", ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 166fac8 313/346: Fix fontification of second foreach variable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 0d45ab2 315/346: Fix brace stack logic creating unbalanced stacks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 55c8cb0 306/346: Fontify types in function parameter lists,
ELPA Syncer <=
- [nongnu] elpa/d-mode c22a8c1 309/346: Fontify variables in foreach loops, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 3731f1b 316/346: Fontify built-in @-keywords as keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e70d89f 312/346: Fix fontification of catch statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2f7adb1 319/346: Fontify sole lambda params, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b40a7ab 328/346: Unbundle undercover.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a9c05fd 331/346: tests/I0102: Remove #min-version, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 32446a7 338/346: Merge pull request #107 from CyberShadow/github-actions, ELPA Syncer, 2021/08/29
- [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