allow at-rules other than else to follow @ if
This commit is contained in:
parent
aaf37bf4c4
commit
4ca6e304a5
@ -50,6 +50,11 @@ impl If {
|
|||||||
loop {
|
loop {
|
||||||
if toks.peek().is_some() {
|
if toks.peek().is_some() {
|
||||||
if toks.peek().unwrap().kind == '@' {
|
if toks.peek().unwrap().kind == '@' {
|
||||||
|
let first_char = toks.peek_forward(1).unwrap().kind;
|
||||||
|
toks.peek_backward(1).unwrap();
|
||||||
|
if first_char != 'e' && first_char != 'E' {
|
||||||
|
break;
|
||||||
|
}
|
||||||
toks.next();
|
toks.next();
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
@ -67,3 +67,8 @@ test!(
|
|||||||
"a {\n @if true {\n color: red\n }\n}\n",
|
"a {\n @if true {\n color: red\n }\n}\n",
|
||||||
"a {\n color: red;\n}\n"
|
"a {\n color: red;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
atrule_other_than_else_immediately_following,
|
||||||
|
"a {\n @if true {\n b {\n background: gray;\n }\n }\n\n @if true {\n b {\n background: gray;\n }\n }\n}\n",
|
||||||
|
"a b {\n background: gray;\n}\na b {\n background: gray;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user