diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 541fc7b..0e3bd87 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -10,7 +10,6 @@ use crate::{ media::MediaRule, AtRuleKind, Content, SupportsRule, UnknownAtRule, }, - common::{Brackets, ListSeparator}, error::SassResult, scope::Scope, selector::{ @@ -914,28 +913,17 @@ impl<'a> Parser<'a> { let mut stmts = Vec::new(); for row in iter { - let this_iterator = row.clone().as_list(); if vars.len() == 1 { - if this_iterator.len() == 1 { - self.scopes.last_mut().insert_var( - &vars[0].node, - Spanned { - node: row, - span: vars[0].span, - }, - ); - } else { - self.scopes.last_mut().insert_var( - &vars[0].node, - Spanned { - node: Value::List(this_iterator, ListSeparator::Space, Brackets::None), - span: vars[0].span, - }, - ); - } + self.scopes.last_mut().insert_var( + &vars[0].node, + Spanned { + node: row, + span: vars[0].span, + }, + ); } else { for (var, val) in vars.iter().zip( - this_iterator + row.as_list() .into_iter() .chain(std::iter::once(Value::Null).cycle()), ) { diff --git a/tests/each.rs b/tests/each.rs index 51511dd..aede71d 100644 --- a/tests/each.rs +++ b/tests/each.rs @@ -48,6 +48,19 @@ test!( "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" ); +test!( + list_of_single_map_with_multiple_elements, + "a { + $settings: (); + + @each $config in [(a: b, c: d)] { + $settings: map-merge($settings, $config); + } + + color: inspect($settings); + }", + "a {\n color: (a: b, c: d);\n}\n" +); error!( list_of_single_map, "a {