Tale\Jade\Parser::handleAttribute PHP Method

handleAttribute() protected method

That node is appended to the $_current element. If no $_current element exists, a new one is created Attributes in elements and mixins always need a valid name
protected handleAttribute ( array $token )
$token array the -token
    protected function handleAttribute(array $token)
    {
        if (!$this->current) {
            $this->current = $this->createElement();
        }
        $node = $this->createNode('attribute', $token);
        $node->name = $token['name'];
        $node->value = $token['value'];
        $node->escaped = $token['escaped'];
        $node->unchecked = $token['unchecked'];
        if (!$node->name && in_array($this->current->type, ['element', 'mixin'])) {
            $this->throwException('Attributes in elements and mixins always need a name, it seems you only passed a value.', $token);
        }
        if ($this->current->type === 'mixinCall' && !$node->value) {
            $node->value = $node->name;
            $node->name = null;
        }
        $this->current->attributes[] = $node;
    }