mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Fix indentation in calc parsing code.
This commit is contained in:
parent
c11d398010
commit
dae17dcaf3
1 changed files with 19 additions and 23 deletions
|
@ -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 })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue