interchangeable underscore/hyphen in builtin functions

This commit is contained in:
ConnorSkees 2020-04-13 12:57:25 -04:00
parent 409fa3a1dd
commit 7181077163
3 changed files with 6 additions and 6 deletions

View File

@ -451,7 +451,7 @@ impl Value {
span,
}) {
Ok(f) => f,
Err(_) => match GLOBAL_FUNCTIONS.get(&s) {
Err(_) => match GLOBAL_FUNCTIONS.get(&s.replace('_', "-")) {
Some(f) => {
return Ok(IntermediateValue::Value(Spanned {
node: f.0(

View File

@ -517,11 +517,6 @@ test!(
"a {\n color: ie-hex-str(rgba(0, 255, 0, 0.5));\n}\n",
"a {\n color: #8000FF00;\n}\n"
);
// test!(
// builtin_functions_interchangable_underscore_hyphen,
// "a {\n color: ie_hex-str(rgba(0, 255, 0, 0.5));\n}\n",
// "a {\n color: #8000FF00;\n}\n"
// );
test!(
rgba_1_arg,
"a {\n color: rgba(74.7% 173 93%);\n}\n",

View File

@ -111,3 +111,8 @@ test!(
"a {\n color: foo;\n};",
"a {\n color: foo;\n}\n"
);
test!(
builtin_functions_interchangeable_underscore_hyphen,
"a {\n color: ie_hex-str(rgba(0, 255, 0, 0.5));\n}\n",
"a {\n color: #8000FF00;\n}\n"
);