protected function getTagAttributes()
    {
        $stream = $this->parser->getStream();
        $attributes = [];
        $lineno = $stream->getCurrent()->getLine();
        $name = $stream->getSourceContext()->getName();

        if (!$stream->test(Token::BLOCK_END_TYPE)) {
            do {
                $this->validateAttributeType($stream, 'name', ['NAME', 'STRING']);
                $attr = $stream->getCurrent()->getValue();
                $stream->next();
                $this->validateAttributeOperator($stream, $attr);
                $stream->next();
                $this->validateAttributeType($stream, 'value', ['NAME', 'STRING', 'NUMBER']);

                $attributes[$attr] = $this->parser->getExpressionParser()->parseExpression()->getAttribute('value');
            } while (!$stream->test(Token::BLOCK_END_TYPE));
        }

        return $this->formatAttributes($attributes, $lineno, $name);
    }