handle edge case in parsing of units ending with hypen followed by whitespace

This commit is contained in:
ConnorSkees 2020-04-25 20:19:50 -04:00
parent 637dc39544
commit a8141d2488
2 changed files with 6 additions and 1 deletions

View File

@ -32,9 +32,9 @@ fn ident_body_no_interpolation<I: Iterator<Item = Token>>(
if second.kind == '.' || second.kind.is_ascii_digit() { if second.kind == '.' || second.kind.is_ascii_digit() {
break; break;
} }
toks.next(); toks.next();
text.push('-'); text.push('-');
text.push(toks.next().unwrap().kind);
} else if is_name(tok.kind) { } else if is_name(tok.kind) {
text.push(toks.next().unwrap().kind); text.push(toks.next().unwrap().kind);
} else if tok.kind == '\\' { } else if tok.kind == '\\' {

View File

@ -209,3 +209,8 @@ test!(
"a {\n color: 1/**/-/**/1;\n}\n", "a {\n color: 1/**/-/**/1;\n}\n",
"a {\n color: 0;\n}\n" "a {\n color: 0;\n}\n"
); );
test!(
no_space_after_first_unit_and_second_float,
"a {\n color: 1em- 0.0em;\n}\n",
"a {\n color: 1em- 0em;\n}\n"
);