diff options
Diffstat (limited to 'crates/ra_syntax/src/validation/byte.rs')
-rw-r--r-- | crates/ra_syntax/src/validation/byte.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/validation/byte.rs b/crates/ra_syntax/src/validation/byte.rs index 714224b09..9ab4b18a3 100644 --- a/crates/ra_syntax/src/validation/byte.rs +++ b/crates/ra_syntax/src/validation/byte.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! Validation of byte literals | 1 | //! Validation of byte literals |
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | ast::{self, AstNode}, | 4 | ast::{self, AstNode, AstToken}, |
5 | string_lexing::{self, StringComponentKind}, | 5 | string_lexing::{self, StringComponentKind}, |
6 | TextRange, | 6 | TextRange, |
7 | validation::char, | 7 | validation::char, |
@@ -11,7 +11,7 @@ use crate::{ | |||
11 | }, | 11 | }, |
12 | }; | 12 | }; |
13 | 13 | ||
14 | pub(super) fn validate_byte_node(node: ast::Byte, errors: &mut Vec<SyntaxError>) { | 14 | pub(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)] |
108 | mod test { | 108 | mod 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) { |