From af0ae9ee0409ce2296dafebf977e353a5b871d80 Mon Sep 17 00:00:00 2001 From: Zach Lute Date: Tue, 4 Sep 2018 22:56:16 -0700 Subject: Updated Ptr methods to better match Parser method names. --- crates/libsyntax2/src/lexer/strings.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/libsyntax2/src/lexer/strings.rs') 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, c2: Option { ptr.bump(); - if ptr.next_is('\\') || ptr.next_is('\'') { + if ptr.at('\\') || ptr.at('\'') { ptr.bump(); } } @@ -57,11 +57,11 @@ pub(crate) fn scan_byte_char_or_string(ptr: &mut Ptr) -> SyntaxKind { } pub(crate) fn scan_string(ptr: &mut Ptr) { - while let Some(c) = ptr.next() { + while let Some(c) = ptr.current() { match c { '\\' => { ptr.bump(); - if ptr.next_is('\\') || ptr.next_is('"') { + if ptr.at('\\') || ptr.at('"') { ptr.bump(); } } @@ -78,11 +78,11 @@ pub(crate) fn scan_string(ptr: &mut Ptr) { pub(crate) fn scan_raw_string(ptr: &mut Ptr) { let mut hashes = 0; - while ptr.next_is('#') { + while ptr.at('#') { hashes += 1; ptr.bump(); } - if !ptr.next_is('"') { + if !ptr.at('"') { return; } ptr.bump(); @@ -90,7 +90,7 @@ pub(crate) fn scan_raw_string(ptr: &mut Ptr) { while let Some(c) = ptr.bump() { if c == '"' { let mut hashes_left = hashes; - while ptr.next_is('#') && hashes_left > 0{ + while ptr.at('#') && hashes_left > 0{ hashes_left -= 1; ptr.bump(); } @@ -110,7 +110,7 @@ fn scan_byte_string(ptr: &mut Ptr) { } fn scan_raw_byte_string(ptr: &mut Ptr) { - if !ptr.next_is('"') { + if !ptr.at('"') { return; } ptr.bump(); -- cgit v1.2.3