Fixed exponential grammar bug. Fixes
@@ -489,8 +489,7 @@ fn generate_expr(expr: Expr) -> Tokens {
state.sequence(#[inline(always)] move |state| {
pos.sequence(#[inline(always)] |pos| {
pos.optional(#[inline(always)] |pos| {
- #expr
- }).and_then(#[inline(always)] |pos| {
+ #expr.and_then(#[inline(always)] |pos| {
pos.repeat(#[inline(always)] |pos| {
state.sequence(#[inline(always)] move |state| {
pos.sequence(#[inline(always)] |pos| {
@@ -503,6 +502,7 @@ fn generate_expr(expr: Expr) -> Tokens {
})
})
})
+ })
}
}
Expr::Push(expr) => {
@@ -955,8 +955,9 @@ mod tests {
state.sequence(#[inline(always)] move |state| {
pos.sequence(#[inline(always)] |pos| {
pos.optional(#[inline(always)] |pos| {
- pos.match_insensitive("b")
- }).and_then(#[inline(always)] |pos| {
+ pos.match_insensitive(
+ "b"
+ ).and_then(#[inline(always)] |pos| {
pos.repeat(#[inline(always)] |pos| {
#sequence
})
@@ -965,6 +966,7 @@ mod tests {
})
})
})
+ })
}).and_then(#[inline(always)] |pos| {
self::skip(pos, state)
}).and_then(#[inline(always)] |pos| {
@@ -978,8 +980,7 @@ mod tests {
#[inline(always)] |pos| {
pos.match_string("d")
}
- )
- }).and_then(#[inline(always)] |pos| {
+ ).and_then(#[inline(always)] |pos| {
#repeat
})
})
@@ -991,6 +992,7 @@ mod tests {
})
})
})
+ })
}
);
}
