aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/validation
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 09:05:55 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 09:05:55 +0000
commit3f4be819125ce4a22edd86721fa56b5caba99c2e (patch)
treebe93895ddc08c911585d9f7bc64623a3741f32c6 /crates/ra_syntax/src/validation
parent4e444d2bc24d16284401444fd2154f63e0f96070 (diff)
parent122410d7aa34a32d468a3173858cbc8a2bbc68f5 (diff)
Merge #449
449: switch to new rowan API r=matklad a=matklad closes https://github.com/rust-analyzer/rust-analyzer/issues/448 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/validation')
-rw-r--r--crates/ra_syntax/src/validation/byte.rs8
-rw-r--r--crates/ra_syntax/src/validation/byte_string.rs8
-rw-r--r--crates/ra_syntax/src/validation/char.rs8
-rw-r--r--crates/ra_syntax/src/validation/string.rs8
4 files changed, 16 insertions, 16 deletions
diff --git a/crates/ra_syntax/src/validation/byte.rs b/crates/ra_syntax/src/validation/byte.rs
index 714224b09..4deb302a7 100644
--- a/crates/ra_syntax/src/validation/byte.rs
+++ b/crates/ra_syntax/src/validation/byte.rs
@@ -11,7 +11,7 @@ use crate::{
11 }, 11 },
12}; 12};
13 13
14pub(super) fn validate_byte_node(node: ast::Byte, errors: &mut Vec<SyntaxError>) { 14pub(super) fn validate_byte_node(node: &ast::Byte, errors: &mut Vec<SyntaxError>) {
15 let literal_text = node.text(); 15 let literal_text = node.text();
16 let literal_range = node.syntax().range(); 16 let literal_range = node.syntax().range();
17 let mut components = string_lexing::parse_byte_literal(literal_text); 17 let mut components = string_lexing::parse_byte_literal(literal_text);
@@ -106,11 +106,11 @@ fn validate_byte_code_escape(text: &str, range: TextRange, errors: &mut Vec<Synt
106 106
107#[cfg(test)] 107#[cfg(test)]
108mod test { 108mod test {
109 use crate::SourceFileNode; 109 use crate::{SourceFile, TreePtr};
110 110
111 fn build_file(literal: &str) -> SourceFileNode { 111 fn build_file(literal: &str) -> TreePtr<SourceFile> {
112 let src = format!("const C: u8 = b'{}';", literal); 112 let src = format!("const C: u8 = b'{}';", literal);
113 SourceFileNode::parse(&src) 113 SourceFile::parse(&src)
114 } 114 }
115 115
116 fn assert_valid_byte(literal: &str) { 116 fn assert_valid_byte(literal: &str) {
diff --git a/crates/ra_syntax/src/validation/byte_string.rs b/crates/ra_syntax/src/validation/byte_string.rs
index f7a4fb156..670c43a09 100644
--- a/crates/ra_syntax/src/validation/byte_string.rs
+++ b/crates/ra_syntax/src/validation/byte_string.rs
@@ -9,7 +9,7 @@ use crate::{
9 9
10use super::byte; 10use super::byte;
11 11
12pub(crate) fn validate_byte_string_node(node: ast::ByteString, errors: &mut Vec<SyntaxError>) { 12pub(crate) fn validate_byte_string_node(node: &ast::ByteString, errors: &mut Vec<SyntaxError>) {
13 let literal_text = node.text(); 13 let literal_text = node.text();
14 let literal_range = node.syntax().range(); 14 let literal_range = node.syntax().range();
15 let mut components = string_lexing::parse_byte_string_literal(literal_text); 15 let mut components = string_lexing::parse_byte_string_literal(literal_text);
@@ -43,12 +43,12 @@ pub(crate) fn validate_byte_string_node(node: ast::ByteString, errors: &mut Vec<
43 43
44#[cfg(test)] 44#[cfg(test)]
45mod test { 45mod test {
46 use crate::SourceFileNode; 46 use crate::{SourceFile, TreePtr};
47 47
48 fn build_file(literal: &str) -> SourceFileNode { 48 fn build_file(literal: &str) -> TreePtr<SourceFile> {
49 let src = format!(r#"const S: &'static [u8] = b"{}";"#, literal); 49 let src = format!(r#"const S: &'static [u8] = b"{}";"#, literal);
50 println!("Source: {}", src); 50 println!("Source: {}", src);
51 SourceFileNode::parse(&src) 51 SourceFile::parse(&src)
52 } 52 }
53 53
54 fn assert_valid_str(literal: &str) { 54 fn assert_valid_str(literal: &str) {
diff --git a/crates/ra_syntax/src/validation/char.rs b/crates/ra_syntax/src/validation/char.rs
index 1d6fe8837..9cbd43fba 100644
--- a/crates/ra_syntax/src/validation/char.rs
+++ b/crates/ra_syntax/src/validation/char.rs
@@ -14,7 +14,7 @@ use crate::{
14 }, 14 },
15}; 15};
16 16
17pub(super) fn validate_char_node(node: ast::Char, errors: &mut Vec<SyntaxError>) { 17pub(super) fn validate_char_node(node: &ast::Char, errors: &mut Vec<SyntaxError>) {
18 let literal_text = node.text(); 18 let literal_text = node.text();
19 let literal_range = node.syntax().range(); 19 let literal_range = node.syntax().range();
20 let mut components = string_lexing::parse_char_literal(literal_text); 20 let mut components = string_lexing::parse_char_literal(literal_text);
@@ -175,11 +175,11 @@ fn validate_unicode_escape(text: &str, range: TextRange, errors: &mut Vec<Syntax
175 175
176#[cfg(test)] 176#[cfg(test)]
177mod test { 177mod test {
178 use crate::SourceFileNode; 178 use crate::{SourceFile, TreePtr};
179 179
180 fn build_file(literal: &str) -> SourceFileNode { 180 fn build_file(literal: &str) -> TreePtr<SourceFile> {
181 let src = format!("const C: char = '{}';", literal); 181 let src = format!("const C: char = '{}';", literal);
182 SourceFileNode::parse(&src) 182 SourceFile::parse(&src)
183 } 183 }
184 184
185 fn assert_valid_char(literal: &str) { 185 fn assert_valid_char(literal: &str) {
diff --git a/crates/ra_syntax/src/validation/string.rs b/crates/ra_syntax/src/validation/string.rs
index 1371bb1f0..7b2a68d12 100644
--- a/crates/ra_syntax/src/validation/string.rs
+++ b/crates/ra_syntax/src/validation/string.rs
@@ -9,7 +9,7 @@ use crate::{
9 9
10use super::char; 10use super::char;
11 11
12pub(crate) fn validate_string_node(node: ast::String, errors: &mut Vec<SyntaxError>) { 12pub(crate) fn validate_string_node(node: &ast::String, errors: &mut Vec<SyntaxError>) {
13 let literal_text = node.text(); 13 let literal_text = node.text();
14 let literal_range = node.syntax().range(); 14 let literal_range = node.syntax().range();
15 let mut components = string_lexing::parse_string_literal(literal_text); 15 let mut components = string_lexing::parse_string_literal(literal_text);
@@ -38,12 +38,12 @@ pub(crate) fn validate_string_node(node: ast::String, errors: &mut Vec<SyntaxErr
38 38
39#[cfg(test)] 39#[cfg(test)]
40mod test { 40mod test {
41 use crate::SourceFileNode; 41 use crate::{SourceFile, TreePtr};
42 42
43 fn build_file(literal: &str) -> SourceFileNode { 43 fn build_file(literal: &str) -> TreePtr<SourceFile> {
44 let src = format!(r#"const S: &'static str = "{}";"#, literal); 44 let src = format!(r#"const S: &'static str = "{}";"#, literal);
45 println!("Source: {}", src); 45 println!("Source: {}", src);
46 SourceFileNode::parse(&src) 46 SourceFile::parse(&src)
47 } 47 }
48 48
49 fn assert_valid_str(literal: &str) { 49 fn assert_valid_str(literal: &str) {