private function parseSimpleSelector(TokenStream
$stream, bool
$insideNegation = false
): array
{ $stream->
skipWhitespace();
$selectorStart = \
count($stream->
getUsed());
$result =
$this->
parseElementNode($stream);
$pseudoElement = null;
while (true
) { $peek =
$stream->
getPeek();
if ($peek->
isWhitespace() ||
$peek->
isFileEnd() ||
$peek->
isDelimiter([',', '+', '>', '~'
]) || ($insideNegation &&
$peek->
isDelimiter([')'
])) ) { break;
} if (null !==
$pseudoElement) { throw SyntaxErrorException::
pseudoElementFound($pseudoElement, 'not at the end of a selector'
);
}