aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/lexer/strings.rs
diff options
context:
space:
mode:
authorZach Lute <[email protected]>2018-09-05 06:56:16 +0100
committerZach Lute <[email protected]>2018-09-05 06:56:16 +0100
commitaf0ae9ee0409ce2296dafebf977e353a5b871d80 (patch)
tree58a5db64a5279bf6586481224e8a772c3f965bfc /crates/libsyntax2/src/lexer/strings.rs
parentf87771092c5df9e9c07bcb5052e662bde0a0fa59 (diff)
Updated Ptr methods to better match Parser method names.
Diffstat (limited to 'crates/libsyntax2/src/lexer/strings.rs')
-rw-r--r--crates/libsyntax2/src/lexer/strings.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/libsyntax2/src/lexer/strings.rs b/crates/libsyntax2/src/lexer/strings.rs
index e6ade54a4..5ff483d14 100644
--- a/crates/libsyntax2/src/lexer/strings.rs
+++ b/crates/libsyntax2/src/lexer/strings.rs
@@ -15,11 +15,11 @@ pub(crate) fn is_string_literal_start(c: char, c1: Option<char>, c2: Option<char
15} 15}
16 16
17pub(crate) fn scan_char(ptr: &mut Ptr) { 17pub(crate) fn scan_char(ptr: &mut Ptr) {
18 while let Some(c) = ptr.next() { 18 while let Some(c) = ptr.current() {
19 match c { 19 match c {
20 '\\' => { 20 '\\' => {
21 ptr.bump(); 21 ptr.bump();
22 if ptr.next_is('\\') || ptr.next_is('\'') { 22 if ptr.at('\\') || ptr.at('\'') {
23 ptr.bump(); 23 ptr.bump();
24 } 24 }
25 } 25 }
@@ -57,11 +57,11 @@ pub(crate) fn scan_byte_char_or_string(ptr: &mut Ptr) -> SyntaxKind {
57} 57}
58 58
59pub(crate) fn scan_string(ptr: &mut Ptr) { 59pub(crate) fn scan_string(ptr: &mut Ptr) {
60 while let Some(c) = ptr.next() { 60 while let Some(c) = ptr.current() {
61 match c { 61 match c {
62 '\\' => { 62 '\\' => {
63 ptr.bump(); 63 ptr.bump();
64 if ptr.next_is('\\') || ptr.next_is('"') { 64 if ptr.at('\\') || ptr.at('"') {
65 ptr.bump(); 65 ptr.bump();
66 } 66 }
67 } 67 }
@@ -78,11 +78,11 @@ pub(crate) fn scan_string(ptr: &mut Ptr) {
78 78
79pub(crate) fn scan_raw_string(ptr: &mut Ptr) { 79pub(crate) fn scan_raw_string(ptr: &mut Ptr) {
80 let mut hashes = 0; 80 let mut hashes = 0;
81 while ptr.next_is('#') { 81 while ptr.at('#') {
82 hashes += 1; 82 hashes += 1;
83 ptr.bump(); 83 ptr.bump();
84 } 84 }
85 if !ptr.next_is('"') { 85 if !ptr.at('"') {
86 return; 86 return;
87 } 87 }
88 ptr.bump(); 88 ptr.bump();
@@ -90,7 +90,7 @@ pub(crate) fn scan_raw_string(ptr: &mut Ptr) {
90 while let Some(c) = ptr.bump() { 90 while let Some(c) = ptr.bump() {
91 if c == '"' { 91 if c == '"' {
92 let mut hashes_left = hashes; 92 let mut hashes_left = hashes;
93 while ptr.next_is('#') && hashes_left > 0{ 93 while ptr.at('#') && hashes_left > 0{
94 hashes_left -= 1; 94 hashes_left -= 1;
95 ptr.bump(); 95 ptr.bump();
96 } 96 }
@@ -110,7 +110,7 @@ fn scan_byte_string(ptr: &mut Ptr) {
110} 110}
111 111
112fn scan_raw_byte_string(ptr: &mut Ptr) { 112fn scan_raw_byte_string(ptr: &mut Ptr) {
113 if !ptr.next_is('"') { 113 if !ptr.at('"') {
114 return; 114 return;
115 } 115 }
116 ptr.bump(); 116 ptr.bump();