branch: elpa/d-mode
commit a8aad3587ae9dea83a5aa5b807af998f0f2ebb1b
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Fix imenu false positive with "static if"
---
d-mode.el | 6 +++---
tests/imenu.d | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 02bc10a..874102f 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <[email protected]>
;; Vladimir Panteleev <[email protected]>
;; Created: March 2007
-;; Version: 201909092122
+;; Version: 201909092140
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -608,10 +608,10 @@ Each list item should be a regexp matching a single
identifier."
"Aliases") ; old-style alias
((memq next-char '(?\; ?= ?,))
"Variables")
+ ((member name '("import" "if"))
+ nil) ; static import/if
((memq next-char '(?\())
t) ; function
- ((equal name "import")
- nil) ; static import
(t ; unknown
id-prev-token))))
diff --git a/tests/imenu.d b/tests/imenu.d
index 4cc2099..e2f8408 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 81 84
87 89 93 94 96 97 99 104)
+// #out: (4 6 11 14 17 19 22 25 33 34 37 40 43 46 49 52 54 56 67 75 78 81 84
87 89 93 94 96 97 99 104 109)
void foo(int x) {}
@@ -104,3 +104,6 @@ alias
Number
=
int;
+
+static if (false)
+ int fun();