protected function scanSeparators(&$separators, &$result)
{
$handleNested = $this->handleNestedExpression($result);
return function (&$arguments, $open, $close) use(&$separators, $handleNested) {
$count = 1;
do {
$start = current($separators);
do {
$curr = next($separators);
if ($curr[0] === $open) {
$count++;
}
if ($curr[0] === $close) {
$count--;
}
} while ($curr[0] !== null && $count > 0 && $curr[0] !== ',');
$handleNested($arguments, $start, current($separators));
} while ($curr !== false && $count > 0);
return $count;
};
}