[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode d9e9d06 311/346: Merge d-forward-module-clause into
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode d9e9d06 311/346: Merge d-forward-module-clause into d-forward-keyword-clause |
Date: |
Sun, 29 Aug 2021 11:00:51 -0400 (EDT) |
branch: elpa/d-mode
commit d9e9d065290a3204a1375ab31ede1cb5a34904c1
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Merge d-forward-module-clause into d-forward-keyword-clause
---
d-mode.el | 66 ++++++++++++++++++++++++++-------------------------------------
1 file changed, 27 insertions(+), 39 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 9977ff1..4a62e73 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: 201911120023
+;; Version: 201911120029
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -476,6 +476,29 @@ Evaluate OLD-FORM if the Emacs version is older than
MIN-VERSION,
(setq safe-pos (point))
(cond
+ ((c-keyword-member kwd-sym 'c-ref-list-kwds)
+ (while
+ (progn
+ (c-forward-syntactic-ws)
+ (setq safe-pos (point))
+ (cond
+ ((looking-at c-identifier-start)
+ ;; identifier
+ (setq c-last-identifier-range nil)
+ (forward-char)
+ (c-end-of-current-token)
+ (when c-record-type-identifiers
+ (c-record-ref-id (cons safe-pos (point))))
+ t)
+ ;; . or , or = (keep fontifying)
+ ((memq (char-after) '(?. ?, ?=))
+ (forward-char)
+ t)
+ ;; ; or : or anything else weird
+ (t
+ nil))))
+ (goto-char safe-pos)
+ t)
((and (c-keyword-member kwd-sym 'c-paren-nontype-kwds)
(eq (char-after) ?\())
(forward-char)
@@ -1205,36 +1228,6 @@ Currently handles `-delimited string literals."
(d--if-version>= "26.0"
(advice-add 'c-update-brace-stack :around
#'d-around--c-update-brace-stack))
-;;----------------------------------------------------------------------------
-;; Support for fontifying module name(s) after a module or import keyword.
-
-(defun d-forward-module-clause ()
- "Fontify the module name(s) after a module or import keyword."
- (let (safe-pos pos)
- (goto-char (match-end 1))
- (while
- (progn
- (c-forward-syntactic-ws)
- (setq safe-pos (point))
- (cond
- ((looking-at c-identifier-start)
- ;; identifier
- (setq c-last-identifier-range nil)
- (forward-char)
- (c-end-of-current-token)
- (when c-record-type-identifiers
- (c-record-ref-id (cons safe-pos (point))))
- t)
- ;; . or , or = (keep fontifying)
- ((memq (char-after) '(?. ?, ?=))
- (forward-char)
- t)
- ;; ; or : or anything else weird
- (t
- nil))))
- (goto-char safe-pos)
- t))
-
;; ----------------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;; compilation-mode support ;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1714,14 +1707,9 @@ Each list item should be a regexp matching a single
identifier."
;; D module and import statements
(list (c-make-font-lock-BO-decl-search-function
(concat "\\_<"
- (c-make-keywords-re t (c-lang-const c-ref-list-kwds d) 'd))
- '((c-fontify-types-and-refs ()
- (d-forward-module-clause)
- (if (> (point) limit) (goto-char limit)))))
-
- (c-make-font-lock-BO-decl-search-function
- (concat "\\_<"
- (c-make-keywords-re t (c-lang-const c-paren-nontype-kwds d)
'd))
+ (c-make-keywords-re t (append (c-lang-const c-ref-list-kwds
d)
+ (c-lang-const
c-paren-nontype-kwds d))
+ 'd))
'((c-fontify-types-and-refs ()
(d-forward-keyword-clause 1)
(if (> (point) limit) (goto-char limit))))))
- [nongnu] elpa/d-mode 49cb5a8 275/346: Consolidate c-forward-decl-or-cast-1 annotation patch, (continued)
- [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, 2021/08/29
- [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 <=
- [nongnu] elpa/d-mode f76ba89 308/346: Fontify (type-inferred) lambda arguments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 34f44cf 337/346: .github/workflows/test.yml: Add Emacs 27.1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 379b00e 144/346: Tweak intro comments a bit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 7d3edd2 234/346: Add test from issue #94, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 968306a 224/346: Add a test case against the now-removed fontification hack, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8e208b2 232/346: Fix imenu display of functions for imenu-add-to-menubar, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b2c9831 252/346: Make imenu hierarchical, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 69df4a3 254/346: Abbreviate symbol kind in imenu entries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 12e45cf 258/346: Fix fontification of properties with inferred return type, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 26e7337 253/346: Don't put variables in imenu, ELPA Syncer, 2021/08/29