diff options
author | Aleksey Kladov <[email protected]> | 2018-12-27 11:42:46 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-27 11:42:46 +0000 |
commit | 73ded3c63ca2522b7bb6ca8eb7834c5adc1a3511 (patch) | |
tree | 521f3b0fa02e32b0b2a6e9a9d1370845d922657f /crates/ra_syntax/src/validation/byte.rs | |
parent | dbf03b674e7e1a49d9b32ec5ed656df2aedd3ed3 (diff) |
dedupe literal parsers
Diffstat (limited to 'crates/ra_syntax/src/validation/byte.rs')
-rw-r--r-- | crates/ra_syntax/src/validation/byte.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/validation/byte.rs b/crates/ra_syntax/src/validation/byte.rs index 43c0d7edd..e3603e761 100644 --- a/crates/ra_syntax/src/validation/byte.rs +++ b/crates/ra_syntax/src/validation/byte.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | ast::{self, AstNode}, | 4 | ast::{self, AstNode}, |
5 | string_lexing::{self, CharComponentKind}, | 5 | string_lexing::{self, StringComponentKind}, |
6 | TextRange, | 6 | TextRange, |
7 | validation::char, | 7 | validation::char, |
8 | yellow::{ | 8 | yellow::{ |
@@ -38,11 +38,11 @@ pub(super) fn validate_byte_node(node: ast::Byte, errors: &mut Vec<SyntaxError>) | |||
38 | 38 | ||
39 | pub(super) fn validate_byte_component( | 39 | pub(super) fn validate_byte_component( |
40 | text: &str, | 40 | text: &str, |
41 | kind: CharComponentKind, | 41 | kind: StringComponentKind, |
42 | range: TextRange, | 42 | range: TextRange, |
43 | errors: &mut Vec<SyntaxError>, | 43 | errors: &mut Vec<SyntaxError>, |
44 | ) { | 44 | ) { |
45 | use self::CharComponentKind::*; | 45 | use self::StringComponentKind::*; |
46 | match kind { | 46 | match kind { |
47 | AsciiEscape => validate_byte_escape(text, range, errors), | 47 | AsciiEscape => validate_byte_escape(text, range, errors), |
48 | AsciiCodeEscape => validate_byte_code_escape(text, range, errors), | 48 | AsciiCodeEscape => validate_byte_code_escape(text, range, errors), |
@@ -63,6 +63,7 @@ pub(super) fn validate_byte_component( | |||
63 | errors.push(SyntaxError::new(ByteOutOfRange, range)); | 63 | errors.push(SyntaxError::new(ByteOutOfRange, range)); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | IgnoreNewline => { /* always valid */ } | ||
66 | } | 67 | } |
67 | } | 68 | } |
68 | 69 | ||