fn args interchangable hyper underscore

This commit is contained in:
ConnorSkees 2020-03-31 01:15:21 -04:00
parent 539243bb6e
commit 5bbf070b95
2 changed files with 7 additions and 2 deletions

View File

@ -172,7 +172,7 @@ pub(crate) fn eat_call_args<I: Iterator<Item = Token>>(
match tok.kind {
')' => {
args.insert(
name,
name.replace('_', "-"),
Value::from_tokens(&mut val.into_iter().peekable(), scope, super_selector)?,
);
return Ok(CallArgs(args));
@ -191,7 +191,7 @@ pub(crate) fn eat_call_args<I: Iterator<Item = Token>>(
}
args.insert(
name,
name.replace('_', "-"),
Value::from_tokens(
&mut val.clone().into_iter().peekable(),
scope,

View File

@ -189,3 +189,8 @@ test!(
"@mixin foo {\n color: red\n}\n\na {\n @include foo;\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"
);