in lib/src/grapheme_clusters/breaks.dart [46:74]
int nextBreak() {
while (cursor < end) {
var breakAt = cursor;
var char = base.codeUnitAt(cursor++);
if (char & 0xFC00 != 0xD800) {
state = move(state, low(char));
if (state & stateNoBreak == 0) {
return breakAt;
}
continue;
}
// The category of an unpaired lead surrogate is Control.
var category = categoryControl;
if (cursor < end) {
var nextChar = base.codeUnitAt(cursor);
if (nextChar & 0xFC00 == 0xDC00) {
category = high(char, nextChar);
cursor++;
}
}
state = move(state, category);
if (state & stateNoBreak == 0) {
return breakAt;
}
}
state = move(state, categoryEoT);
if (state & stateNoBreak == 0) return cursor;
return -1;
}