private function getSourcePosition($pos)
{
$low = 0;
$high = count($this->sourcePositions);
while ($low < $high) {
$mid = (int) (($high + $low) / 2);
if ($pos < $this->sourcePositions[$mid]) {
$high = $mid - 1;
continue;
}
if ($pos >= $this->sourcePositions[$mid + 1]) {
$low = $mid + 1;
continue;
}
return [$mid + 1, $pos - $this->sourcePositions[$mid]];
}
return [$low + 1, $pos - $this->sourcePositions[$low]];
}