protected function addKeyValues(\Twig_TokenStream $stream, \Twig_Node_Expression_Array $values)
    {
        if (!$stream->test(\Twig_Token::NAME_TYPE)
            && !$stream->test(\Twig_Token::STRING_TYPE)) {
            throw new \Twig_Error_Syntax(sprintf('The attribute name "%s" must be an STRING or CONSTANT', $stream->getCurrent()->getValue()), $stream->getCurrent()->getLine(), $stream->getSourceContext()->getName());
        }

        $attr = $stream->getCurrent();
        $attr = new \Twig_Node_Expression_Constant($attr->getValue(), $attr->getLine());
        $stream->next();

        if (!$stream->test(\Twig_Token::OPERATOR_TYPE, '=')) {
            throw new \Twig_Error_Syntax("The attribute must be followed by '=' operator", $stream->getCurrent()->getLine(), $stream->getSourceContext()->getName());
        }

        $stream->next();
        $values->addElement($this->parser->getExpressionParser()->parseExpression(), $attr);
    }
protected function addKeyValues(\Twig_TokenStream $stream, \Twig_Node_Expression_Array $values)
    {
        if (!$stream->test(\Twig_Token::NAME_TYPE)
            && !$stream->test(\Twig_Token::STRING_TYPE)) {
            throw new \Twig_Error_Syntax(sprintf('The attribute name "%s" must be an STRING or CONSTANT', $stream->getCurrent()->getValue()), $stream->getCurrent()->getLine(), $stream->getSourceContext()->getName());
        }

        $attr = $stream->getCurrent();
        $attr = new \Twig_Node_Expression_Constant($attr->getValue(), $attr->getLine());
        $stream->next();

        if (!$stream->test(\Twig_Token::OPERATOR_TYPE, '=')) {
            throw new \Twig_Error_Syntax("The attribute must be followed by '=' operator", $stream->getCurrent()->getLine(), $stream->getSourceContext()->getName());
        }

        $stream->next();
        $values->addElement($this->parser->getExpressionParser()->parseExpression(), $attr);
    }
protected function addKeyValues ( \ Twig_TokenStream $ stream , \ Twig_Node_Expression_Array $ values ) { if ( ! $ stream -> test ( \ Twig_Token :: NAME_TYPE ) && ! $ stream -> test ( \ Twig_Token :: STRING_TYPE ) ) { throw new \ Twig_Error_Syntax ( sprintf ( 'The attribute name "%s" must be an STRING or CONSTANT' , $ stream -> getCurrent ( ) -> getValue ( ) ) , $ stream -> getCurrent ( ) -> getLine ( ) , $ stream -> getSourceContext ( ) -> getName ( ) ) ; } $ attr = $ stream -> getCurrent ( ) ; $ attr = new \ Twig_Node_Expression_Constant ( $ attr -> getValue ( ) , $ attr -> getLine ( ) ) ; $ stream -> next ( ) ; if ( ! $ stream -> test ( \ Twig_Token :: OPERATOR_TYPE , '=' ) ) { throw new \ Twig_Error_Syntax ( "The attribute must be followed by '=' operator" , $ stream -> getCurrent ( ) -> getLine ( ) , $ stream -> getSourceContext ( ) -> getName ( ) ) ; } $ stream -> next ( ) ; $ values -> addElement ( $ this -> parser -> getExpressionParser ( ) -> parseExpression ( ) , $ attr ) ; }
Add key with values in the array of values.

@param \Twig_TokenStream           $stream The stream
@param \Twig_Node_Expression_Array $values The values

@throws \Twig_Error_Syntax
Add key with values in the array of values .