From d91a98ec843ec8562c58ccb01a1e29d00cc744dc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 7 Jan 2019 16:15:47 +0300 Subject: switch ra_syntax to new rowan API --- crates/ra_syntax/src/validation/byte.rs | 8 ++++---- crates/ra_syntax/src/validation/byte_string.rs | 8 ++++---- crates/ra_syntax/src/validation/char.rs | 8 ++++---- crates/ra_syntax/src/validation/string.rs | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'crates/ra_syntax/src/validation') 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::{ }, }; -pub(super) fn validate_byte_node(node: ast::Byte, errors: &mut Vec) { +pub(super) fn validate_byte_node(node: &ast::Byte, errors: &mut Vec) { let literal_text = node.text(); let literal_range = node.syntax().range(); 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 SourceFileNode { + fn build_file(literal: &str) -> TreePtr { let src = format!("const C: u8 = b'{}';", literal); - SourceFileNode::parse(&src) + SourceFile::parse(&src) } 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::{ use super::byte; -pub(crate) fn validate_byte_string_node(node: ast::ByteString, errors: &mut Vec) { +pub(crate) fn validate_byte_string_node(node: &ast::ByteString, errors: &mut Vec) { let literal_text = node.text(); let literal_range = node.syntax().range(); 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< #[cfg(test)] mod test { - use crate::SourceFileNode; + use crate::{SourceFile, TreePtr}; - fn build_file(literal: &str) -> SourceFileNode { + fn build_file(literal: &str) -> TreePtr { let src = format!(r#"const S: &'static [u8] = b"{}";"#, literal); println!("Source: {}", src); - SourceFileNode::parse(&src) + SourceFile::parse(&src) } 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::{ }, }; -pub(super) fn validate_char_node(node: ast::Char, errors: &mut Vec) { +pub(super) fn validate_char_node(node: &ast::Char, errors: &mut Vec) { let literal_text = node.text(); let literal_range = node.syntax().range(); 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 SourceFileNode { + fn build_file(literal: &str) -> TreePtr { let src = format!("const C: char = '{}';", literal); - SourceFileNode::parse(&src) + SourceFile::parse(&src) } 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::{ use super::char; -pub(crate) fn validate_string_node(node: ast::String, errors: &mut Vec) { +pub(crate) fn validate_string_node(node: &ast::String, errors: &mut Vec) { let literal_text = node.text(); let literal_range = node.syntax().range(); 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 SourceFileNode { + fn build_file(literal: &str) -> TreePtr { let src = format!(r#"const S: &'static str = "{}";"#, literal); println!("Source: {}", src); - SourceFileNode::parse(&src) + SourceFile::parse(&src) } fn assert_valid_str(literal: &str) { -- cgit v1.2.3