return super.match(context);
}
Record rec = root;
int ix = context.getCurrentIndex();
InputBuffer buffer = context.getInputBuffer();
char c = context.getCurrentChar();
int endIx = -1;
loop:
while (true) {
char[] chars = rec.chars;
for (int i = 0; i < chars.length; i++) {
if (c == chars[i]) {
ix++;
rec = rec.subs[i];
if (rec == null) { // success, we complected a tree path to a leave
endIx = ix;
break loop;
}
if (rec.complete) { // we completed a valid match path, but continue looking for a longer match
endIx = ix;
}
c = buffer.charAt(ix);
continue loop;
}
}
// we checked all sub branches of the current node, none matched, so we are done
break;