mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
mach fmt
Signed-off-by: Ville Lindholm <ville@lindholm.dev>
This commit is contained in:
parent
fb971b217c
commit
9098bf4d7e
2 changed files with 28 additions and 22 deletions
|
@ -440,11 +440,7 @@ impl Evaluatable for StepExpr {
|
|||
|
||||
trace!("[StepExpr] Filtering got nodes {:?}", filtered_nodes);
|
||||
|
||||
if axis_step
|
||||
.predicates
|
||||
.predicates
|
||||
.is_empty()
|
||||
{
|
||||
if axis_step.predicates.predicates.is_empty() {
|
||||
trace!(
|
||||
"[StepExpr] No predicates, returning nodes {:?}",
|
||||
filtered_nodes
|
||||
|
@ -567,10 +563,7 @@ impl Evaluatable for FilterExpr {
|
|||
}
|
||||
|
||||
fn is_primitive(&self) -> bool {
|
||||
self.predicates
|
||||
.predicates
|
||||
.is_empty() &&
|
||||
self.primary.is_primitive()
|
||||
self.predicates.predicates.is_empty() && self.primary.is_primitive()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -700,10 +700,7 @@ fn filter_expr(input: &str) -> IResult<&str, FilterExpr> {
|
|||
fn predicate_list(input: &str) -> IResult<&str, PredicateListExpr> {
|
||||
let (input, predicates) = many0(predicate)(input)?;
|
||||
|
||||
Ok((
|
||||
input,
|
||||
PredicateListExpr { predicates },
|
||||
))
|
||||
Ok((input, PredicateListExpr { predicates }))
|
||||
}
|
||||
|
||||
fn predicate(input: &str) -> IResult<&str, PredicateExpr> {
|
||||
|
@ -1106,7 +1103,7 @@ mod tests {
|
|||
local_part: "class".to_string(),
|
||||
}),
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![]
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
|
@ -1117,7 +1114,9 @@ mod tests {
|
|||
primary: PrimaryExpr::Literal(Literal::String(
|
||||
"test".to_string(),
|
||||
)),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
)),
|
||||
|
@ -1151,7 +1150,9 @@ mod tests {
|
|||
primary: PrimaryExpr::Function(
|
||||
CoreFunction::Position,
|
||||
),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
RelationalOp::Gt,
|
||||
|
@ -1162,7 +1163,9 @@ mod tests {
|
|||
primary: PrimaryExpr::Literal(Literal::Numeric(
|
||||
NumericLiteral::Integer(1),
|
||||
)),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
),
|
||||
|
@ -1212,7 +1215,9 @@ mod tests {
|
|||
prefix: Some("xml".to_string()),
|
||||
local_part: "id".to_string(),
|
||||
}),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
EqualityOp::Eq,
|
||||
|
@ -1223,7 +1228,9 @@ mod tests {
|
|||
primary: PrimaryExpr::Literal(Literal::String(
|
||||
"id1".to_string(),
|
||||
)),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
),
|
||||
|
@ -1253,7 +1260,9 @@ mod tests {
|
|||
prefix: None,
|
||||
local_part: "title".to_string(),
|
||||
}),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
}),
|
||||
},
|
||||
|
@ -1268,7 +1277,9 @@ mod tests {
|
|||
prefix: Some("xml".to_string()),
|
||||
local_part: "lang".to_string(),
|
||||
}),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
EqualityOp::Eq,
|
||||
|
@ -1279,7 +1290,9 @@ mod tests {
|
|||
primary: PrimaryExpr::Literal(Literal::String(
|
||||
"en-GB".to_string(),
|
||||
)),
|
||||
predicates: PredicateListExpr { predicates: vec![] },
|
||||
predicates: PredicateListExpr {
|
||||
predicates: vec![],
|
||||
},
|
||||
})],
|
||||
})),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue