tabs are not emitted literally
This commit is contained in:
parent
f4f4fe2e03
commit
d53b44aafe
@ -140,13 +140,6 @@ pub(crate) fn peek_escape<I: Iterator<Item = Token>>(
|
||||
value = toks.peek_forward(1).unwrap().kind as u32;
|
||||
}
|
||||
|
||||
// tabs are emitted literally
|
||||
// TODO: figure out where this check is done
|
||||
// in the source dart
|
||||
if value == 0x9 {
|
||||
return Ok("\\\t".to_string());
|
||||
}
|
||||
|
||||
let c = std::char::from_u32(value).unwrap();
|
||||
if is_name(c) {
|
||||
Ok(c.to_string())
|
||||
|
@ -143,13 +143,6 @@ fn escape<I: Iterator<Item = Token>>(
|
||||
value = toks.next().unwrap().kind as u32;
|
||||
}
|
||||
|
||||
// tabs are emitted literally
|
||||
// TODO: figure out where this check is done
|
||||
// in the source dart
|
||||
if value == 0x9 {
|
||||
return Ok("\\\t".to_string());
|
||||
}
|
||||
|
||||
let c = std::char::from_u32(value).unwrap();
|
||||
if (identifier_start && is_name_start(c) && !c.is_digit(10))
|
||||
|| (!identifier_start && is_name(c))
|
||||
|
@ -51,7 +51,7 @@ test!(
|
||||
test!(
|
||||
escape_tabs,
|
||||
"a {\n color: \\ x \\9x;\n}\n",
|
||||
"a {\n color: \\\tx \\\tx;\n}\n"
|
||||
"a {\n color: \\9 x \\9 x;\n}\n"
|
||||
);
|
||||
test!(
|
||||
escape_interpolation_start,
|
||||
@ -158,3 +158,13 @@ test!(
|
||||
unquoted_escape_minus_unquoted,
|
||||
"a {\n color: \\a - foo;\n}\n"
|
||||
);
|
||||
test!(
|
||||
quoted_escaped_tab,
|
||||
"a {\n color: \"\\9\";\n}\n",
|
||||
"a {\n color: \"\t\";\n}\n"
|
||||
);
|
||||
test!(
|
||||
unquoted_escaped_tab,
|
||||
"a {\n color: \\9;\n}\n",
|
||||
"a {\n color: \\9 ;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user