diff --git a/src/builtin/list.rs b/src/builtin/list.rs index 745bcd1..1333279 100644 --- a/src/builtin/list.rs +++ b/src/builtin/list.rs @@ -25,7 +25,7 @@ pub(crate) fn register(f: &mut HashMap) { max_args!(args, 2); let list = match arg!(args, 0, "list") { Value::List(v, _) => v, - _ => return Err("Missing argument $list.".into()), + v => vec![v], }; let n = match arg!(args, 1, "n") { Value::Dimension(num, _) => num, diff --git a/tests/list.rs b/tests/list.rs index f31fd91..d481b77 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -33,6 +33,11 @@ test!( "a {\n color: nth((a, b, c), 3);\n}\n", "a {\n color: c;\n}\n" ); +test!( + nth_non_list, + "a {\n color: nth(foo, 1);\n}\n", + "a {\n color: foo;\n}\n" +); test!( list_separator_space_separated, "a {\n color: list-separator(a b c);\n}\n",