You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, whenever a counted repetition is applied to a sub-expression
that can only ever match the empty string, the counted repetition can be
reduced to 1. We can achieve that optimization very easily via the
Hir::repetition smart constructor.
This is somewhat important to do because otherwise one can write
something like \B{10000}. The higher level infrastructure is somewhat
dumb about this and will happily try to match \B over and over again. We
should probably improve the higher level aspects of this (because this
is not the only case that can cause the same assertions being repeatedly
evaluated at the same position), but this fixes the most obvious ones at
the HIR level.
0 commit comments