diff --git a/src/parse/mixin.rs b/src/parse/mixin.rs index 56370e7..b6ebf40 100644 --- a/src/parse/mixin.rs +++ b/src/parse/mixin.rs @@ -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(), diff --git a/tests/mixins.rs b/tests/mixins.rs index a148948..5cb1fe9 100644 --- a/tests/mixins.rs +++ b/tests/mixins.rs @@ -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() {