diff --git a/src/parse/args.rs b/src/parse/args.rs index e2422c6..fdc4a8e 100644 --- a/src/parse/args.rs +++ b/src/parse/args.rs @@ -281,6 +281,7 @@ impl<'a> Parser<'a> { pub fn variadic_args(&mut self, args: CallArgs) -> SassResult>> { let mut vals = Vec::new(); + let span = args.span(); let mut args = match args .0 .into_iter() @@ -292,7 +293,7 @@ impl<'a> Parser<'a> { }; args.sort_by(|(a1, _), (a2, _)| a1.cmp(a2)); for arg in args { - vals.push(self.parse_value_from_vec(arg.1)?); + vals.push(self.parse_value_from_vec(arg.1)?.node.eval(span)?); } Ok(vals) } diff --git a/tests/min-max.rs b/tests/min-max.rs index 3f77fcc..f887e6f 100644 --- a/tests/min-max.rs +++ b/tests/min-max.rs @@ -87,6 +87,11 @@ test!( "$a: 1px;\n$b: 2px;\na {\n color: max($a, $b);\n}\n", "a {\n color: 2px;\n}\n" ); +test!( + max_evaluated_binop, + "a {\n color: max(100% - lightness(red) - 2%);\n}\n", + "a {\n color: 52%;\n}\n" +); error!( max_arg_of_incorrect_type, "$a: 1px;\n$b: 2px;\na {\n color: max($a, $b, foo);\n}\n", "Error: foo is not a number."