branch: elpa/d-mode
commit b5d936dfd4c1d0b68a0d911aadd4ba25df7af0e4
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Fix imenu hang with unterminated function declaration
Fix regex thrashing trying to match function declaration in certain
text patterns.
Observed in std.internal.cstring (DDoc string of tempCString).
---
d-mode.el | 3 ++-
tests/imenu.d | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/d-mode.el b/d-mode.el
index 5bf94db..f714093 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: 201810111924
+;; Version: 201812050604
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "24.3"))
@@ -529,6 +529,7 @@ Each list item should be a regexp matching a single
identifier."
;; Pure/const etc.
(zero-or-more
(one-or-more (any "a-z@"))
+ symbol-end
(zero-or-more (any " \t\n")))
(zero-or-more
diff --git a/tests/imenu.d b/tests/imenu.d
index 4743bdc..07c959d 100644
--- a/tests/imenu.d
+++ b/tests/imenu.d
@@ -57,3 +57,8 @@ void test()
{
alias foo = bar;
}
+
+// Imenu hang in std.internal.cstring (reduced)
+/**
+a a (a) aaaaaaaaaaaaaaaaaaaaaaaaaaaa
+*/