[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 7fa38d2 170/459: Extend syntax propertize f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 7fa38d2 170/459: Extend syntax propertize function for vliterals |
Date: |
Sun, 22 Aug 2021 13:59:20 -0400 (EDT) |
branch: externals/csharp-mode
commit 7fa38d2ac265672d82613e6a508fc5baa4a0f8e3
Author: Vasilij Schneidermann <v.schneidermann@gmail.com>
Commit: Vasilij Schneidermann <v.schneidermann@gmail.com>
Extend syntax propertize function for vliterals
---
csharp-mode.el | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/csharp-mode.el b/csharp-mode.el
index 60d431b..7f73889 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -1145,10 +1145,42 @@ a square parentasis block [ ... ]."
))
+;; verbatim string literals can be multiline
+(c-lang-defconst c-multiline-string-start-char
+ csharp ?@)
+
(defun csharp-mode-syntax-propertize-function (beg end)
- "Highlight text after #region or #pragma as comment."
+ "Apply syntax table properties to special constructs.
+Currently handled:
+
+- Fontify verbatim literal strings correctly
+- Highlight text after #region or #pragma as comment"
(save-excursion
(goto-char beg)
+ (while (search-forward "@\"" end t)
+ (let ((in-comment-or-string-p (save-excursion
+ (goto-char (match-beginning 0))
+ (or (nth 3 (syntax-ppss))
+ (nth 4 (syntax-ppss))))))
+ (when (not in-comment-or-string-p)
+ (let (done)
+ (while (and (not done) (< (point) end))
+ (skip-chars-forward "^\"\\\\" end)
+ (cond
+ ((= (following-char) ?\\)
+ (put-text-property (point) (1+ (point))
+ 'syntax-table (string-to-syntax "."))
+ (forward-char 1))
+ ((= (following-char) ?\")
+ (forward-char 1)
+ (if (= (following-char) ?\")
+ (progn
+ (put-text-property (1- (point)) (point)
+ 'syntax-table (string-to-syntax "/"))
+ (forward-char 1))
+ (setq done t)))))))))
+
+ (goto-char beg)
(while (re-search-forward "^\\s-*#\\(region\\|pragma\\) " end t)
(when (looking-at "\\w")
(put-text-property (point) (1+ (point))
- [elpa] externals/csharp-mode 367ecc2 137/459: Clean up test-code., (continued)
- [elpa] externals/csharp-mode 367ecc2 137/459: Clean up test-code., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e1a7622 138/459: Tenative fixes for compilation-mode., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2ddd3c2 142/459: Merge pull request #62 from shoover/fontification-hang, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b11fcda 147/459: Imenu: Add support for interface-prefixed methods., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bc3bd2a 155/459: Fix devenv.com output-parsing, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9743156 158/459: Test-case for fontification error, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 57b2353 161/459: Bump version since we're working on vNext, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 682e394 162/459: Address issue with cc-mode in Emacs git master., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a631944 165/459: Make check-defuns a make-target., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ce2ff93 168/459: Make fontification-test assess-based., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7fa38d2 170/459: Extend syntax propertize function for vliterals,
ELPA Syncer <=
- [elpa] externals/csharp-mode bd201c2 171/459: Remove now unused code, move log functions to top, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 15d2214 174/459: Clean up loading of dev-packages., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode adb7928 175/459: New test-macros for assess., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e2c9f85 181/459: New imenu-implementation for csharp-mode., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7943738 182/459: Add volatile keyword, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b4b9d61 183/459: Add volatile to imenu, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9a1ddba 185/459: Merge branch 'jtbm37/master', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a8def67 186/459: Add missing test-file. Fix build., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b609f42 187/459: New imenu test-file for method-indexing., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b448614 190/459: Fix fontification of methods found in test-file., ELPA Syncer, 2021/08/22