public boolean match(@NotNull MatcherContext context) {
int lastIndex = context.getCurrentIndex();
while (subMatcher.getSubContext(context).runMatcher()) {
int currentLocation = context.getCurrentIndex();
if (currentLocation == lastIndex) {
throw new GrammarException("The inner rule of ZeroOrMore rule '%s' must not allow empty matches",
context.getPath());
}
lastIndex = currentLocation;
}