From 3b42ddae601fbd73f672e82028e04c3abdf1252d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Ochagav=C3=ADa?= Date: Sun, 4 Nov 2018 16:45:22 +0100 Subject: Introduce SyntaxErrorKind and TextRange in SyntaxError --- crates/ra_syntax/src/string_lexing/mod.rs | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'crates/ra_syntax/src/string_lexing') diff --git a/crates/ra_syntax/src/string_lexing/mod.rs b/crates/ra_syntax/src/string_lexing/mod.rs index 6b52c62c3..f0812ff28 100644 --- a/crates/ra_syntax/src/string_lexing/mod.rs +++ b/crates/ra_syntax/src/string_lexing/mod.rs @@ -100,10 +100,6 @@ impl<'a> Parser<'a> { // Char parsing methods fn parse_unicode_escape(&mut self, start: TextUnit) -> CharComponent { - // Note: validation of UnicodeEscape will be done elsewhere: - // * Only hex digits or underscores allowed - // * Max 6 chars - // * Within allowed range (must be at most 10FFFF) match self.peek() { Some('{') => { self.advance(); @@ -127,9 +123,6 @@ impl<'a> Parser<'a> { } fn parse_ascii_code_escape(&mut self, start: TextUnit) -> CharComponent { - // Note: validation of AsciiCodeEscape will be done elsewhere: - // * First digit is octal - // * Second digit is hex let code_start = self.get_pos(); while let Some(next) = self.peek() { if next == '\'' || (self.get_pos() - code_start == 2.into()) { @@ -144,9 +137,6 @@ impl<'a> Parser<'a> { } fn parse_escape(&mut self, start: TextUnit) -> CharComponent { - // Note: validation of AsciiEscape will be done elsewhere: - // * The escape sequence is non-empty - // * The escape sequence is valid if self.peek().is_none() { return CharComponent::new(TextRange::from_to(start, start), AsciiEscape); } -- cgit v1.2.3