Make the comments rule style consistent with each other
@@ -28,7 +28,7 @@ pub fn factor(rule: Rule) -> Rule {
)
}
}
- // Converts `(l1 ~ l2) | l1` to `l1 ~ l2?`, avoiding trying to match `l1` twice.
+ // Converts `(rule ~ rest) | rule` to `rule ~ rest?`, avoiding trying to match `rule` twice.
(Expr::Seq(l1, l2), r) => {
if *l1 == r {
Expr::Seq(
@@ -39,7 +39,8 @@ pub fn factor(rule: Rule) -> Rule {
Expr::Choice(Box::new(Expr::Seq(l1, l2)), Box::new(r))
}
}
- // Converts `l | (l ~ r2)` to `l` since `(l ~ r2)` will never match if `l` didn't.
+ // Converts `rule | (rule ~ rest)` to `rule` since `(rule ~ rest)`
+ // will never match if `rule` didn't.
(l, Expr::Seq(r1, r2)) => {
if l == *r1 {
l
