aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/lexer
diff options
context:
space:
mode:
authorMarcus Klaas de Vries <[email protected]>2019-01-14 19:56:14 +0000
committerMarcus Klaas de Vries <[email protected]>2019-01-14 19:56:14 +0000
commitd67eabb512a08a451a649c7f20e4e9ae1860a8a0 (patch)
tree99c5fb5004f3fb7a6b0855033855c439675cc0ff /crates/ra_syntax/src/lexer
parent26893487722d07b3f31a6addfc88e6948620989c (diff)
Fix type inference for raw (byte) strings
Diffstat (limited to 'crates/ra_syntax/src/lexer')
-rw-r--r--crates/ra_syntax/src/lexer/strings.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/crates/ra_syntax/src/lexer/strings.rs b/crates/ra_syntax/src/lexer/strings.rs
index 5090feae6..0865b7f3b 100644
--- a/crates/ra_syntax/src/lexer/strings.rs
+++ b/crates/ra_syntax/src/lexer/strings.rs
@@ -49,7 +49,7 @@ pub(crate) fn scan_byte_char_or_string(ptr: &mut Ptr) -> SyntaxKind {
49 BYTE_STRING 49 BYTE_STRING
50 } 50 }
51 'r' => { 51 'r' => {
52 scan_raw_byte_string(ptr); 52 scan_raw_string(ptr);
53 RAW_BYTE_STRING 53 RAW_BYTE_STRING
54 } 54 }
55 _ => unreachable!(), 55 _ => unreachable!(),
@@ -108,16 +108,3 @@ fn scan_byte(ptr: &mut Ptr) {
108fn scan_byte_string(ptr: &mut Ptr) { 108fn scan_byte_string(ptr: &mut Ptr) {
109 scan_string(ptr) 109 scan_string(ptr)
110} 110}
111
112fn scan_raw_byte_string(ptr: &mut Ptr) {
113 if !ptr.at('"') {
114 return;
115 }
116 ptr.bump();
117
118 while let Some(c) = ptr.bump() {
119 if c == '"' {
120 return;
121 }
122 }
123}