summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorEvgeny Kurnevsky <kurnevsky@gmail.com>2019-04-17 08:11:17 +0300
committerEvgeny Kurnevsky <kurnevsky@gmail.com>2019-04-17 08:11:17 +0300
commitdf31a6e6d846b502e07cf582ce29ad148c446af0 (patch)
tree7ef4b4fd67d003bb4fc845008b23262520990563 /rust-mode.el
parent55e6cd937a4667cf867b8ecd05d5f63eb2e10d6e (diff)
downloadrust-mode-df31a6e6d846b502e07cf582ce29ad148c446af0.tar.gz
Don't call syntax-ppss twice for strings ending with r.
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el9
1 files 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