branch: elpa/d-mode
commit facf01af2d47f499375449aca08c47de2a09e63a
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Fix imenu with inout types
---
d-mode.el | 26 +++++++++++++++++++-------
tests/imenu.d | 5 ++++-
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index d2eae9a..d439dd4 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: 201908262331
+;; Version: 201908262342
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "24.3"))
@@ -251,9 +251,9 @@ The expression is added to `compilation-error-regexp-alist'
and
;; Keywords that can prefix normal declarations of identifiers
(c-lang-defconst c-modifier-kwds
- d '("__gshared" "abstract" "deprecated" "extern"
- "final" "in" "out" "inout" "lazy" "mixin" "override" "private"
- "protected" "public" "ref" "scope" "shared" "static" "synchronized"
+ d '("abstract" "deprecated" "extern"
+ "final" "in" "out" "lazy" "mixin" "override" "private"
+ "protected" "public" "ref" "scope" "static" "synchronized"
"volatile" "__vector"))
(c-lang-defconst c-class-decl-kwds
@@ -265,7 +265,7 @@ The expression is added to `compilation-error-regexp-alist'
and
;; d '("enum"))
(c-lang-defconst c-type-modifier-kwds
- d '("__gshared" "inout" "lazy" "shared" "volatile"
+ d '("lazy" "volatile"
"invariant" "enum" "__vector"))
(c-lang-defconst c-type-prefix-kwds
@@ -294,7 +294,7 @@ The expression is added to `compilation-error-regexp-alist'
and
(c-lang-defconst c-protection-kwds
;; Access protection label keywords in classes.
d '("deprecated" "static" "extern" "final" "synchronized" "override"
- "abstract" "scope" "inout" "shared" "__gshared"
+ "abstract" "scope"
"private" "package" "protected" "public" "export"))
;;(c-lang-defconst c-postfix-decl-spec-kwds
@@ -879,7 +879,19 @@ Key bindings:
(d-try-match-decl d-fun-decl-pattern))
(defun d-match-auto (limit)
"Helper function." ;; checkdoc-params: limit
- (c-syntactic-re-search-forward "\\<\\(auto\\|const\\|immutable\\)\\>" limit
t))
+ (c-syntactic-re-search-forward
+ (rx
+ word-start
+ (group
+ (or
+ "auto"
+ "const"
+ "immutable"
+ "inout"
+ "shared"
+ "__gshared"))
+ word-end)
+ limit t))
(font-lock-add-keywords
'd-mode
diff --git a/tests/imenu.d b/tests/imenu.d
index 1cfee1b..5b4dd0b 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)
+// #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)
void foo(int x) {}
@@ -89,3 +89,6 @@ public alias Regex(Char) = std.regex.internal.ir.Regex!(Char);
string relativePath(CaseSensitive cs = CaseSensitive.osDefault)
(string path, lazy string base = getcwd())
{}
+
+inout(ubyte) bytes(){}
+immutable(ubyte) bytes(){}