emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode df31a6e 393/486: Don't call syntax-ppss twice fo


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode df31a6e 393/486: Don't call syntax-ppss twice for strings ending with r.
Date: Sat, 7 Aug 2021 09:26:00 -0400 (EDT)

branch: elpa/rust-mode
commit df31a6e6d846b502e07cf582ce29ad148c446af0
Author: Evgeny Kurnevsky <kurnevsky@gmail.com>
Commit: Evgeny Kurnevsky <kurnevsky@gmail.com>

    Don't call syntax-ppss twice for strings ending with r.
---
 rust-mode.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/rust-mode.el b/rust-mode.el
index 1d88f82..6cfaf41 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1137,9 +1137,12 @@ raw string, or to END, whichever comes first."
     (rust--char-literal-rx (1 "\"") (2 "\""))
     ;; Raw strings.
     ("\\(r\\)#*\""
-     (1 (prog1 (if (nth 8 (syntax-ppss (match-beginning 0))) nil 
(string-to-syntax "|"))
-         (goto-char (match-end 0))
-         (rust--syntax-propertize-raw-string end))))
+     (0 (ignore
+          (goto-char (match-end 0))
+          (unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0))))
+            (put-text-property (match-beginning 1) (match-end 1)
+                              'syntax-table (string-to-syntax "|"))
+            (rust--syntax-propertize-raw-string end)))))
     ("[<>]"
      (0 (ignore
         (when (save-match-data



reply via email to

[Prev in Thread] Current Thread [Next in Thread]