aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/lexer
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/lexer')
-rw-r--r--crates/libsyntax2/src/lexer/strings.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/lexer/strings.rs b/crates/libsyntax2/src/lexer/strings.rs
index e3704fbb3..fbae767e5 100644
--- a/crates/libsyntax2/src/lexer/strings.rs
+++ b/crates/libsyntax2/src/lexer/strings.rs
@@ -55,6 +55,11 @@ pub(crate) fn scan_string(ptr: &mut Ptr) {
55} 55}
56 56
57pub(crate) fn scan_raw_string(ptr: &mut Ptr) { 57pub(crate) fn scan_raw_string(ptr: &mut Ptr) {
58 let mut hashes = 0;
59 while ptr.next_is('#') {
60 hashes += 1;
61 ptr.bump();
62 }
58 if !ptr.next_is('"') { 63 if !ptr.next_is('"') {
59 return; 64 return;
60 } 65 }
@@ -62,7 +67,14 @@ pub(crate) fn scan_raw_string(ptr: &mut Ptr) {
62 67
63 while let Some(c) = ptr.bump() { 68 while let Some(c) = ptr.bump() {
64 if c == '"' { 69 if c == '"' {
65 return; 70 let mut hashes_left = hashes;
71 while ptr.next_is('#') && hashes_left > 0{
72 hashes_left -= 1;
73 ptr.bump();
74 }
75 if hashes_left == 0 {
76 return;
77 }
66 } 78 }
67 } 79 }
68} 80}