properly handle escaped newlines in quoted strings
This commit is contained in:
parent
09e6568c39
commit
2db3398fe2
@ -302,7 +302,8 @@ pub(crate) fn parse_quoted_string<I: Iterator<Item = Token>>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if first.kind == '\n' {
|
if first.kind == '\n' {
|
||||||
return Err(("Expected escape sequence.", first.pos()).into());
|
toks.next();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if first.kind.is_ascii_hexdigit() {
|
if first.kind.is_ascii_hexdigit() {
|
||||||
|
@ -172,3 +172,8 @@ 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 escape sequence."
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
escaped_newline_in_quoted_string,
|
||||||
|
"a {\n color: \"foo\\\nbar\";\n}\n",
|
||||||
|
"a {\n color: \"foobar\";\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user