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/char.rs | |
parent | dbf03b674e7e1a49d9b32ec5ed656df2aedd3ed3 (diff) |
dedupe literal parsers
Diffstat (limited to 'crates/ra_syntax/src/validation/char.rs')
-rw-r--r-- | crates/ra_syntax/src/validation/char.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/validation/char.rs b/crates/ra_syntax/src/validation/char.rs index 4728c85e6..deb5b0a9e 100644 --- a/crates/ra_syntax/src/validation/char.rs +++ b/crates/ra_syntax/src/validation/char.rs | |||
@@ -6,7 +6,7 @@ use arrayvec::ArrayString; | |||
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | ast::{self, AstNode}, | 8 | ast::{self, AstNode}, |
9 | string_lexing::{self, CharComponentKind}, | 9 | string_lexing::{self, StringComponentKind}, |
10 | TextRange, | 10 | TextRange, |
11 | yellow::{ | 11 | yellow::{ |
12 | SyntaxError, | 12 | SyntaxError, |
@@ -41,12 +41,12 @@ pub(super) fn validate_char_node(node: ast::Char, errors: &mut Vec<SyntaxError>) | |||
41 | 41 | ||
42 | pub(super) fn validate_char_component( | 42 | pub(super) fn validate_char_component( |
43 | text: &str, | 43 | text: &str, |
44 | kind: CharComponentKind, | 44 | kind: StringComponentKind, |
45 | range: TextRange, | 45 | range: TextRange, |
46 | errors: &mut Vec<SyntaxError>, | 46 | errors: &mut Vec<SyntaxError>, |
47 | ) { | 47 | ) { |
48 | // Validate escapes | 48 | // Validate escapes |
49 | use self::CharComponentKind::*; | 49 | use self::StringComponentKind::*; |
50 | match kind { | 50 | match kind { |
51 | AsciiEscape => validate_ascii_escape(text, range, errors), | 51 | AsciiEscape => validate_ascii_escape(text, range, errors), |
52 | AsciiCodeEscape => validate_ascii_code_escape(text, range, errors), | 52 | AsciiCodeEscape => validate_ascii_code_escape(text, range, errors), |
@@ -57,6 +57,7 @@ pub(super) fn validate_char_component( | |||
57 | errors.push(SyntaxError::new(UnescapedCodepoint, range)); | 57 | errors.push(SyntaxError::new(UnescapedCodepoint, range)); |
58 | } | 58 | } |
59 | } | 59 | } |
60 | StringComponentKind::IgnoreNewline => { /* always valid */ } | ||
60 | } | 61 | } |
61 | } | 62 | } |
62 | 63 | ||