branch: elpa/d-mode
commit 5dbec4aa1bb4133d6d813f93c7eda0f84d698b9a
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Convert backquote-in-backtick-string regexp to rx
---
d-mode.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index bb8848d..f08e3ef 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -602,8 +602,22 @@ Key bindings:
;; character '\' is treated as a punctuation symbol. See help for
;; syntax-propertize-rules function for more information.
(when (version<= "24.3" emacs-version)
- (setq-local syntax-propertize-function
- (syntax-propertize-rules
("`[^\\\\`]*?\\(\\(\\\\\\)[^\\\\`]*?\\)+?`" (2 "."))))))
+ (setq-local
+ syntax-propertize-function
+ (syntax-propertize-rules
+ ((rx
+ "`"
+ (minimal-match
+ (zero-or-more
+ (not (any "`\\"))))
+ (minimal-match
+ (one-or-more
+ (submatch "\\")
+ (minimal-match
+ (zero-or-more
+ (not (any "`\\"))))))
+ "`")
+ (1 "."))))))
;;----------------------------------------------------------------------------
;; "Hideous hacks" to support appropriate font-lock behaviour.