private function positionAfterWhitespace($startPosition)
{
$body = $this->source->body;
$bodyLength = $this->source->length;
$position = $startPosition;
while ($position < $bodyLength) {
$code = Utils::charCodeAt($body, $position);
// Skip whitespace
// tab | space | comma | BOM
if ($code === 9 || $code === 32 || $code === 44 || $code === 0xfeff) {
$position++;
} else {
if ($code === 10) {
// new line
$position++;
$this->line++;
$this->lineStart = $position;
} else {
if ($code === 13) {
// carriage return
if (Utils::charCodeAt($body, $position + 1) === 10) {
$position += 2;
} else {
$position++;
}
$this->line++;
$this->lineStart = $position;
} else {
break;
}
}
}
}
return $position;
}