branch: elpa/d-mode
commit a731ae620384e182c3c57030528d84c9c62f1d49
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Fix imenu for functions with parameter types containing parens
Support one-level-deep parens in parameters for now.
---
d-mode.el | 11 +++++++++--
tests/imenu.d | 5 ++++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 4d6829a..585dfbe 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: 201610111901
+;; Version: 201610111913
;; Keywords: D programming language emacs cc-mode
;;;; NB Version number is date and time yyyymmddhhMM UTC.
@@ -491,7 +491,14 @@ The expression is added to
`compilation-error-regexp-alist' and
(zero-or-more (syntax whitespace)))
;; Arguments
- "(" (zero-or-more (not (any ")"))) ")"
+ "("
+ (zero-or-more (not (any "()")))
+ (zero-or-more
+ "("
+ (one-or-more (not (any "()")))
+ ")"
+ (zero-or-more (not (any "()"))))
+ ")"
(zero-or-more (syntax whitespace))
;; Pure/const etc.
diff --git a/tests/imenu.d b/tests/imenu.d
index 0ebddb2..34c2b55 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)
+// #out: (4 6 11 14 17 19)
void foo(int x) {}
@@ -15,3 +15,6 @@ extern (C) int rt_init()
{}
Duration dur(string units)(long length) @safe pure nothrow @nogc {}
+
+void test(const(char)* str)
+{}