remove unwrap in unknown at rule parsing
This commit is contained in:
parent
3051cec45a
commit
c9e5bc89c4
@ -41,14 +41,14 @@ impl UnknownAtRule {
|
|||||||
match tok.kind {
|
match tok.kind {
|
||||||
'{' => break,
|
'{' => break,
|
||||||
'#' => {
|
'#' => {
|
||||||
if toks.peek().unwrap().kind == '{' {
|
if let Some(Token { kind: '{', .. }) = toks.peek() {
|
||||||
toks.next();
|
toks.next();
|
||||||
let interpolation = parse_interpolation(toks, scope, super_selector)?;
|
let interpolation = parse_interpolation(toks, scope, super_selector)?;
|
||||||
params.push_str(&interpolation.node.to_css_string(interpolation.span)?);
|
params.push_str(&interpolation.node.to_css_string(interpolation.span)?);
|
||||||
continue;
|
|
||||||
} else {
|
} else {
|
||||||
params.push(tok.kind);
|
params.push(tok.kind);
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
'\n' | ' ' | '\t' => {
|
'\n' | ' ' | '\t' => {
|
||||||
devour_whitespace(toks);
|
devour_whitespace(toks);
|
||||||
|
@ -15,3 +15,8 @@ test!(
|
|||||||
"@#{()if(0,0<0,0)}",
|
"@#{()if(0,0<0,0)}",
|
||||||
"@false;\n"
|
"@false;\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
nothing_after_hash,
|
||||||
|
"@foo #",
|
||||||
|
"@foo #;\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user