fn args interchangable hyper underscore
This commit is contained in:
parent
539243bb6e
commit
5bbf070b95
@ -172,7 +172,7 @@ pub(crate) fn eat_call_args<I: Iterator<Item = Token>>(
|
|||||||
match tok.kind {
|
match tok.kind {
|
||||||
')' => {
|
')' => {
|
||||||
args.insert(
|
args.insert(
|
||||||
name,
|
name.replace('_', "-"),
|
||||||
Value::from_tokens(&mut val.into_iter().peekable(), scope, super_selector)?,
|
Value::from_tokens(&mut val.into_iter().peekable(), scope, super_selector)?,
|
||||||
);
|
);
|
||||||
return Ok(CallArgs(args));
|
return Ok(CallArgs(args));
|
||||||
@ -191,7 +191,7 @@ pub(crate) fn eat_call_args<I: Iterator<Item = Token>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
args.insert(
|
args.insert(
|
||||||
name,
|
name.replace('_', "-"),
|
||||||
Value::from_tokens(
|
Value::from_tokens(
|
||||||
&mut val.clone().into_iter().peekable(),
|
&mut val.clone().into_iter().peekable(),
|
||||||
scope,
|
scope,
|
||||||
|
@ -189,3 +189,8 @@ test!(
|
|||||||
"@mixin foo {\n color: red\n}\n\na {\n @include foo;\n}\n",
|
"@mixin foo {\n color: red\n}\n\na {\n @include foo;\n}\n",
|
||||||
"a {\n color: red;\n}\n"
|
"a {\n color: red;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
args_interchangable_hypen_underscore,
|
||||||
|
"@mixin foo($a-b) {\n color: $a-b;\n color: $a_b;\n}\na {\n @include foo($a_b: a);\n @include foo($a-b: a);\n}\n",
|
||||||
|
"a {\n color: a;\n color: a;\n color: a;\n color: a;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user