Replace old transform code with new generic code

This commit is contained in:
Manish Goregaokar 2017-10-04 10:12:18 -07:00
parent 5ce2966bda
commit 6631594e28
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
10 changed files with 210 additions and 1268 deletions

View file

@ -46,6 +46,7 @@ impl Transform {
Ok(GenericTransform(Space::parse(input, |input| {
let function = input.expect_function()?.clone();
input.parse_nested_block(|input| {
let location = input.current_source_location();
let result = match_ignore_ascii_case! { &function,
"matrix" => {
let a = specified::parse_number(context, input)?;
@ -236,7 +237,7 @@ impl Transform {
_ => Err(()),
};
result
.map_err(|()| StyleParseError::UnexpectedFunction(function.clone()).into())
.map_err(|()| location.new_custom_error(StyleParseErrorKind::UnexpectedFunction(function.clone())))
})
})?))
}