aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_syntax/src/validation.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs
index 61cf83c84..9cb9ccc41 100644
--- a/crates/ra_syntax/src/validation.rs
+++ b/crates/ra_syntax/src/validation.rs
@@ -148,7 +148,7 @@ fn validate_char(node: ast::Char, errors: &mut Vec<SyntaxError>) {
148 148
149fn is_ascii_escape(code: char) -> bool { 149fn is_ascii_escape(code: char) -> bool {
150 match code { 150 match code {
151 '\'' | '"' | 'n' | 'r' | 't' | '0' => true, 151 '\\' | '\'' | '"' | 'n' | 'r' | 't' | '0' => true,
152 _ => false, 152 _ => false,
153 } 153 }
154} 154}
@@ -206,7 +206,9 @@ mod test {
206 206
207 #[test] 207 #[test]
208 fn test_valid_ascii_escape() { 208 fn test_valid_ascii_escape() {
209 let valid = [r"\'", "\"", "\\\"", r"\n", r"\r", r"\t", r"\0", "a", "b"]; 209 let valid = [
210 r"\'", "\"", "\\\\", "\\\"", r"\n", r"\r", r"\t", r"\0", "a", "b",
211 ];
210 for c in &valid { 212 for c in &valid {
211 assert_valid_char(c); 213 assert_valid_char(c);
212 } 214 }