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 {
|
||||
'{' => break,
|
||||
'#' => {
|
||||
if toks.peek().unwrap().kind == '{' {
|
||||
if let Some(Token { kind: '{', .. }) = toks.peek() {
|
||||
toks.next();
|
||||
let interpolation = parse_interpolation(toks, scope, super_selector)?;
|
||||
params.push_str(&interpolation.node.to_css_string(interpolation.span)?);
|
||||
continue;
|
||||
} else {
|
||||
params.push(tok.kind);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
'\n' | ' ' | '\t' => {
|
||||
devour_whitespace(toks);
|
||||
|
@ -15,3 +15,8 @@ test!(
|
||||
"@#{()if(0,0<0,0)}",
|
||||
"@false;\n"
|
||||
);
|
||||
test!(
|
||||
nothing_after_hash,
|
||||
"@foo #",
|
||||
"@foo #;\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user