This commit is contained in:
ConnorSkees 2020-02-16 17:49:34 -05:00
parent 3e89a0a057
commit f57da880b6
3 changed files with 4 additions and 10 deletions

View File

@ -2,8 +2,8 @@ use std::collections::BTreeMap;
use super::Builtin; use super::Builtin;
use crate::common::QuoteKind; use crate::common::QuoteKind;
use crate::value::Number;
use crate::units::Unit; use crate::units::Unit;
use crate::value::Number;
use crate::value::Value; use crate::value::Value;
pub(crate) fn register(f: &mut BTreeMap<String, Builtin>) { pub(crate) fn register(f: &mut BTreeMap<String, Builtin>) {

View File

@ -428,7 +428,7 @@ impl<'a> StyleSheetParser<'a> {
AtRule::Error(pos, message) => self.error(pos, &message), AtRule::Error(pos, message) => self.error(pos, &message),
AtRule::Warn(pos, message) => self.warn(pos, &message), AtRule::Warn(pos, message) => self.warn(pos, &message),
AtRule::Debug(pos, message) => self.debug(pos, &message), AtRule::Debug(pos, message) => self.debug(pos, &message),
AtRule::Return(_) => todo!("@return in unexpected location!"), AtRule::Return(_) => return Err("This at-rule is not allowed here.".into()),
} }
} }
} }

View File

@ -258,10 +258,7 @@ test!(
"a {\n color: invert(white);\n}\n", "a {\n color: invert(white);\n}\n",
"a {\n color: black;\n}\n" "a {\n color: black;\n}\n"
); );
test!( test!(invert_number, "a {\n color: invert(10%);\n}\n");
invert_number,
"a {\n color: invert(10%);\n}\n"
);
// test!( // test!(
// invert_number_casing, // invert_number_casing,
// "a {\n color: iNveRt(10%);\n}\n" // "a {\n color: iNveRt(10%);\n}\n"
@ -404,10 +401,7 @@ test!(
"a {\n color: grayscale(red);\n}\n", "a {\n color: grayscale(red);\n}\n",
"a {\n color: gray;\n}\n" "a {\n color: gray;\n}\n"
); );
test!( test!(grayscale_number, "a {\n color: grayscale(15%);\n}\n");
grayscale_number,
"a {\n color: grayscale(15%);\n}\n"
);
// test!( // test!(
// grayscale_number_casing, // grayscale_number_casing,
// "a {\n color: grAyscaLe(15%);\n}\n" // "a {\n color: grAyscaLe(15%);\n}\n"