[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 766bd82 139/486: Parse '\\' and '\"' as char lit
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 766bd82 139/486: Parse '\\' and '\"' as char literals |
Date: |
Sat, 7 Aug 2021 09:25:06 -0400 (EDT) |
branch: elpa/rust-mode
commit 766bd8279b18bcbf6af0b8fea370c85414e407c4
Author: Micah Chalmer <micah@micahchalmer.net>
Commit: Micah Chalmer <micah@micahchalmer.net>
Parse '\\' and '\"' as char literals
---
rust-mode-tests.el | 16 ++++++++++++++++
rust-mode.el | 2 +-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 007d116..3510d69 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -927,6 +927,22 @@ list of substrings of `STR' each followed by its face."
"let" font-lock-keyword-face
"'\\''" font-lock-string-face)))
+(ert-deftest font-lock-escaped-double-quote-character-literal ()
+ (rust-test-font-lock
+ "fn main() { let ch = '\\\"'; }"
+ '("fn" font-lock-keyword-face
+ "main" font-lock-function-name-face
+ "let" font-lock-keyword-face
+ "'\\\"'" font-lock-string-face)))
+
+(ert-deftest font-lock-escaped-backslash-character-literal ()
+ (rust-test-font-lock
+ "fn main() { let ch = '\\\\'; }"
+ '("fn" font-lock-keyword-face
+ "main" font-lock-function-name-face
+ "let" font-lock-keyword-face
+ "'\\\\'" font-lock-string-face)))
+
(ert-deftest font-lock-raw-strings-no-hashes ()
(rust-test-font-lock
"r\"No hashes\";"
diff --git a/rust-mode.el b/rust-mode.el
index c82a484..9a6eb5f 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -423,7 +423,7 @@
;; Handle single quoted character literals:
(mapcar (lambda (re) (list re '(1 "\"") '(2 "\"")))
'("\\('\\)[^']\\('\\)"
- "\\('\\)\\\\['nrt]\\('\\)"
+ "\\('\\)\\\\['nrt\"\\]\\('\\)"
"\\('\\)\\\\x[[:xdigit:]]\\{2\\}\\('\\)"
"\\('\\)\\\\u[[:xdigit:]]\\{4\\}\\('\\)"
"\\('\\)\\\\U[[:xdigit:]]\\{8\\}\\('\\)"))
- [nongnu] elpa/rust-mode 439da40 115/486: disable emacs23 testing on travis., (continued)
- [nongnu] elpa/rust-mode 439da40 115/486: disable emacs23 testing on travis., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d2c6d6c 116/486: Merge pull request #26 from pnkfelix/disable-emacs23-testing, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 8c9ea88 127/486: Fix raw string bugs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a653c6b 123/486: Highlight raw strings correctly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f3e8f20 119/486: Re-enable emacs23 in Travis, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5b73df1 133/486: Fix typo/missing lines in comment in test, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 3a0a727 129/486: Merge pull request #35 from MicahChalmer/fix-raw-string-bugs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c7413e6 130/486: Don't set syntax-begin-function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b15b0eb 140/486: Merge pull request #45 from MicahChalmer/backslash-and-double-quote-char-literals, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 52febe9 137/486: Add a few more tests for indents inside strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 766bd82 139/486: Parse '\\' and '\"' as char literals,
ELPA Syncer <=
- [nongnu] elpa/rust-mode d6b1739 136/486: Fix spurious errors in emacs 23, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 3995d33 152/486: Add regression test for PR #52., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f2d709e 141/486: Make fill-region work correctly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 8a8bd58 159/486: Merge pull request #58 from lunaryorn/patch-1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2f0c84f 150/486: rust-align-to-method-chain: Jump over symbols, not words, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2e800ee 151/486: workaround emacs 23 issues., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2be934c 147/486: Merge pull request #55 from kriben/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 4e938b1 164/486: Merge pull request #63 from krig/panic-compilation-warning, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f17e11a 162/486: Match panics during build as compilation warnings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b4ff35c 168/486: remove rust-mode-character-literal-syntax-table, ELPA Syncer, 2021/08/07