[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 05fc5f1 284/346: Consolidate c-forward-decl-or-cast
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 05fc5f1 284/346: Consolidate c-forward-decl-or-cast-1 "scope" patch |
Date: |
Sun, 29 Aug 2021 11:00:46 -0400 (EDT) |
branch: elpa/d-mode
commit 05fc5f167ad0ee5479e92b06f4304b85dc5bd94a
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Consolidate c-forward-decl-or-cast-1 "scope" patch
---
d-mode.el | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 2ad47a5..e36ebfe 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: 201911111307
+;; Version: 201911111348
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -659,6 +659,9 @@ declaration (or follow the argument list, in case of
functions)."
((looking-at (d-make-keywords-re t '("enum")))
(setq match-index 1
kind 'enum))
+ ((looking-at (d-make-keywords-re t '("scope")))
+ (setq match-index 1
+ kind 'scope))
((looking-at (d-make-keywords-re t (c-lang-const d-type-modifier-kwds
d)))
(setq match-index 1
kind 'type-modifier))
@@ -675,12 +678,14 @@ declaration (or follow the argument list, in case of
functions)."
;; - package(std)
;; - @SomeUDA(...)
(if (looking-at "(")
- ;; Distinguish between "const x" and "const(x)". In the
+ ;; 1. Distinguish between "const x" and "const(x)". In the
;; former, "const" is an attribute, but in the latter it is
;; part of a type. This distinction is important when parsing
;; constructs where a type is required; a greedy attribute
;; match would leave only "(x)" which will not make sense.
- (if (eq kind 'type-modifier)
+ ;; 2. Distinguish between scope variables (e.g. "scope x = new
+ ;; ...") and scope statements (e.g. "scope(exit) { ... }").
+ (if (memq kind '(type-modifier scope))
(progn
(goto-char start)
nil)
@@ -698,16 +703,6 @@ declaration (or follow the argument list, in case of
functions)."
((not (c-major-mode-is 'd-mode))
(apply orig-fun args))
- ;; D: cc-mode gets confused due to "scope" being a keyword that can
- ;; both be part of declarations (as a storage class), and a
- ;; statement (e.g. "scope(exit)"). Disambiguate them here.
- ((and
- (looking-at (d-make-keywords-re t '("scope")))
- (save-excursion
- (c-forward-token-2)
- (looking-at "(")))
- nil)
-
(t
(apply #'d-forward-decl-or-cast-1 args))))
- [nongnu] elpa/d-mode 505022e 341/346: tests: New testcase, (continued)
- [nongnu] elpa/d-mode 505022e 341/346: tests: New testcase, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 199743d 346/346: tests/I0021: Update condition, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 66796d0 247/346: Rename gplv2.txt -> COPYING, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 51dcd68 251/346: Improve comprehension of D constructors and destructors, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f4b3d8a 267/346: Precompute regular expressions for inline keyword lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 809586a 266/346: Reorganize code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 4851fc2 270/346: Fix fontification of "enum" in string literals, ELPA Syncer, 2021/08/29
- [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 <=
- [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, 2021/08/29
- [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