Skip to content

Commit df31a6e

Browse files
committed
Don't call syntax-ppss twice for strings ending with r.
1 parent 55e6cd9 commit df31a6e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rust-mode.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,9 +1137,12 @@ raw string, or to END, whichever comes first."
11371137
(rust--char-literal-rx (1 "\"") (2 "\""))
11381138
;; Raw strings.
11391139
("\\(r\\)#*\""
1140-
(1 (prog1 (if (nth 8 (syntax-ppss (match-beginning 0))) nil (string-to-syntax "|"))
1141-
(goto-char (match-end 0))
1142-
(rust--syntax-propertize-raw-string end))))
1140+
(0 (ignore
1141+
(goto-char (match-end 0))
1142+
(unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0))))
1143+
(put-text-property (match-beginning 1) (match-end 1)
1144+
'syntax-table (string-to-syntax "|"))
1145+
(rust--syntax-propertize-raw-string end)))))
11431146
("[<>]"
11441147
(0 (ignore
11451148
(when (save-match-data

0 commit comments

Comments
 (0)