update error message for invalid escape sequences
This commit is contained in:
parent
ebccebfed1
commit
5dd425a878
@ -117,7 +117,7 @@ impl<'a, 'b> Parser<'a, 'b> {
|
|||||||
self.toks.next();
|
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))
|
if (identifier_start && is_name_start(c) && !c.is_digit(10))
|
||||||
|| (!identifier_start && is_name(c))
|
|| (!identifier_start && is_name(c))
|
||||||
{
|
{
|
||||||
|
@ -178,7 +178,7 @@ test!(
|
|||||||
);
|
);
|
||||||
error!(
|
error!(
|
||||||
escape_sequence_does_not_fit_inside_char,
|
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!(
|
test!(
|
||||||
escaped_newline_in_quoted_string,
|
escaped_newline_in_quoted_string,
|
||||||
|
@ -399,7 +399,7 @@ error!(
|
|||||||
);
|
);
|
||||||
error!(
|
error!(
|
||||||
invalid_escape,
|
invalid_escape,
|
||||||
"$\\110000: red;", "Error: Invalid escape sequence."
|
"$\\110000: red;", "Error: Invalid Unicode code point."
|
||||||
);
|
);
|
||||||
error!(
|
error!(
|
||||||
nothing_after_hash_in_variable_decl,
|
nothing_after_hash_in_variable_decl,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user