diff --git a/src/builtin/meta.rs b/src/builtin/meta.rs index 4e46c55..29ec13b 100644 --- a/src/builtin/meta.rs +++ b/src/builtin/meta.rs @@ -143,9 +143,13 @@ pub(crate) fn register(f: &mut HashMap) { v => return Err(format!("$name: {} is not a string.", v).into()), }; let css = arg!(args, 1, "css" = Value::False).is_true()?; - let module = arg!(args, 2, "module" = Value::Null); + let module = match arg!(args, 2, "module" = Value::Null) { + Value::Ident(s, ..) => Some(s), + Value::Null => None, + v => return Err(format!("$module: {} is not a string.", v).into()) + }; - if !module.is_null() && css { + if module.is_some() && css { return Err("$css and $module may not both be passed at once.".into()); } diff --git a/src/value/mod.rs b/src/value/mod.rs index 1cfb189..4b5659d 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -55,7 +55,7 @@ impl Display for Value { .collect::>() .join(", ") ), - Self::Function(..) => todo!("invalid CSS"), + Self::Function(func) => write!(f, "get-function(\"{}\")", func.name()), Self::List(vals, sep, brackets) => match brackets { Brackets::None => write!( f,