in lib/src/characters_impl.dart [487:519]
bool _advanceEnd(int count, int newStart) {
if (count > 0) {
var state = stateSoTNoBreak;
var index = _end;
while (index < _string.length) {
var char = _string.codeUnitAt(index);
var category = categoryControl;
var nextIndex = index + 1;
if (char & 0xFC00 != 0xD800) {
category = low(char);
} else if (nextIndex < _string.length) {
var nextChar = _string.codeUnitAt(nextIndex);
if (nextChar & 0xFC00 == 0xDC00) {
nextIndex += 1;
category = high(char, nextChar);
}
}
state = move(state, category);
if (state & stateNoBreak == 0 && --count == 0) {
_move(newStart, index);
return true;
}
index = nextIndex;
}
_move(newStart, _string.length);
return count == 1 && state != stateSoTNoBreak;
} else if (count == 0) {
_move(newStart, _end);
return true;
} else {
throw RangeError.range(count, 0, null, "count");
}
}