From 5dd425a878a375f69ceb02291ba447b3bce19d9d Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Fri, 30 Jul 2021 06:49:15 -0400 Subject: [PATCH] update error message for invalid escape sequences --- src/parse/ident.rs | 2 +- tests/str-escape.rs | 2 +- tests/variables.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parse/ident.rs b/src/parse/ident.rs index d6cb028..3a27ed4 100644 --- a/src/parse/ident.rs +++ b/src/parse/ident.rs @@ -117,7 +117,7 @@ impl<'a, 'b> Parser<'a, 'b> { self.toks.next(); } - let c = std::char::from_u32(value).ok_or(("Invalid escape sequence.", span))?; + let c = std::char::from_u32(value).ok_or(("Invalid Unicode code point.", span))?; if (identifier_start && is_name_start(c) && !c.is_digit(10)) || (!identifier_start && is_name(c)) { diff --git a/tests/str-escape.rs b/tests/str-escape.rs index 966d0d2..537109e 100644 --- a/tests/str-escape.rs +++ b/tests/str-escape.rs @@ -178,7 +178,7 @@ test!( ); error!( escape_sequence_does_not_fit_inside_char, - "a {\n color: \\110000;\n}\n", "Error: Invalid escape sequence." + "a {\n color: \\110000;\n}\n", "Error: Invalid Unicode code point." ); test!( escaped_newline_in_quoted_string, diff --git a/tests/variables.rs b/tests/variables.rs index 97bc66f..fbaf125 100644 --- a/tests/variables.rs +++ b/tests/variables.rs @@ -399,7 +399,7 @@ error!( ); error!( invalid_escape, - "$\\110000: red;", "Error: Invalid escape sequence." + "$\\110000: red;", "Error: Invalid Unicode code point." ); error!( nothing_after_hash_in_variable_decl,