proper type for @each when single variable
This commit is contained in:
parent
f1b60019a1
commit
ce833b7c03
@ -39,6 +39,15 @@ impl Each {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if self.vars.len() == 1 {
|
if self.vars.len() == 1 {
|
||||||
|
if this_iterator.len() == 1 {
|
||||||
|
scope.insert_var(
|
||||||
|
&self.vars[0],
|
||||||
|
Spanned {
|
||||||
|
node: this_iterator[0].clone(),
|
||||||
|
span: self.vars[0].span,
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
} else {
|
||||||
scope.insert_var(
|
scope.insert_var(
|
||||||
&self.vars[0],
|
&self.vars[0],
|
||||||
Spanned {
|
Spanned {
|
||||||
@ -46,6 +55,7 @@ impl Each {
|
|||||||
span: self.vars[0].span,
|
span: self.vars[0].span,
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (var, val) in self.vars.clone().into_iter().zip(
|
for (var, val) in self.vars.clone().into_iter().zip(
|
||||||
this_iterator
|
this_iterator
|
||||||
|
@ -43,3 +43,8 @@ test!(
|
|||||||
"a {\n @each $i in (1 2 3) {\n color: $i;\n }\n}\n",
|
"a {\n @each $i in (1 2 3) {\n color: $i;\n }\n}\n",
|
||||||
"a {\n color: 1;\n color: 2;\n color: 3;\n}\n"
|
"a {\n color: 1;\n color: 2;\n color: 3;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
type_of_each_space_separated_single_var,
|
||||||
|
"a {\n @each $i in 1 2 3 {\n color: type-of($i);\n }\n}\n",
|
||||||
|
"a {\n color: number;\n color: number;\n color: number;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user