private function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false)
{
$aEnd = is_array($aEnd) ? $aEnd : array($aEnd);
$out = '';
$start = $this->iCurrentPosition;
while (($char = $this->consume(1)) !== '') {
$this->consumeComment();
if (in_array($char, $aEnd)) {
if ($bIncludeEnd) {
$out .= $char;
} elseif (!$consumeEnd) {
$this->iCurrentPosition -= $this->strlen($char);
}
return $out;
}
$out .= $char;
}
$this->iCurrentPosition = $start;
throw new UnexpectedTokenException('One of ("' . implode('","', $aEnd) . '")', $this->peek(5), 'search');
}