style: Fix indentation in calc parsing code.

This commit is contained in:
Emilio Cobos Álvarez 2017-03-08 16:54:10 +01:00
parent c11d398010
commit dae17dcaf3
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -585,33 +585,29 @@ impl CalcLengthOrPercentage {
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit))); products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
loop { loop {
let position = input.position(); let position = input.position();
match input.next_including_whitespace() { match input.next_including_whitespace() {
Ok(Token::WhiteSpace(_)) => { Ok(Token::WhiteSpace(_)) => {
match input.next() { match input.next() {
Ok(Token::Delim('+')) => { Ok(Token::Delim('+')) => {
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit))); products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
}
Ok(Token::Delim('-')) => {
let mut right = try!(CalcLengthOrPercentage::parse_product(input, expected_unit));
right.values.push(CalcValueNode::Number(-1.));
products.push(right);
}
_ => {
return Err(());
}
}
} }
Ok(Token::Delim('-')) => {
let mut right = try!(CalcLengthOrPercentage::parse_product(input, expected_unit));
right.values.push(CalcValueNode::Number(-1.));
products.push(right);
}
_ => { _ => {
return Err(()); input.reset(position);
break
} }
}
} }
_ => { }
input.reset(position);
break
}
}
}
Ok(CalcSumNode { products: products }) Ok(CalcSumNode { products: products })
} }