allow whitespace between mixin name and args

This commit is contained in:
Connor Skees 2020-08-21 19:36:11 -04:00
parent feb75800c8
commit c44f20d377
2 changed files with 13 additions and 1 deletions

View File

@ -32,7 +32,8 @@ impl<'a> Parser<'a> {
return Err(("Mixins may not be declared in control directives.", span).into());
}
self.whitespace();
self.whitespace_or_comment();
let args = match self.toks.next() {
Some(Token { kind: '(', .. }) => self.parse_func_args()?,
Some(Token { kind: '{', .. }) => FuncArgs::new(),

View File

@ -552,6 +552,17 @@ test!(
}",
"space-after-content {\n arg1: value1;\n arg2: value2;\n}\n"
);
test!(
space_between_mixin_and_args,
"@mixin foo /**/ () /**/ {
color: red;
}
a {
@include foo;
}",
"a {\n color: red;\n}\n"
);
error!(
mixin_in_function,
"@function foo() {