int startLine = line;
int startColumn = target - lineStart;
if (right == left) {
return new ParseRegion(startLine + 1, startColumn + 1);
}
target = right - 1;
if (target > left) --target; // don't know why
line = -1;
lineEnd = 0;
do {
line++;
lineStart = lineEnd;
lineEnd = Integer.MAX_VALUE;
if (line < lines.size()) {
lineEnd = lines.get(line);
}
} while (lineEnd < target);
int endLine = line;
int endColumn = target - lineStart;
return new ParseRegion(
startLine + 1, startColumn + 1, endLine + 1, endColumn + 1);
}