aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/validation.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
committerAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
commitf3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d (patch)
treef2cb82f74d2d60d5351c3d7c4d8e7bce4d351cab /crates/ra_syntax/src/validation.rs
parent6d5d82e412dea19ea48eecc6f7d5a4aa223a9599 (diff)
rename range -> text_range
Diffstat (limited to 'crates/ra_syntax/src/validation.rs')
-rw-r--r--crates/ra_syntax/src/validation.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs
index 943f88de9..19bdafef2 100644
--- a/crates/ra_syntax/src/validation.rs
+++ b/crates/ra_syntax/src/validation.rs
@@ -33,7 +33,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
33 if let Some(end) = text.rfind('\'') { 33 if let Some(end) = text.rfind('\'') {
34 if let Some(without_quotes) = text.get(2..end) { 34 if let Some(without_quotes) = text.get(2..end) {
35 if let Err((off, err)) = unescape::unescape_byte(without_quotes) { 35 if let Err((off, err)) = unescape::unescape_byte(without_quotes) {
36 let off = token.range().start() + TextUnit::from_usize(off + 2); 36 let off = token.text_range().start() + TextUnit::from_usize(off + 2);
37 acc.push(SyntaxError::new(err.into(), off)) 37 acc.push(SyntaxError::new(err.into(), off))
38 } 38 }
39 } 39 }
@@ -43,7 +43,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
43 if let Some(end) = text.rfind('\'') { 43 if let Some(end) = text.rfind('\'') {
44 if let Some(without_quotes) = text.get(1..end) { 44 if let Some(without_quotes) = text.get(1..end) {
45 if let Err((off, err)) = unescape::unescape_char(without_quotes) { 45 if let Err((off, err)) = unescape::unescape_char(without_quotes) {
46 let off = token.range().start() + TextUnit::from_usize(off + 1); 46 let off = token.text_range().start() + TextUnit::from_usize(off + 1);
47 acc.push(SyntaxError::new(err.into(), off)) 47 acc.push(SyntaxError::new(err.into(), off))
48 } 48 }
49 } 49 }
@@ -55,7 +55,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
55 unescape::unescape_byte_str(without_quotes, &mut |range, char| { 55 unescape::unescape_byte_str(without_quotes, &mut |range, char| {
56 if let Err(err) = char { 56 if let Err(err) = char {
57 let off = range.start; 57 let off = range.start;
58 let off = token.range().start() + TextUnit::from_usize(off + 2); 58 let off = token.text_range().start() + TextUnit::from_usize(off + 2);
59 acc.push(SyntaxError::new(err.into(), off)) 59 acc.push(SyntaxError::new(err.into(), off))
60 } 60 }
61 }) 61 })
@@ -68,7 +68,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
68 unescape::unescape_str(without_quotes, &mut |range, char| { 68 unescape::unescape_str(without_quotes, &mut |range, char| {
69 if let Err(err) = char { 69 if let Err(err) = char {
70 let off = range.start; 70 let off = range.start;
71 let off = token.range().start() + TextUnit::from_usize(off + 1); 71 let off = token.text_range().start() + TextUnit::from_usize(off + 1);
72 acc.push(SyntaxError::new(err.into(), off)) 72 acc.push(SyntaxError::new(err.into(), off))
73 } 73 }
74 }) 74 })