@content
may have call args even when it has no parens
This commit is contained in:
parent
5bcf499942
commit
a0786619de
@ -213,18 +213,20 @@ impl<'a> Parser<'a> {
|
||||
|
||||
let mut entered_scope = false;
|
||||
|
||||
if let Some(Token { kind: '(', .. }) = self.toks.peek() {
|
||||
self.toks.next();
|
||||
let args = self.parse_call_args()?;
|
||||
if let Some(ref content_args) = content.content_args {
|
||||
args.max_args(content_args.len())?;
|
||||
let call_args = if self.consume_char_if_exists('(') {
|
||||
self.parse_call_args()?
|
||||
} else {
|
||||
CallArgs::new(self.span_before)
|
||||
};
|
||||
|
||||
let scope = self.eval_args(content_args.clone(), args)?;
|
||||
if let Some(ref content_args) = content.content_args {
|
||||
call_args.max_args(content_args.len())?;
|
||||
|
||||
let scope = self.eval_args(content_args.clone(), call_args)?;
|
||||
scope_at_decl.enter_scope(scope);
|
||||
entered_scope = true;
|
||||
} else {
|
||||
args.max_args(0)?;
|
||||
}
|
||||
call_args.max_args(0)?;
|
||||
}
|
||||
|
||||
let stmts = if let Some(body) = content.content.clone() {
|
||||
|
@ -525,6 +525,19 @@ test!(
|
||||
}",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
content_default_arg_value_no_parens,
|
||||
"a {
|
||||
@mixin foo {
|
||||
@content;
|
||||
}
|
||||
|
||||
@include foo using ($a: red) {
|
||||
color: $a;
|
||||
}
|
||||
}",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
error!(
|
||||
mixin_in_function,
|
||||
"@function foo() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user