branch: elpa/d-mode
commit 268222001113f1de8841f7227be6bce65945bcd7
Merge: fbd1f8b e19d704
Author: Russel Winder <[email protected]>
Commit: Russel Winder <[email protected]>
Merge branch 'dmakarov-master'
---
d-mode.el | 6 +++++-
tests/I0021.d | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/d-mode.el b/d-mode.el
index 22cbc34..6b36223 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -534,9 +534,13 @@ Key bindings:
(c-run-mode-hooks 'c-mode-common-hook 'd-mode-hook)
(c-update-modeline)
(cc-imenu-init d-imenu-generic-expression)
+ ;; Generate a function that applies D-specific syntax properties.
+ ;; Concretely, inside back-quoted string literals the backslash
+ ;; 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 ("`\\(\\\\\\)`" (1 "."))))))
+ (syntax-propertize-rules ("`\\([^`]*\\(\\\\\\)[^`]*\\)+`" (2
"."))))))
;;----------------------------------------------------------------------------
;; "Hideous hacks" to support appropriate font-lock behaviour.
diff --git a/tests/I0021.d b/tests/I0021.d
new file mode 100644
index 0000000..090bae6
--- /dev/null
+++ b/tests/I0021.d
@@ -0,0 +1,3 @@
+// #run: (goto-char 74) (c-literal-limits)
+// #out: (72 . 77)
+auto x = `ab\`; // something else