[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 183af81eb5 1/2: Use new cc-mode multiline support f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 183af81eb5 1/2: Use new cc-mode multiline support for normal strings |
Date: |
Thu, 2 Jun 2022 02:58:10 -0400 (EDT) |
branch: elpa/d-mode
commit 183af81eb534280d844405e8e7a6cc1deb3e6378
Author: Richard Adenling <dreeze@gmail.com>
Commit: Richard Adenling <dreeze@gmail.com>
Use new cc-mode multiline support for normal strings
c-multiline-string-start-char was the previous way to handle multiline
strings. cc-mode has replaced this by with c-ml-string-opener-re and
c-ml-string-any-closer-re. This is now used for handling normal
strings in D since all normal strings can be multiline.
---
d-mode.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/d-mode.el b/d-mode.el
index 9c5bf234ea..e7ae9b17f7 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -162,6 +162,22 @@
;; Set to true to indicate that D doesn't mind raw embedded newlines in
strings
d t)
+;; Configure cc-mode multiline support (this overrides
+;; c-multiline-string-start-char)
+(c-lang-defconst c-ml-string-opener-re
+ ;; " opens multiline strings in D
+ d "\\(\\(\"\\)\\)")
+
+(c-lang-defconst c-ml-string-max-opener-len
+ d 1)
+
+(c-lang-defconst c-ml-string-any-closer-re
+ ;; Unescaped " closes the string
+ d "\\(?:\\=\\|[^\\]\\)\\(\\(\"\\)\\)")
+
+(c-lang-defconst c-ml-string-max-closer-len
+ d 1)
+
(c-lang-defconst c-opt-cpp-prefix
;; Preprocessor directive recognizer. D doesn't have cpp, but it has #line
d "\\s *#\\s *")