[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode af6dbfa 183/346: Generalize StorageClass/Visibility
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode af6dbfa 183/346: Generalize StorageClass/VisibilityAttribute parsing in imenu |
Date: |
Sun, 29 Aug 2021 11:00:26 -0400 (EDT) |
branch: elpa/d-mode
commit af6dbfa15421e17aa5279461bc99c985dba9ba62
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Generalize StorageClass/VisibilityAttribute parsing in imenu
---
d-mode.el | 76 ++++++++++++++++++++++++++++++++++++++++++-----------------
tests/imenu.d | 5 +++-
2 files changed, 58 insertions(+), 23 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 2312f71..75f46f0 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: 201908262309
+;; Version: 201908262320
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "24.3"))
@@ -477,10 +477,6 @@ Each list item should be a regexp matching a single
identifier."
(defconst d--imenu-rx-def-start
'(seq
- ;; Whitespace
- bol
- (zero-or-more space)
-
;; Conditionals
(zero-or-one
"else"
@@ -495,21 +491,51 @@ Each list item should be a regexp matching a single
identifier."
")"
(zero-or-more space))
- ;; Extern declarations
- (zero-or-one
- "extern"
- (zero-or-more space)
- "("
- (zero-or-more space)
- (one-or-more (not (any "()")))
- (zero-or-more space)
- ")"
+ (zero-or-more
+ word-start
+ (or
+ ;; StorageClass
+ "deprecated"
+ "static"
+ "extern"
+ "abstract"
+ "final"
+ "override"
+ "synchronized"
+ "scope"
+ "nothrow"
+ "pure"
+ "ref"
+ (seq
+ (or
+ "extern"
+ "deprecated"
+ "package"
+ )
+ (zero-or-more space)
+ "("
+ (zero-or-more space)
+ (one-or-more (not (any "()")))
+ (zero-or-more space)
+ ")")
+
+ ;; VisibilityAttribute
+ "private"
+ "package"
+ "protected"
+ "public"
+ "export"
+ )
(zero-or-more space))
))
(defconst d-imenu-method-name-pattern
(rx
+ ;; Whitespace
+ bol
+ (zero-or-more space)
+
(eval d--imenu-rx-def-start)
;; Qualifiers
@@ -591,10 +617,9 @@ Each list item should be a regexp matching a single
identifier."
(defvar d-imenu-generic-expression
`(("*Classes*"
,(rx
+ bol
+ (zero-or-more space)
(eval d--imenu-rx-def-start)
- (zero-or-more
- (or "final" "abstract" "private" "package" "protected" "public"
"export" "static")
- (one-or-more (syntax whitespace)))
word-start
"class"
(one-or-more (syntax whitespace))
@@ -607,6 +632,8 @@ Each list item should be a regexp matching a single
identifier."
1)
("*Interfaces*"
,(rx
+ bol
+ (zero-or-more space)
(eval d--imenu-rx-def-start)
word-start
"interface"
@@ -620,10 +647,9 @@ Each list item should be a regexp matching a single
identifier."
1)
("*Structs*"
,(rx
+ bol
+ (zero-or-more space)
(eval d--imenu-rx-def-start)
- (zero-or-more
- (or "private" "package" "protected" "public" "export" "static")
- (one-or-more (syntax whitespace)))
word-start
"struct"
(one-or-more (syntax whitespace))
@@ -636,6 +662,8 @@ Each list item should be a regexp matching a single
identifier."
1)
("*Templates*"
,(rx
+ bol
+ (zero-or-more space)
(eval d--imenu-rx-def-start)
(zero-or-one
"mixin"
@@ -652,6 +680,8 @@ Each list item should be a regexp matching a single
identifier."
1)
("*Enums*"
,(rx
+ bol
+ (zero-or-more space)
(eval d--imenu-rx-def-start)
word-start
"enum"
@@ -670,7 +700,8 @@ Each list item should be a regexp matching a single
identifier."
;; declared at the beginning of lines.
("*Aliases*"
,(rx
- line-start
+ bol
+ (eval d--imenu-rx-def-start)
"alias"
(one-or-more (syntax whitespace))
(submatch
@@ -684,7 +715,8 @@ Each list item should be a regexp matching a single
identifier."
1)
("*Aliases*"
,(rx
- line-start
+ bol
+ (eval d--imenu-rx-def-start)
"alias"
(one-or-more (syntax whitespace))
(one-or-more
diff --git a/tests/imenu.d b/tests/imenu.d
index 0dddfcd..2dc9089 100644
--- a/tests/imenu.d
+++ b/tests/imenu.d
@@ -1,5 +1,5 @@
// #run: (d-test-get-imenu-lines)
-// #out: (4 6 11 14 17 19 22 25 33 34 37 40 43 46 49 52 54 56 67 75 78)
+// #out: (4 6 11 14 17 19 22 25 33 34 37 40 43 46 49 52 54 56 67 75 78 81)
void foo(int x) {}
@@ -76,3 +76,6 @@ version(CoreDdoc) enum ClockType {}
// Extern declarations
extern (D) void peekSlice() {}
+
+// Aliases with VisibilityAttribute / StorageClass
+public alias foo=bar;
- [nongnu] elpa/d-mode 89339fa 100/346: Fix typo in comment, (continued)
- [nongnu] elpa/d-mode 89339fa 100/346: Fix typo in comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 14e2e3b 105/346: Fix exponential fontification time of backslashes in WYSIWYG-literals, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 438cf53 109/346: fixed missing keyword "idouble", ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f6bf2b7 141/346: tests: Split test into individual ert tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 23d7a1a 148/346: tests: Fix testing compilation-mode buffers with Emacs 26, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a731ae6 157/346: Fix imenu for functions with parameter types containing parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ab1057f 159/346: Fix imenu for functions with tail qualifiers on their own line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f61e72c 173/346: Drop support for Emacs < 24.3, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 09745ba 175/346: Merge pull request #87 from CyberShadow/emacs-24-plus, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode cfd1d08 180/346: Use rx-to-string instead of rx-form to support Emacs master (#97), ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode af6dbfa 183/346: Generalize StorageClass/VisibilityAttribute parsing in imenu,
ELPA Syncer <=
- [nongnu] elpa/d-mode 2964263 184/346: Fix imenu with alias templates, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 71e8bda 196/346: Improve constructor handling and fix constructor contract indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 28810ef 194/346: Add test for function contracts, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 1bce6c4 191/346: Somewhat improve fontification of module names, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b413942 198/346: Tighten K&R region detection, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 07cb4d0 199/346: Add d-lineup-arglists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode d3ceb14 200/346: Make d--imenu-rx-def-start a compile-time constant, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 0b6a089 217/346: .travis.yml: Try using a emacs-travis.mk which does not use FTP, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 653661e 220/346: Fix parsing qualified types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f07f365 201/346: Fix fontification of constructor parameters, ELPA Syncer, 2021/08/29